Old 01-21-2020, 05:02 PM   #1
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default Q about reaper.StuffMIDIMessage in Lua

Is it possible to increment the value of prg every time a script is run ?
I would like to set up program changes for a particular vst synth from the tool bar. I am wondering if the current value in this case 'prg' would need to be written to an external file for storing and updating ? Or maybe it's much simpler ?



prg = 0

reaper.StuffMIDIMessage( mode, msg1, prg, msg3 )


Thanks,


J.
J Reverb is offline   Reply With Quote
Old 01-21-2020, 05:59 PM   #2
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

This isn't so much a question about StuffMIDIMessage() but about how to store state.

Take a look at the Get/SetProjExtState() and Get/SetExtState() APIs.
tack is offline   Reply With Quote
Old 01-22-2020, 03:17 PM   #3
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

Thanks tack

That's sorted it using Has/Get/Set tonumber and tostring.
Nice one for the heads up.
J.
J Reverb 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 08:55 PM.


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