Momentary button to send effect with max value

3.01K viewsCSS Questions
0

I have a momentary button and I wanna send my send1 to max value (127). I also have a Knob1 that controls the send1. But additionally I want to have a that momentary button. For some reason I can’t manage to send the value of the send1 to max when pressed.

I tried with reaction, but without success (but maybe there is a easier way):

Listener: Button 1o was pressed
Action Block1:
Condition: Button 10 latest velocity value is equal – 127
Action: MIDI Controller – send MIDI velocity value to Controller input Knob1 Value 127
Action Block2:
Condition: Button 10 latest velocity value is not equal – 127
Action: MIDI Controller – send MIDI velocity value to Controller input Knob1 Value 0

Maybe it’s wront to send the velocity value to Knob1, but I couldn’t find an option how to set the send1 directly.

Any ideas on how I can achieve this?
Any help is appreciated

Rouz Answered question
Attached Files:
0

I found a way, for dividing the list of buttons among different tracks, that works (by using the result and remainder of a division between the listener_number and the amount_of_buttons_assigned_per_track) but in the process came across something that bugged me about modes.

Initially I had only tested the funtion being called by a Reaction in the Global Mode. That meant that the function would be called, in whatever Mode was active. This worked fine. But what if you wanted to use the same buttons for other functionalities in different Modes?

To isolate this function to a specific Mode, you’d need to make a Reaction that calls the function from Mode 1 and then another Reaction that calls the function from Shift Mode, under the same Listener conditions. If you wouldn’t create the same Reaction for the Shift Mode, then the buttons wouldn’t fire the function while in Shift Mode. The problem that arises from this is that Shift Mode is inside the domain of the Global Mode, and can be called upon from within any other Mode.

EXAMPLE: if we’ve changed from Mode 1 to, let’s say, Mode 2, then activating Shift Mode from Mode 2 would still let you call upon the function, which would make the relative Sends change values whenever 1 of the Listeners is activated. To reword this a bit: while in Mode 2, none of the buttons would activate a Send; but when using Shift Mode from within Mode 2, the buttons would activate the Sends relative to the Shift Mode. This would be unwanted behaviour; we only want Shift Mode to activate Sends when coming from Mode 1.

So, I’ve been thinking on how to resolve this problem but it’s been a bit of a headache. I’ve found a solution that works fine but it’s also a little messy. I’m going to take my time to review the code; maybe a better solution will arise or else I’m just going to try and mitigate the amount of bugs that can occurr.

For now, here’s the piece of code I’m using to solve what you asked for:

Glenn V. Posted new comment

Could you use a condition in the reaction to check the active mode first?
script > active mode number

If the Reaction with the custom function was set in a Global Mode, then you might be able to use this approach. But then we would have to keep track of the previous mode so that the Reaction only fires in Shift Mode when the Main Mode was active beforehand. This would also mean people need to figure out the Active Mode Numbers in their script and insert them in the Reaction and script. I was hoping to find a way around this.

Atm, I’m using 2 Reactions that keep track of the Main Mode and Shift Mode’s activation and deactivation. If the time between Main Mode deactivating and Shift Mode activating is less than 1 second, a variable in the script will tell the function it can proceed while in Shift Mode. It works but now we have at minimum 3 Reactions, if we use a Global Mode to fire the function with, or 4 Reactions, if we’d separate the function calls for the Main Mode and the Shift Mode.

I’ve tried combining the Reactions that tracked Mode Activation and Deactivation with the respective Reactions that would call the function. It seems to be working as intended, meaning I was able to slim it down to only 2 Reactions (one for the Main Mode and one for the Shift Mode) + with the added benefit that the user won’t have to input the active_mode_number inside the script anymore.

If it would be possible to slim it down to only 1 Reaction, that would be the best outcome. I’ll give it some time still, maybe an idea will come.

I noticed there’s nog Listener anymore for when the “Mode has Changed”. Is this because of the implementation of the Global Mode in CSS3? That Listener would have been useful in this circumstance.

You are viewing 1 out of 16 answers, click here to view all answers.