Page 1 of 1

soft take over, mackie and a quite long list of rules?

Posted: Wed Jun 10, 2009 6:21 pm
by fanboi
hi. i have been searching and searching and reading and reading trying to figure out how to make soft take over work for my hercules fader.

for those that doesnt understand what i mean with soft take over mode, heres a good thread for reference: http://www.bome.com/forums/viewtopic.ph ... ore++value

that works in theory, but the problem is that im using a 8 step cycle and let this cycle output note on messages for track selection via the mackie control spec, and also using the same cycle for the fader in question.

now, i could theoreticly use preset siwtches for it, but that would take away the ability to switch banks (unless i manually make 8x8 banks in my preset), and my mackie test preset has the bank switches all settled already so id rather not do that.

i basicly just want the same thing that guy wants in that thread, but for a hardware fader instead, and i also want that fader to send on channel 1 for cyclestep 1, channel 2 for cyclestep 2 etc. meaning a fullon mackie emulation with one hardware fader without value jumps!

i know, what is this cyclestep i am talking about?
i took this thread here: http://www.bome.com/forums/viewtopic.php?t=2134 and modified it so that it will cycle 8 times before resetting, and when using the bank switch buttons with the mackie emu mode that means i now have a track selector that automaps the hardware fader to the selected track, and that its bankable, think of it as a tranzport/alphatrack emulator if you wish. ;)

but yeah, how in the world do i get a soft take over working with this setup?

for reference, heres the preset: http://www.sendspace.com/file/llz44g

any help would be very appreciated :)

Posted: Thu Jun 18, 2009 11:44 am
by florian
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

Posted: Thu Jun 18, 2009 3:35 pm
by fanboi
whao.
yeah i figured i needed one variable per step, although i had no clue how to implement it. img oing away during the weekend, but ill give it a try when i come back.

thanks alot man :D

Posted: Fri Jun 19, 2009 4:09 pm
by DvlsAdvct
I am currently using preset changes, instead of variable changes.

