Hi,
that should be possible... (sorry I change some aspects of your preset, but I think it'll be simpler like that).
First, you need a global variable that tracks which "step" you're currently in, "gs". If gs is 0, your fader is in step 1, if it is 1, your fader is in the second step, and so on.
Code: Select all
Translator 1: cycle +1
Incoming: MIDI B0 1A 7F
Rules:
gs=gs+1
if gs>7 then gs=0
Outgoing: (none)
Whenever you cycle, remember the current fader value in a specific variable, e.g. g0...g7. You need to use different variables for every distinct step. So g0 holds the last fader value when gs is 0, g1 is used when gs is 1, and so on. MT does not do that automatically, g0 is just another variable like gs. For that, we use one variable that always holds the current fader value, say "gc", regardless of step.
So use a translator like this (assuming your fader sends B0 32 xx messages):
Code: Select all
Translator 1: cycle +1
Incoming: MIDI B0 1A 7F
Rules:
if gs=0 then g0=gc
if gs=1 then g1=gc
if gs=2 then g2=gc
if gs=3 then g3=gc
if gs=4 then g4=gc
if gs=5 then g5=gc
if gs=6 then g6=gc
if gs=7 then g7=gc
gs=gs+1
if gs>7 then gs=0
Outgoing: (none)
Translator 2: fader movement
Incoming: MIDI B0 32 pp
Rules:
gc=pp
Outgoing: MIDI B0 32 pp
Now to the soft takeover. I'll re-implement it from scratch, possibly a little different from the other thread.
Whenever you cycle, you will know the most recent value of the new step in one of the gX variables, let's name it "target value". You cannot just say "ignore the fader until it has exactly the target value". Because when you move the fader, sometimes individual values are skipped, so it might never reach the target value, but skip over it. So we need to check whether the fader value has reached or overrun the target value. For that, we will also need to know the direction in which the fader has to move in order to reach the target value.
So, let's use variable "gt" as target value, and "gd" as flag for "in soft over". We can set up gd as the difference value of current fader value gc and the target value gt when cycling the step, so that we know: if target value is lower than fader value, gd is positive, and soft takeover is done once we reach gt or lower. If gd is negative, target value is higher than the current fader position, and we need to move the fader up to reach the target position. Then, we end "soft takeover" when the fader value is equal or greater than gt. If "accidentally" the fader value gc has the same value as gt, the difference is 0, and we don't even start soft takeover mode.
So, extend the translators above, as follows:
Code: Select all
Translator 1: cycle +1
Options: stop=false
Incoming: MIDI B0 1A 7F
Rules:
Label "Remember current fader value for old step"
if gs=0 then g0=gc
if gs=1 then g1=gc
if gs=2 then g2=gc
if gs=3 then g3=gc
if gs=4 then g4=gc
if gs=5 then g5=gc
if gs=6 then g6=gc
if gs=7 then g7=gc
Label "Cycle to the next step"
gs=gs+1
if gs>7 then gs=0
Label "Set target value gt"
if gs=0 then gt=g0
if gs=1 then gt=g1
if gs=2 then gt=g2
if gs=3 then gt=g3
if gs=4 then gt=g4
if gs=5 then gt=g5
if gs=6 then gt=g6
if gs=7 then gt=g7
gd=gc-gt
Outgoing: (none)
Translator 2: fader movement
Incoming: MIDI B0 32 pp
Rules:
Label "remember current value"
gc=pp
Label "map channel"
qq=0xB0+gs
Label "Check for soft takeover mode"
if gd=0 then exit rules, execute Outgoing Action
if gd<0 then goto "fader up"
Label "fader down"
if pp<=gt then gd=0
if gd=0 then exit rules, execute Outgoing Action
exit rules, skip Outgoing Action
Label "fader up"
if pp>=gt then gd=0
if gd=0 then exit rules, execute Outgoing Action
exit rules, skip Outgoing Action
Outgoing: MIDI qq 32 pp
OK... let me know how it works. I haven't tested it myself...
Regards,
Florian