Example #1
0
        public override void AddNote(NoteMessage note)
        {
            // All notes in a ChordOff must have the same channel.
            Debug.Assert(note is NoteOff && ((_notes.Count == 0) || (note.Channel == _notes[0].Channel)));
            NoteOff noteOff = new NoteOff();

            noteOff.Channel  = note.Channel;
            noteOff.Pitch    = note.Pitch;
            noteOff.Velocity = 64;
            _notes.Add(noteOff);
        }
Example #2
0
        public override void AddNote(NoteMessage note)
        {
            // All notes in a ChordOn must have the same channel.
            Debug.Assert(note is NoteOn && ((_notes.Count == 0) || (note.Channel == _notes[0].Channel)));
            NoteOn newNote = new NoteOn();

            newNote.Channel  = note.Channel;
            newNote.Pitch    = note.Pitch;
            newNote.Velocity = note.Velocity;
            _notes.Add(newNote);
        }
Example #3
0
 public void RemoveNote(NoteMessage note)
 {
     if (_notes.Count > 0)
     {
         for (int i = _notes.Count - 1; i >= 0; i--)
         {
             if (note.Channel == _notes[i].Channel &&
                 note.Pitch == _notes[i].Pitch &&
                 note.Velocity == _notes[i].Velocity)
             {
                 _notes.RemoveAt(i);
                 break;
             }
         }
     }
 }
Example #4
0
 public void RemoveNote(NoteMessage note)
 {
     if(_notes.Count > 0)
         for(int i = _notes.Count - 1 ; i >= 0 ; i--)
         {
             if(note.Channel == _notes[i].Channel
                 && note.Pitch == _notes[i].Pitch
                 && note.Velocity == _notes[i].Velocity)
             {
                 _notes.RemoveAt(i);
                 break;
             }
         }
 }
Example #5
0
 public abstract void AddNote(NoteMessage note);
Example #6
0
 public override void AddNote(NoteMessage note)
 {
     // All notes in a ChordOn must have the same channel.
     Debug.Assert(note is NoteOn && ((_notes.Count == 0) || (note.Channel == _notes[0].Channel)));
     NoteOn newNote = new NoteOn();
     newNote.Channel = note.Channel;
     newNote.Pitch = note.Pitch;
     newNote.Velocity = note.Velocity;
     _notes.Add(newNote);
 }
Example #7
0
 public override void AddNote(NoteMessage note)
 {
     // All notes in a ChordOff must have the same channel.
     Debug.Assert(note is NoteOff && ((_notes.Count == 0) || (note.Channel == _notes[0].Channel)));
     NoteOff noteOff = new NoteOff();
     noteOff.Channel = note.Channel;
     noteOff.Pitch = note.Pitch;
     noteOff.Velocity = 64;
     _notes.Add(noteOff);
 }
Example #8
0
 public abstract void AddNote(NoteMessage note);