Building Notes

Notes are the building blocks of music. They are defined by their pitch, accidental, duration, octave, velocity and offset.

Here is the Note Model

enum AtomoicMusicalEvent:
  case Note(
    pitch: Pitch,
    accidental: Accidental,
    duration: Duration,
    octave: Octave,
    velocity: Velocity,
    offset: TimingOffset = TimingOffset(0)
  ) extends AtomicMusicalEvent(duration, velocity)

Properties of a Note

Here is an example of defining a single note:

Note(C, Natural, Quarter, Octave4, Medium)

Idiomatic Notes

Again, we have a range of syntactic sugar to make instantiating a note more readable:

C4.sharp.eighth.soft

Next Step: Building Melodies