Does this mean that I can use global variables in the presets themselves (so something like "On Activation of This Preset gs=0" instead of cycling through? Right now I only have two presets per knob. That make sense?

Thanks a lot

Posted: Mon Jun 22, 2009 10:51 am
by florian
Hi DvlsAdvct,

yes, that should work in the same way.

Regards,
Florian

Posted: Wed Jun 24, 2009 6:41 pm
by Patch
Okay - this is REALLY interesting to me!!!

Does this mean that I can have one knob, transmitting the same midi value on 4 different presets (but on different midi channels on each preset) that can ALL be used simultaneusly without any controller jumps when switching between presets/midi channels???

Please tell me this is possible...

[From the above, I assume I'd need to make each cycle 127 steps long to accomodate the 127 steps on a midi knob?]

Posted: Thu Jun 25, 2009 5:24 pm
by DvlsAdvct
I haven't implemented it yet, but I think tonight or this weekend will be crunch time to finally finish my mappings for my VCI... but

yes, this means that you can use one knob across multiple presets to control multiple parameters and not have any controller jumps when switching.

You don't need to map out 127 steps, but, at least my guess is, only as many steps as you have presets. So, for example, I want my EQ to control Decks A and C with soft takeover, I only need two steps to program in.

Posted: Fri Jun 26, 2009 9:36 am
by florian
@Patch: yes, you can that.
Note, "steps", as used above, is a misnomer. It does not mean how many values the knob can have. It means how many different controllers it controls, or on how many channels you want to send with the same knob. So, maybe "mode" is a better term.

So, with the preset that I have outlined above, you will have 8 different "steps", I mean: "modes" for ONE incoming knob (or slider). So you can control 8 different controllers with just one knob, or send on 8 channels with one knob, and so on, with soft takeover logic. All 128 values of the knob are supported.

Also note that you do not need multiple presets. The scheme above will work with one preset. All you need is those two translators for 8 modes. You can easily extend it to 16 or more modes.

Florian

Posted: Fri Jun 26, 2009 3:04 pm
by Patch
At the moment, I just want to support 4 presets (or banks) on my controller, so I'll effectivey have the equivalent of 4 midi controllers all from the same unit - this looks like I'm finally gonna get soft takeover!!!

So now I just have to set up the above translators for EVERY controller on my midi controller (loads of faders and knobs!)...

Great work, guys!!!

Posted: Fri Jun 26, 2009 3:33 pm
by beatniks3
please keep us updated on how it goes. I've been swamped and can't try it.

Posted: Fri Jun 26, 2009 4:04 pm
by fanboi
yeah same here, been very busy lately.
cant try it until next week even.

Posted: Sat Dec 05, 2009 1:38 pm
by Patch
GRRRRR!!!

I can't get this working. To be honest - I can't even get my head around what is being done!

I want to use soft takeover on my UC-33e, so that I can use 4 of the standard presets, giving me 4 sets of knobs/faders/buttons, that will not "jump" values when switching presets.

I understand that it'll be a lot of work, because I'll need to set up a translator for each knob/fader/button, on each of the 4 presets.

Can I do this? Can I hot swap between presets? (ie - go from preset 1, to preset 3, to preset 2, etc... without values jumping?)

Cheers - I really hope I can get this done!

Posted: Thu Dec 24, 2009 12:42 pm
by Johnny Vulcan
The rules above work a charm. Awesome. I'm good at breaking things down into plain english if anyone needs help implementing the soft takeover scheme.
Thanks guys!

Re: soft take over, mackie and a quite long list of rules?

Posted: Tue Feb 16, 2010 9:02 am
by Johnny Vulcan
Florian,
I'm looking for one more aspect to add to this functionality. Right now, if you're in a step and you move the continuous controller but do not reach the target value, the last position of the continuous controller is stored as the new target value. IE, you move a fader a bit, but before you meet the target you need to jump to a different step, like say in a fast paced performance. This wouldn't happen often, but if it does, the result is that the new target value is now different than the original value, resulting in a mismatch with variable gc, and we get a parameter jump. Is there a simple way to say, if the fader/knob is moved, but does not reach the target value, then we take into account the amount moved, and revise the variables accordingly in relation to the new gc variable?

Re: soft take over, mackie and a quite long list of rules?

Posted: Wed Feb 24, 2010 12:39 am
by florian
Hi, yeah, you're right. Below is the full enhanced code. I've only change the first translator up to Label "Cycle to the next step".

Code: Select all

    Translator 1: cycle +1
    Options: stop=false
    Incoming: MIDI B0 1A 7F
    Rules:
      tt=gc
      Label "if we're in soft takeover, use the target value"
      if gd!=0 then tt=gt
      Label "Remember current fader value for old step"
      if gs=0 then g0=tt
      if gs=1 then g1=tt
      if gs=2 then g2=tt
      if gs=3 then g3=tt
      if gs=4 then g4=tt
      if gs=5 then g5=tt
      if gs=6 then g6=tt
      if gs=7 then g7=tt
      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
Let me know how that works.
Florian

Re: soft take over, mackie and a quite long list of rules?

Posted: Sat Feb 27, 2010 10:56 am
by Johnny Vulcan
Lovely. It's a perfect fix. Seeing how simple it is really helps in learning too.

I've got another brain teaser for ya though. Been working on this for ages, and can't seem to find the solution. I'll bet it's just as simple, but if you can help, I'd be forever grateful:

Let's say the number of steps is just two - a toggle using button A
Let's say there's just one fader who's behavior is determined by the step.
But let's say an additional button - button B - turns on a global layer that silences any output from the fader.
BUT we want any fader movement while in this layer to be reflected and implemented into the variables such that when exiting the button B layer, the new fader position is taken into account relative to where it was before entering the button B layer.

Furthermore, while in the button B layer, we still want to be able to cycle through the two steps, recalculating new fader positions when in either step (even though output is ignored).

Does that make sense? Essentially I just need a way to remember the fader position for all steps when entering a "silent" mode, where the fader could be moved in either step, remember the new positions when exiting, and then have the old targets be relative to the new positions.

Re: soft take over, mackie and a quite long list of rules?

Posted: Mon Jun 07, 2010 9:45 am
by florian
hi, sorry for the late reply!

Button b can set a global variable, say h0. Now in translator 2, make sure that the translator is not executed when h0 is non-zero:

Code: Select all

IF h0!=0 THEN exit rules, skip Outgoing Action
In order to not need to repeat that every time, you can use GOTO:

Code: Select all

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 goto "execute"
    if gd<0 then goto "fader up"
    Label "fader down"
    if pp<=gt then gd=0
    if gd=0 then goto "execute"
    exit rules, skip Outgoing Action
    Label "fader up"
    if pp>=gt then gd=0
    if gd=0 then goto "execute"
    exit rules, skip Outgoing Action
    Label "execute"
    IF h0!=0 THEN exit rules, skip Outgoing Action
    exit rules, execute Outgoing Action
Outgoing: MIDI qq 32 pp
Hope that makes sense!
Florian

Re: soft take over, mackie and a quite long list of rules?

Posted: Mon Aug 09, 2010 10:51 am
by Johnny Vulcan
Thanks for the reply, Florian! Better later than never. So I tried implementing this, and there is one problem as far as I can see. As it is, this works fine if you don't change steps while "Button B" is on. But if you do, re-calculation of gd and all associated variables gets tied to the new fader position, instead of where you left it before "B", and the result is parameter jumps after exiting the Button B layer and using the fader again.

Look forward to hearing your thoughts!

-Z