Pitch constructor

Pitch(
  1. int step, [
  2. int? octave
])

Cerates a pitch.

If octave is provided, step should be relative. Otherwise octave will be computed from absolute step (equivalent to midi number).

Implementation

factory Pitch(int step, [int? octave]) => octave == null
    ? Pitch._absolute(step)
    : Pitch._relative(step, octave);