startNoteNow method

void startNoteNow({
  1. required int noteNumber,
  2. required double velocity,
})

Handles a Note On event on this track immediately. The event will not be added to this track's events.

Implementation

void startNoteNow({required int noteNumber, required double velocity}) {
  final nextBeat = sequence.getBeat();
  final event = MidiEvent.ofNoteOn(
      beat: nextBeat,
      noteNumber: noteNumber,
      velocity: _velocityToMidi(velocity));

  NativeBridge.handleEventsNow(
      id, [event], Sequence.globalState.sampleRate!, sequence.tempo);
}