The NotationModel package contains modules for the purposes of defining a model of musical notations.
The types contained herein extend the structures defined in the dn-m/Music package, providing a rich context for abstract musical information so that it can be represented within a variety of notational media. This package remains agnostic to the concrete rendering backend.
For work on the graphical representation of music in Swift, see dn-m/NotationView.
The SpelledPitch module exposes structures for describing abstract pitches (e.g., what you get if you press a key on a MIDI keyboard) with letter names and accidentals. This is done in a progressively-disclosed and type-safe manner: it is easy to describe common pitch scenarios, linearly more difficult to describe more-rare pitch scenarios, and it is impossible to describe logically-invalid pitch scenarios.
NotationModel
The
NotationModel
package contains modules for the purposes of defining a model of musical notations.The types contained herein extend the structures defined in the dn-m/Music package, providing a rich context for abstract musical information so that it can be represented within a variety of notational media. This package remains agnostic to the concrete rendering backend.
For work on the graphical representation of music in Swift, see dn-m/NotationView.
Modules
SpelledPitch
The
SpelledPitch
module exposes structures for describing abstract pitches (e.g., what you get if you press a key on a MIDI keyboard) with letter names and accidentals. This is done in a progressively-disclosed and type-safe manner: it is easy to describe common pitch scenarios, linearly more difficult to describe more-rare pitch scenarios, and it is impossible to describe logically-invalid pitch scenarios.The
Pitch.Spelling
structure provides a model of the Helmholtz-Ellis notation system. This notation system scales elegantly from the Western common practice twelve-note equal division of the octave tuning system to that of high-limit just intonation. This system is represented in the SMuFL specification, making a mapping of these structures into a rendering context as seamless as possible.SpelledRhythm
The
SpelledRhythm
module defines models of beams, ties, and dots.PlotModel
Defines a model for positioning values onto two-dimensional plots.
StaffModel
Extends the
PlotModel
, incorporating the concept of clefs, noteheads, accidentals, etc.Development
Work on this package requires Swift 4.2.
Build instructions
Clone the repo.
Dive inside.
Ask Swift Package Manager to update dependencies (all are
dn-m
).Compiles code and runs tests in terminal.
Ask Swift Package Manager to generate a nice Xcode project.
Open it up.
The
NotationModel
package contains several modules:SpelledPitch
SpelledRhythm
PlotModel
StaffModel