Skip to content

Instantly share code, notes, and snippets.

@vikingosegundo
Created May 14, 2021 01:00
Show Gist options
  • Save vikingosegundo/3959b7ea9a725e1d7a886b0c42987e60 to your computer and use it in GitHub Desktop.
Save vikingosegundo/3959b7ea9a725e1d7a886b0c42987e60 to your computer and use it in GitHub Desktop.
indirect enum Note {
case note (Pitch, Duration)
case triplet((Pitch, Pitch, Pitch), Duration)
case chord([Pitch], Duration)
case rest(Duration)
case hold(Note)
indirect enum Pitch {
case a
case b
case c
case d
case e
case f
case g
case flat (Pitch)
case sharp(Pitch)
}
indirect enum Duration {
case ⅟
case ½
case ¼
case ⅛
case halfed(Duration)
case joined(Duration, Duration)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment