Does anyone know how I could code a double-tap+hold trigger? For example, a binding could record and overdub on single press, double click Stop, and double-click+hold would TrackReset. This how the Ditto X1 hardware looper works, for reference.
Theoretically, it can be done by nesting OnSustain within an OnRepeat block, right?
#name doubletaphold
#sustain limit 1
#repeat limit 2
if mode == “reset”
Record
if mode == “play”
Overdub
if mode == “Overdub”
Overdub
function OnRepeat {
if repeatCount == 2
Stop
function OnSustain
if sustainCount == 1
TrackReset
}
This is just a sketch script, I’m totally unclear how the syntax should look (braces included) for the Double-Tap+Hold chunk.
Basically, is it possible to wrap Sustain within Repeat to achieve this kind of trigger, or would there be another way?