sending a controllerchange event -- specifically sustain

Nov 1, 2010 at 4:37 AM

so i'm trying to send a controllerchaing the sustain pedal all the way down. pushnge event -- specifically 127 on CC 64, effectively pushing the sustain pedal down.

the code i have for it is this:

            ControlChangeEvent e = new ControlChangeEvent(0, 1, MidiController.Sustain, 127);
            ControlActionSettings.Output.Send(e.GetAsShortMessage());

Output up there is, as you'd assume, is a MidiOut.  When I send that though, two things happen

* First, the notes i send after are not sustained
* Secondly, when I watch with MidiMon it doesn't show any difference between sending a controller with a controller type of Sustain vs a controller type of AllNotesOff or something else.  Weird!

Thoughts?  Any advice?  Reasons why this code is fucked?

also related question -- with most music programs, is the sustain message sent WHEN the pedal is pressed down, or is it sent when a note is sent and the pedal is also pressed down?

Coordinator
Nov 6, 2010 at 12:07 PM
GetAsShortMessage isn't implemented for all MidiEvents. I've just checked in one for ControlChangeEvent. 
Please get the latest code and see if it works for you.

Mark