I'm using the
JSFX Chord Display so whatever chord I input from the midi keyboard will display.
The script below will get the time pos of the region with the same name as the chord display, it's only going to the first region it finds with that name maybe it can be made to go to wherever that name occurs randomly or I could just have one region for each chord. When Reaper goes to that region it will time select it and be set to loop so it will keep playing that chord until you input another. It needs to work like Region Playlist it won't go to that region until it's finished playing the current beat.
I just don't know how to do it, if it needs to be all in JSFX ?
Code:
chord_input = (chord_key .. chord_type .. "//" .. chord_bass)
local reg_cnt = reaper.CountProjectMarkers(0)
local chords = {}
for i=0, reg_cnt-1 do
local _, isrgn, pos, rgnend, name, index = reaper.EnumProjectMarkers( i )
if isrgn then
chords[name] = {Start = pos, End = rgnend, Name = name}
end
end
time = chords[chord_input].Start