notesOf function

List<Pitch> notesOf(
  1. NotesSpec spec,
  2. Random rng, {
  3. Accidentals accidentals = Accidentals.none,
  4. String? key,
})

As notas de spec: a lista fixa do autor ou o sorteio.

Implementation

List<Pitch> notesOf(
  NotesSpec spec,
  Random rng, {
  Accidentals accidentals = Accidentals.none,
  String? key,
}) => switch (spec) {
  FixedNotes() => spec.notes,
  RandomNotes() => pickNotes(
    spec.range,
    count: spec.count,
    choice: (only: spec.only, accidentals: accidentals, key: key),
    rng: rng,
  ),
};