addNoteOn method

void addNoteOn({
  1. required int noteNumber,
  2. required double velocity,
  3. required double beat,
})

Adds a Note On event to this track. This does not sync the events to the backend.

Implementation

void addNoteOn(
    {required int noteNumber,
    required double velocity,
    required double beat}) {
  assert(velocity > 0 && velocity <= 1);

  final noteOnEvent = MidiEvent.ofNoteOn(
    beat: beat,
    noteNumber: noteNumber,
    velocity: _velocityToMidi(velocity),
  );

  _addEvent(noteOnEvent);
}