addNote method

void addNote({
  1. required int instrumentId,
  2. required double pitch,
  3. required double beat,
  4. double duration = 0.9,
  5. double velocity = 0.8,
  6. bool legato = false,
  7. int paramId = 0,
})

Adds a note to the sequence. beat is the starting beat (0-indexed). duration is the length in beats (e.g., 1.0 for a quarter note). velocity is the strike strength or breath pressure (0.0 to 1.0). legato if true, the breath won't stop before the next note if it overlaps.

Implementation

void addNote({
  required int instrumentId,
  required double pitch,
  required double beat,
  double duration = 0.9,
  double velocity = 0.8,
  bool legato = false,
  int paramId = 0,
}) {
  _notes.add(FaustNote(
    instrumentId: instrumentId,
    pitch: pitch,
    beat: beat,
    duration: duration,
    velocity: velocity,
    legato: legato,
    paramId: paramId,
  ));
}