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

fanboi

2009-06-10 19:21:24

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 :)

florian

2009-06-18 12:44:28

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

fanboi

2009-06-18 16:35:54

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

DvlsAdvct

2009-06-19 17:09:37

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

florian

2009-06-22 11:51:17

Hi DvlsAdvct,

yes, that should work in the same way.

Regards,
Florian

Patch

2009-06-24 19:41:39

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?]

DvlsAdvct

2009-06-25 18:24:17

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.

florian

2009-06-26 10:36:02

@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

Patch

2009-06-26 16:04:07

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!!!

beatniks3

2009-06-26 16:33:56

please keep us updated on how it goes. I've been swamped and can't try it.

fanboi

2009-06-26 17:04:32

yeah same here, been very busy lately.
cant try it until next week even.

Patch

2009-12-05 13:38:12

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!

Johnny Vulcan

2009-12-24 12:42:15

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!

Johnny Vulcan

2010-02-16 09:02:55

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?

florian

2010-02-24 00:39:04

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

Johnny Vulcan

2010-02-27 10:56:21

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.

florian

2010-06-07 10:45:20

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

Johnny Vulcan

2010-08-09 11:51:43

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

Sarrova-Q

2020-07-30 18:02:53

Hi I figured out how to do this code for 1 fader. But how would I need to proceed for multiple faders without having conflicting saved values?

I have a button that toggles between mode A en B and want to have multiple faders with takeover in these modes.

If I use the code provided by Florian, I can't figure out how to tell Bome which fader is sending a value that needs to be saved.
Because if tt=gc and translator 2 tells gc=pp than how do I do this for multiple controls? Do I need to change every global variable (so gd, gc, gt, gs, g0 and g1 would need to become hd, hc, ht and hs, h0 and h1) for each new fader I want to assign?
Is there an easier solution with less variables (i'm running out of global variables now).

Thanks for the help!

sjcaldwell

2020-07-30 20:46:25

Hi,
Could you please post the original question to the new Forum? I will help you there.

Steve Caldwell
Bome Support

sjcaldwell

2020-07-31 02:46:19

General Guidance

1) Each fader from the DAW updates a single global variable. You need to also remember which fader you are on by understanding the fader offset (sometimes 8 if you use the bank button or 1 if you use the channel butt.
2) When updating the fader from you controller, you compare the current position to the last known position (in the global variable captured by the DAW). You only update the fader value (from the controller) if the incoming fader value has crossed over the last known position. You compare the current position to the last known position to do this and only send an update (to both the DAW and the global variable) if the positions have crossed.

You need to do this for every fader you want to control. Some DAW's are smart enough already to not update if the fader positions are out of whack to prevent jumping (they use the same type of logic) . An example is Ableton Live if you set it up that way. Not all DAW's are this smart however.

Sarrova-Q

2020-07-31 15:00:36

Hi Steve. Thank you very much for the guidance. For some reason, I can't log in for the new forum (I get an empty white page and the website keeps asking for my login password, which I type in correctly and is then followed by a new blank page).

Anyway:
I get the general philosophy behind takeover, but I'm searching for a solution that uses less global variables as I don't have enough when using the code Florian provided in this topic. (I already have a big script running)

I first tried an alternative solution, with presets for each fader that get activated when crossing the correct value, but while that works on my computer, it doesn't on some other systems. I'm taking a wild guess that it has something to do with midi delay.

So I'm really looking for a solution with less variables. I guess with Florian's code, I need to change every global variable (so gd, gc, gt, gs, g0 and g1 would need to become hd, hc, ht and hs, h0 and h1) for each new fader I want to assign? If that's the case, I don't have enough global variables left to do this.

Thanks for your help!

sjcaldwell

2020-07-31 16:09:07

OK, about the new forum. It uses different login and password. It should be the same as your Bome Product login and password and not that same as this forum. If you forgot you password, you will need to click "forgot password" for a password reset. If you forgot your login, just try and create a new account with your email address. If you have further problems there, use the contact page for help.

Now we need to track the last position of the number of tracks you need to use for soft-takeover, so if you don't have enough global variables for that, we might want to consider doubling up on some existing global variables. A global variable takes 32 bits and most MIDI is either 14 or 7 bit data so there are usually another 18-25 unused bits in a given global variable. We can use bit manipulation to manipulate different bytes within the same global variable allowing for up to 4 values (for 7 bit data) or values (for 14 bit data) per global variable. I often do this with single bits allowing one variable to control 32 LED's on or off state.

The solution I currently have requires 24 global variables ( for 24 tracks) as I use the upper 14 bits for the controller last known state and the lower 14 bits for the application last known state for comparison.

There is a lower consumption model that would require on 12 global variables, however it is a bit less reliable as if your fader skips values, it might not always "catch" the takeover.

The 24 model contains both the controller and the DAW last known values while the 12 model, contains only the DAW value.

The 24 model compares the delta of the last controller state to the delta of the last DAW state to determine a crossover
The 12 model compares the current value only to the last known state and requires zero value for crossover comparison.
Actually the 12 model is really a 13 model because I use another global variable bitmap (32 bits) do determine if the controller and DAW are in sync. The bit map determines whether to suppress outgoing messages (out of sync) or allow them to go through (in sync). When moving the fader on the daw, we set it to out of sync and once the 0 value is reached we put it back to in sync.

Again, best to continue this discussion on the new forum however as most people no longer monitor this forum. (You got lucky).

Steve Caldwell
Bome Customer Care
Also available for paid consulting services: bome@sniz.biz