View Single Post
Old 11-13-2018, 09:45 PM   #158
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

Quote:
Originally Posted by mccrabney View Post
MPL, i made it work so that "Script: mpl_Export selected items to RS5k instances on selected track (drum mode).lua" doesn't ask for user input for which midi note to assign.

instead, it references a track which has a dummy JS whose 1 param is controlled by OSC to output the last hit midi note. your script looks at that value and uses that.

it works beautifully.

Code:
    -- get base pitch
      for i = 1, reaper.CountTracks(0) do
            inqtrack = reaper.GetTrack(0,i-1)
            _, tr_name = reaper.GetSetMediaTrackInfo_String( inqtrack, 'P_NAME', '', 0 )
            if tr_name:lower():find("inq") then
              val = reaper.TrackFX_GetParam(inqtrack, 0, 1)
              reaper.ShowConsoleMsg("[value] - ")
              reaper.ShowConsoleMsg(val)
              reaper.ShowConsoleMsg("\n")
              end
            end
      base_pitch = math.floor(tonumber(val))
i am using a similar OSC / getparam trick to have my launchpad light up pads corresponding to RS5K's "Note range start" param
Still no so obvious to me. Ideally if should run a defer loop inside waiting for changes in the MIDI log I requested here:https://forum.cockos.com/showthread.php?t=212605
mpl is offline   Reply With Quote