Code: Select all
Note-On
-------
Is there already a note playing?
Yes
1) Place the currently playing note number
at the end of the note list.
2) Keep track of the new note number, e.g.
currentNote = newNote;
3) Trigger Voice with the new note number.
No
1) Keep track of the new note number, e.g.
currentNote = newNote;
2) Trigger Voice with the new note number.
Note-Off
--------
Is there a note playing?
Yes
Does the note-off number match the currently
playing note number?
Yes
Are there any notes in the note list?
Yes
1) Get the note number at the end
of the note list.
2) Remove the note number at the
end of the note list.
3) Keep track of the previous note
number, e.g currentNote = prevNote.
4) Trigger Voice with the previous
note number.
No
Is the sustain pedal depressed?
Yes
1) Indicate that the current note
is sustaining, e.g.
currentNote = SUSTAINING;
No
1) Indicate that there isn't a note
being played, e.g.
currentNote = NOT_PLAYING;
2) Release Voice.
No
Is the note-off number in the note list?
Yes
1) Remove note-off number from the
note list.
No
1) Do nothing.
No
Do nothing.
Sustain Pedal On
----------------
1) Indicate that the sustain pedal is on, e.g.
sustaining = true;
Sustain Pedal Off
-----------------
Is the sustain pedal on?
Yes
Is the current note sustaining, e.g.
if(currentNote == SUSTAINING)?
Yes
1) Indicate that there isn't a note being
played, e.g.
currentNote = NOT_PLAYING;
2) Release Voice.
No
1) Do nothing.
No
1) Do nothing.