A simple script: Overdub/Undo (or whatever else you might want) with the same button

mercredi 19 août 2015

Hi, I just wanted to share with you a simple script that I've written.

My MIDI controller has only 4 buttons so I have to be creative with how I use them. I thought it would be worthwile to combine Overdub and Undo functions on the same button, so you press the button quickly (short press) to Overdub and if you make a mistake you press the same button a little longer (long press) and you Undo it, and press it again quickly to Overdub again, this time correctly (if you're lucky, if not, repeat steps :) )

You don't do a tap dance when you make a mistake :)

If nothing else, you've saved one button.

Here's the code:
Code:

!name _Overdub/Undo

!sustain 500

# long press:
label sustain
    if sustainCount = 1
        Undo
    endif
end

# short press:
label endSustain
    if sustainCount = 0
        Overdub
    endif
end

If you want some other functions to be performed with the same button, just replace Overdub and Undo with what you find necessary (ie. Undo/Redo, Pause/Mute, ..). Look up the name in the MIDI binding window.

** Note that "short press" function is called when the button is de-pressed (ie. you raise your foot from footswitch) so it might be awkward for functions whose timing is very critical (like very first Record - but you probably won't use it for that).
I don't think this can be fixed since it's from the time itself (of button being pressed) that the computer concludes whether the press is long or short. But you can press and depress a button very quickly and see if it's good enough.


I know how bad programming Mobius can be. I'm a programmer but I've still had a somewhat tedious and difficult time going through (unfinished) manual and figuring out all the concepts and stuff. And if you're not into computers (a lot) and go read about scripting because somebody told you to it's probably like "what the hell is this?? :confused:". This is one of the very basic scripts that everbody will appreciate.


0 commentaires:

Enregistrer un commentaire

 

Lorem

Ipsum

Dolor