Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 10-13-2019, 10:05 PM   #1
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default JSFX Chord Display match Region Name (another too hard basket ?)

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
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.