It seems not to work for me. The attached file contains a project that should
preset 0: initialize global variables by means of “Incoming - Project - Processing is enabled”. This is not happening, not when I load the file, not when I disable/enable the project, only when I press the panic button. When I say “File - Restart Project” the global variables are reset, which is good, but not initialized.
preset 1: set global variable “sm” (which is 0) to 1 when note A0 (h15) is pressed on MIDI channel 2 (I used sm=sm^1 this time). This is not working too.
I usually set my globals when I start the project. I fire an Init Timer to do all of my housekeeping. I set up an ‘Init Preset’ to do that.
You had your global set after recovering from a panic which is fine if that is what you want.
I’m not sure if that was your issue though.
I also noticed the alias ‘My Controller’ was assigned to my actual device but it was not enabled in my project so nothing ever worked. Since the project wasn’t setting up ‘My Controller’ as one of the default input, nothing was happening.
I usually assign my incoming triggers at the preset level and you are using all incoming devices. You might want to organize your presets by each device unless you want your triggers to occur by any device and send message to all devices.
Also it looks like your trigger for detecting Setting (Note A0) was on MIDI CH 2, so maybe that is why it wasn’t triggering. All of your other translators look at MIDI CH rm (which is 0 or MIDI CH 1).
Thank you very much, Steve, for the “Init” preset. I would never have even thought of that, as I don’t know what a timer is and never used one. But this works for me and I will use this technique for further projects.
MIDI Channel 2 was intentional. The problem was that I inadvertedly required the volume of the “note on” to be 127. Now also the sm=1-sm works perfectly and there is no distinction between a global variable being 0 and a global variable being non existent, as suggested in the title of the thread.
Another problem popped up as I continued with that project.
I have the following rules:
//not in setting mode?
if sm==0 then exit rules, execute Outgoing Action
//set split to appropriate zone
if sz==1 then z1=tt
Log ‘z1 = %z1%’
if sz==2 then z2=tt
if sz==3 then z3=tt
if sz==4 then z4=tt
exit rules, execute Outgoing Action
and upon executing this translator the global variable z1 is given the value of 59, as the log statement shows, but the variable z1 is not shown when listing the global variables:
17434137 - MIDI IN [BomeBox: Piano de Voyage]: 91 3B 68
17434137 - 1.4:5 z1 = 59
17434137 - MIDI OUT [BomeBox: BomeBox DIN]: 91 3B 68
17434208 - MIDI IN [BomeBox: Piano de Voyage]: 81 3B 68
17434208 - MIDI OUT [BomeBox: BomeBox DIN]: 81 3B 68
List of all global variables:
mc=5 m1=6 rm=1 sm=1 sz=1
Stop processing after execution of this translator is checked for this translator.
Why is z1 not shown in the list of global variables along with its value ?