Talk to other MIDI Designer users about MIDI Designer, iOS MIDI and related topics. Or share layouts, pages, and ideas.

Also check out the Facebook Group.

Of course, if you want to send us an email, feel free.

MIDI Designer
Design your perfect MIDI controller for iPad, iPhone and iPod touch.
How to make a sustain (slider) pedal that toggles a hold? - MIDI Designer Q&A

How to make a sustain (slider) pedal that toggles a hold?

+1 vote
asked Aug 15, 2020 in Advanced by stevee00 (380 points)
The backup answer to all of these questions is "use the Stream Byter plugin (IAP)." Initially this doesn't sound like something you can do out of the box with MIDI Designer, but user might correct me.
To put my question more generally:  how to have a slider supercontrol toggle a subcontrol?  So that each time the slider hits maximum ON, the toggle toggles, off or on. I've seen tricks done with a 2-tick knob, but I couldn't get it to work.


1 Answer

0 votes

Toggle Messages above a preset value

Sorry for the delay, was having some dyslexia on the Streambyter rules, which was driving me nuts, but here it is:

This works as either an input or output Streambyter rule.  As input - you will see the "toggled" behavior in MDP2.  As output, you will see the raw control behavior.

You need two essentially identical controls
- First receives the external midi, is supercontrol of second
- Identical to, and subcontrol of above - except midi receive off - retransmits the midi outbound

Midi architecture is:
   Sustain Pedal -> MDP2 -> Controlled Board

With stand alone Streambyter, this code would go inline between the pedal and the board.  All MDP2 really is doing here is applying the Streambyter rules between input and output.

# Toggle sustain messages on channel 1 above 120 (78) - trigger value
# Need a four state machine, as follows:
# I0    I1
# 0    0 - Below trigger value - operate normally
# 1    0 - Above trigger value - ready to trap sustain messages
# 0    1 - Below trigger value - blocking sustain messages    
# 1    1 - Above trigger value - release on drop below

  ASS I0 = 0
  ASS I1 = 0

IF M0 == B0 40 #  Channel 1 sustain message, so go to work
    if I0 == 0 0 # nothing happening yet
        If m2 >= 77
            ASS I0 = 1 0 # Detected pedal above trigger value

    if i0 == 1 0 # In initial trigger state
        if m2 < 77 # Now dropped below trigger value
            ASS I0 = 0 1
            B0 40 = xx +B # Block sustain message

    if i0 == 0 1 # in blocking mode
        if m2 >= 77 # Back above trigger value
            Ass I0 = 1 1
        if m2 < F0
            B0 40 = xx +B # Block sustain message

    if I0 == 1 1 # back to normal on drop below
        if m02 < 77
            Ass I0 = 0 0
answered Aug 16, 2020 by jkhiser (10,110 points)
edited Aug 17, 2020 by jkhiser
Thank you for this; you are very generous. I'll see if I can get it to work.