Sustain Toolkit (Note Switching)

Provides editable piano-type sustain for MIDI apps that do not record controllers. Some iOS apps have sustain controller (CC#64) recording and editing (e.g. Cubasis) but not all MIDI recorders do e.g. NanoStudio2 records the note length extended by the sustain pedal but not the controller and Atom Piano Roll ignores controller data. The solution – two MOZAIC scripts. The first MOZAIC script ‘Sustain CC to Note Number v1.0’ converts CC#64 to a selectable Note On / Off. Choose a note that is outside the performance range – 108 (C7) is suggested. I experienced a problem with Atom Piano Roll when I used 127 (G8), the highest MIDI note. There are two differing standards for assigning notes to MIDI note numbers – Atom shows note 108 as C8 and the highest note it will record is 115. This encoding MOZAIC script needs to be hosted in AUM or similar AUv3 host that can route MIDI from the input keyboard, through the MOZAIC script and then to the input of the MIDI recorder e.g. the virtual input of NanoStudio2.


The second MOZAIC instance with script ‘Note On Sustain v1.0’ can be run as a MIDI FX in NS2 and picks up the nominated key Note On / Off (make sure it is the same as the key set in the first script) and delays Note Offs until pedal release so there is no reliance on the host app to process the sustain controller. This script is based on Bryan Appel’s Sustain Pedal v1.4 but modified to operate from a Note On / Off rather than the Sustain Controller CC#64. If using NanoStudio2, it is important to set Track Input to ‘NanoStudio2’ otherwise extended note lengths are captured from the script’s output, defeating the object of the exercise. If all has been set correctly, the raw note lengths should be recorded and the sustain controller data should be visible encoded as Note On / Off on the nominated key. Alternatively, if your recording app can be hosted in AUM or similar e.g. Atom Piano Roll, then the second MOZAIC instance can also be run there also routed between the recorder output and the AUv3 instrument.

MIDI In > MOZAIC(1) > Atom > MOZAIC(2) > AUv3 synth

The scripts can be used individually – the ‘Sustain CC to Note Number v1.0’ can be used to key a drone, or a kick drum or cow bell from a sustain pedal. The script ‘Note On Sustain v1.0’ can be used if you don’t have a sustain pedal or the keyboard doesn’t support one – just set the sustain key to be, say, the lowest note on the keyboard and then use that to switch sustain on or off as you play.

Thanks also to -ki for the Textastic MOZAIC language support.

Leave a Reply

  • Platform:
  • Category: Utility
  • Revision: 1.0
  • License: MIT License
  • Modified: 4 years ago
  • Views: 360
    Likes: 0
    Downloads: 41