
Please Read The Edit Notes
Hi everyone,
Back in May (I think) I wrote a LUA script for use in Reaper to convert specific midi notes in Jamstix to Regions. I decided to update it to take advantage of Jamstix 4's new Song Structure export feature. This resulted in a much more straight forward procedure. (No more manually adding midi notes) This new version no longer supports Jamstix 3. Requires Reaper 5+. SWS extensions (used here) also allows auto coloring of the regions.
Thank you Ralph for supporting my idea.
1) Shift+Drag the song title into Reaper.
2) Click "CANCEL" when the Reaper Import window appears.
3) Use the shortcut key you assigned to the script in Reaper.
4) Click OK
If you make a mistake in the process, just run the script again. It will delete all of the existing Song Markers and Regions and recreate them.
EDIT: If you change your song structure, shift+drag the song title again to recreate Jamstix.mid with the new structure.
EDIT 2: Updated the error message in the script.
EDIT 3: Updated the code so the jamstix.mid file is located correctly. The Windows File Explorer window no longer opens to locate the file as shown in the .gif.
EDIT 4: Updated to stop script from adding extra unneeded track(s).
EDIT 5: Updated to return to previous TCP view after running.
Code: Select all
function msg( _ )
reaper.ShowConsoleMsg( _ .. "\n")
end
delete = reaper.NamedCommandLookup( "_SWSMARKERLIST10" )
convert = reaper.NamedCommandLookup( "_SWSMARKERLIST13" )
local isthere
isthere = false
isthere = reaper.file_exists("C:\\ProgramData\\Jamstix4\\jamstix.mid")
reaper.Undo_BeginBlock()
if isthere == false then
reaper.Main_OnCommandEx( 40697, -1, 0)
msg(" [1] Please build your song in Jamstix first. \n \n [2] If you have already built your song, then shift+drag the Song Sheet [Song Title] \n into the Reaper window. \n \n [3] If you change your song structure, shift+drag the Song Sheet [Song Title] again \n to re-generate, reflecting the new changes.")
goto quit
else
reaper.Main_OnCommandEx( 40042, -1, 0)
reaper.Main_OnCommandEx( 40297, -1, 0)
reaper.Main_OnCommandEx( delete, -1, 0)
reaper.Main_OnCommandEx( 40702, -1, 0)
reaper.InsertMedia("C:\\ProgramData\\Jamstix4\\jamstix.mid", 0)
end
reaper.Main_OnCommandEx( convert, -1, 0)
reaper.Main_OnCommandEx( 40005, -1, 0)
reaper.Main_OnCommandEx( 40042, -1, 0)
reaper.Main_OnCommandEx( 40848, -1, 0)
::quit::
reaper.Undo_EndBlock( "Azimuth_Jamstix 4 Regions", -1 )