You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (e.EventType == Melanchall.DryWetMidi.Smf.MidiEventType.NoteOn)
{
var note = e as NoteOnEvent;
Debug.Log(note.Velocity);
Debug.Log($"{note.GetNoteName()}{note.GetNoteOctave()}");
}
I have one question remaining: how to get the sustain pedal data?
Yorgg
changed the title
Incoming events - how to get individual event data?
Incoming events - how to get sustain pedal data?
Nov 1, 2019
According to MIDI standard, sustain pedal on/off is a control change event. So you can use this code:
varcontrolChangeEvent= e as ControlChangeEvent;if(controlChangeEvent!=null&& ControlUtilities.GetControlName(controlChangeEvent)== ControlName.DamperPedal){varcontrolValue= controlChangeEvent.ControlValue;varsustainOn=controlValue<64;}
Values from 0 to 63 correspond to sustain is turned on.
I am listening to the
InputDevice
and want to get the noteName and velocity fromNoteOn
,NoteOff
events, and also the sustain pedal event (on piano).I know the
EventType
, but don't know what to do next:thank you
The text was updated successfully, but these errors were encountered: