Problems with changing value of switches from other elements

Discuss Lemur and share techniques.
Post Reply
rgames
Newbie
Posts:20
Joined:22 Dec 2015 22:43
Problems with changing value of switches from other elements

Post by rgames » 09 Apr 2016 04:21

I've run into this problem a number of times: I have an array of switches that send Note On/Off messages. By themselves they work fine. However, I need to synch them to items on-screen in the DAW (e.g. Mute/Solo) so that when they're activated/deactivated within the DAW the Lemur project stays synched.

So I have a global script that monitors the incoming MIDI to change the values of the switches (as appropriate based on port, value, etc). The problem is that I can't prevent the switches from running their "On Expression" scripts. I don't need them to run the scripts when activated from incoming MIDI - I just want to change their visual state from on to off or vice-versa. I've tried using a global variable that is set in the global script and checked within the switch's "On Expression" script but it appears to be ignored.

I'm attaching a simple example that shows the problem. In the project, the switch is linked to the Mute button on channel 1 of the mixer (in Cubase using Mackie Control). If I hit the button on the Lemur project, it works fine. On and off just like it's supposed to work. The TransmitCount display increases by one every for each on/off action just like it should.

But when I hit the mute button in Cubase it flashes on then off and I can see that the Lemur project is sending MIDI data out back to Cubase. Also, the TransmitCount variable keeps increasing (by two when activated from Cubase, suggesting that both the on and off scripts are executed when neither should be!). How can that be? I set the global var SendMIDI=0 on the line before I change the switch value and the switch script only executes if SendMIDI=1. So, somehow, the script on the switch is not reading the correct value of the global SendMIDI variable.

Is there something I'm missing about using global variables and/or changing switch values from other project elements?

Thanks,

rgames
Attachments
SwitchBug.jzml
(3.11KiB)Downloaded 106 times

KlangManipulation
Newbie
Posts:9
Joined:13 Jul 2016 12:16

Re: Problems with changing value of switches from other elem

Post by KlangManipulation » 14 Jul 2017 21:47

Musik ist Macht, also macht Musik! (Music is a Force, Use it!)

http://www.klangmanipulation.de

Post Reply