Some help needed again with rules and variables

bsfreque

2013-01-24 22:44:24

Hi! 

I'm trying to figure out how to do the following:

I have 8 effect sends in ableton, all assigned to different midi CC's. 
I would like to have the effect channel muted with midi command when all the sends are at 0 value.
(my external effects processor sends a little hiss even when nothing is going in it)

I figured I might be able to do this with a global variable, so that by default g0 would be 0, (fx channel off), and with all send knobs down to zero. 
Then turning one send up, would increase g0 by one (g0=g0+1) and turning it back to 0 would decrease the variable value by one (g0=g0-1)
This way the fx channel would only turn off, when all the sends are down to 0.

But I could't figure out how to send the g0+1 value ONLY when the button is turned up from 0, and not when adjusting the same send level again later. And also ONLY going down from >0 would decrease the g0 and not when turning the knob down when already at zero.

Hopefully I'm clear enough. I've been trying to figure this out for a few hours and I'm starting to get quite tired. Thanks again for your help!! I really appreciate it!

Best regards, 
Bsfreque

P.S. a search function might be useful in MT (search by name or midi command) I have dozens of presets and hundreds of translators in them, and finding one command can sometimes take quite some time eventhough I have named all of them to know exactly what they do. ;)

metastatik

2013-01-26 17:53:27

The easiest way to do this would be to use a separate global variable for each knob that would simply store the last value each knob sent and you’d only send the mute message when all of them equal 0.

If that would use too many global variables, it’s also possible to use bit manipulation to do this, which would only need one global variable. This is a bit complex though. In short, each knob would set/unset a unique bit in the variable’s value. When all are unset, the global variable would equal 0 and you’d send your mute message.

For example, your first knob translator would look something like this:

Code: Select all

Incoming: B0 00 vv
Rules:
rr=ga&1
oo=1
if vv == 0 then oo=0
if rr != oo then ga=ga^1
Outgoing: B0 00 vv
The first rule applies a mask that will determine whether or not the unique bit (1) has been set. If it has been set, rr will equal the unique bit (1). Otherwise, it will equal 0.

The 2nd rule sets oo to the unique bit (1). If vv==0, the 3rd rule sets oo to 0. These 2 rules determine whether the bit should be set or unset.

The last rule checks whether or not the current state of the unique bit (rr) is equal to the state the unique bit should be in (oo). If not, it either sets or unsets it accordingly.

Your successive knob translators would look the same except the value of the unique bit would be double that of the previous. So the 2nd knob would use 2, 3rd would use 4, etc.

bsfreque

2013-01-26 21:20:08

Cool, thanks a lot for explaining the bit manipulation!

I got it working by using separate global variables, but I'll definately try the bit manipulation way when I've got some more time. Seems so advanced that I really need to sit down to figure that one out. :D