CustomButton that sends one CC and reacts to another?

Discuss Lemur and share techniques.
Post Reply
brianc
Regular
Posts: 87
Joined: 10 Jan 2012 02:16

CustomButton that sends one CC and reacts to another?

Post by brianc »

I'm interested in using a CustomButton that, when pressed sends a MIDI CC, but I need it's state to depend on another MIDI CC. The second CC is something that I don't have any other controls for in my interface. I'm thinking maybe I'll set the button to be a pad, and have its color depend on the value of the second CC.

Is it possible to have a script that's not associated with a control object monitor for incoming CCs? Or has anyone done this another way? I've done it with OSC, but I have to stick with MIDI on this.
brianc
Regular
Posts: 87
Joined: 10 Jan 2012 02:16

Re: CustomButton that sends one CC and reacts to another?

Post by brianc »

I'd still be happy to hear if anyone has a cleaner way to do this, but here's what I did:

I created two CustomButtons, one for each MIDI CC. I made the one that I want to see a pad. That button handles the MIDI CC that I want to send. The second button handles the MIDI CC I want to receive. For the first button, I made a script that runs whenever there's a change in the second button's X value. It updates the color accordingly, e.g.:

if(second.x)
{
setattribute(first, 'color', active_color);
}
else
{
setattribute(first, 'color', inactive_color);
}

And for the second, I created a script that runs on load and hides the button:

show(second, 0);
Post Reply