You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Sustain Pedal for Organ

I'm trying an organ which like many does not have a sustain pedal so it ignores CC64 messages. I have therefore tried to using the scripter to step in and suppress NoteOff messages when the pedal i pushed and then to send and allNotesOff when the pedal is released. The suppression works but the notes stay on after the pedal is released. Script is below. Can anyone advise why this is not working? Thanks for any help.


var pedal = 0;

//------------------------------------------------------------------------------

function HandleMIDI(e) {

   if (e instanceof ControlChange && e.number == 64 && e.value > 63)

   {

      pedal = 1;

   } 

   else if (e instanceof ControlChange && e.number == 64 && e.value < 64) 

   {

      pedal = 0; 

      MIDI.allNotesOff();

   }

   else if (pedal == 1 && e instanceof NoteOff) 

   {


   }

   else 

   {

      e.send();

   }

}



Posted on Sep 7, 2021 6:04 AM

Reply
3 replies

Sustain Pedal for Organ

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.