Page 1 of 2

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Mon Dec 28, 2020 6:26 am
by Azimuth (Archive)
Image

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 )
 

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Tue Dec 29, 2020 12:35 pm
by Jae.Thomas
wow very cool

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Sun Mar 14, 2021 2:35 pm
by E_V
I just saw that... wonderful!

But I have a question: Is it possible, to have it vice versa? Say in Reaper setting up regions with the according names and bringing that into Jamstix so that Jamstix makes a song(structure) from that?

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Sun Mar 14, 2021 7:12 pm
by Azimuth (Archive)
No, that isn't possible unfortunately.

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Tue Mar 16, 2021 3:07 pm
by E_V
I thought I ask... :-)

Thanks for clearing that up. I have no clue about scripting and such.

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Tue Mar 16, 2021 10:34 pm
by Azimuth (Archive)
I have no clue about scripting and such.
Me neither, you should have seen how many failures it took before I finally managed to make one that worked. :lol:

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Sat Mar 27, 2021 11:16 am
by Jae.Thomas
doesn't work for me...

i don't get an import screen when I shift drag the song title..

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Sat Mar 27, 2021 4:42 pm
by Jae.Thomas
I think it's cause maybe I had another tab open? It works now :)

...and then it didn't work again.

But, all I had to do was to rerun the script and highlight jamstix.mid again.

But I couldn't get the initial song to import.

something seems off....

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Sun Mar 28, 2021 3:18 am
by Azimuth (Archive)
I don't know what changed, or when, but it looks like if the Jamstix window doesn't have focus the script shortcut doesn't work. It used to.

EDIT: It is definitely something to do with window focus but I'm not sure what. It does work consistently for me if I click in the Jamstix window first or use the custom action button I made for my toolbar.

EDIT ll: Jae are you using Fabian's MFXlist script? I think that is stealing focus after opening Jamstix' gui from within it. Just click in the Jamstix window before running the regions script and see if that solves it.

Updated 11/11/2021 Jamstix 4 Reaper Regions script

Posted: Sun Mar 28, 2021 10:57 am
by Jae.Thomas
I am using dopp_fx - when I shut that off it worked.

one other thing, can it just remember where jamstix.mid is and load it? i had to navigate there after importing a video into reaper