fingerlight
2018-01-30 21:49:58
Since Midi Translator initializes all global variables to zero on startup, does it make sense to initialize the ones in use by my project (other than the ones that need to have a non-zero value)?
fingerlight
2018-01-30 21:49:58
Since Midi Translator initializes all global variables to zero on startup, does it make sense to initialize the ones in use by my project (other than the ones that need to have a non-zero value)?
Steve-Bome Forum Moderator
2018-01-30 22:03:12
You don’t need to set them but it is a good practice to at least document them in a single location. I generally do this by setting them and putting in comments what they are for on a translator I call “Init Global Variables”. In that translator I use Init timer as input. I also have another translator that monitors for my escape key that triggers the Init timer. I use that to put my project into a “known” state if I need to after the project has started.
fingerlight
2018-01-30 22:12:54
comment
Hi Steve,
Thanks for the reply. I wish I had done that at the start of my project. It would probably even be a good idea to do it now that I’m close to the end of coding, but time will tell if I have the gumption to really do it.
As for putting the variables into a known state after the project has been started, I’ve been doing that by doing “Restart Project” (in the file menu). Is there any difference?
I owe you a posting about MIDIBuddy. I’m using it, but find that, for my purpose, it’s best to deactivate and reactivate the presets that actualize MIDIBuddy commands using the functions provided by MT function. The Ctrl Alt R and Ctrl Alt P functions do work, but got me into difficulties when my code needed to send Ctrl, and in other situations as well, I think. I’m just pushing ahead with my coding…not looking left or right, but just intent on getting it done. After that I’ll have time to make a full report on how MIDIBuddy works best for me.
Thanks,
Gabriel
Steve-Bome Forum Moderator
2018-01-30 22:15:38
comment