Structures

The following structures are available globally.

  • The Mode type is used for defining custom scale structures. Initialized with either a name string and an array of Int offsets-from-tonic, or with a name string and a pitch-class set (in which case the prime form is used).

    See more

    Declaration

    Swift

    public struct Mode
  • The Pitch type represents both a pitch class and an octave. It also contains a MIDI note number representation. Absolute pitch parity can be checked with ==, pitch class parity can be checked with ~=.

    See more

    Declaration

    Swift

    public struct Pitch: Equatable
  • The Note abstraction contains a Pitch instance, a Duration instance, and a velocity.

    See more

    Declaration

    Swift

    public struct Note: Equatable
  • The NoteSequence abstraction represents an ordered collection of Note objects.

    See more

    Declaration

    Swift

    public struct NoteSequence: ExpressibleByArrayLiteral
  • The ToneRow type deals with ordered collections of pitch-classes and adds utility methods for working with tone rows in compositional contexts.

    See more

    Declaration

    Swift

    public struct ToneRow: Equatable, ExpressibleByArrayLiteral, MutableCollection
  • The PCSet type deals with collections of pitch-classes. It abstracts an Array of pitch-classes than a set type, in order to allow for duplicates, explicit ordering, etc.

    See more

    Declaration

    Swift

    public struct PCSet: Equatable, ExpressibleByArrayLiteral, Collection, SetAlgebra
  • The ToneMatrix type deals with tone matrices expressed as multidimensional arrays, or arrays of ToneRow instances.

    See more

    Declaration

    Swift

    public struct ToneMatrix: Equatable, ExpressibleByArrayLiteral, MutableCollection
  • The Chord type provides an abstraction for dealing with vertically-oriented harmonic structures. Can be initialized with a pitch-class set, with a chord symbol (e.g. Chord(Fmaj7#11)), or with MIDI note numbers as an Int array. Chord parity, considering inversional equivalence, can be checked using the == operator.

    See more

    Declaration

    Swift

    public struct Chord: Equatable
  • The SeparatedChordSymbol type provides a separated root and symbol suffix, as an intermediary stage in the chord-parsing process.

    See more

    Declaration

    Swift

    public struct SeparatedChordSymbol
  • The TimeSignature type consists of a numerator and a denominator, together representing a time signature. It currently only supports dyadic rationals, but support for ‘irrational’ time signatures is planned.

    See more

    Declaration

    Swift

    public struct TimeSignature
  • The Tempo type consists of a beats-per-minute value, and a NoteValue instance to indicate what each of these beats is. It can be initialized with a BPM value alone, in which case the beat’s value defaults to a quarter note, or with both together. Additionally, it can be initialized with a description, e.g. Tempo(Andante). There is an internal soft limit that defaults to 400.0 and can be user-modified.

    See more

    Declaration

    Swift

    public struct Tempo
  • The RomanNumeral type abstracts data and operations related to working with roman-numeral expressions of harmony. Two basic systems of roman-numerals are provided: ‘Traditional’ and ‘Berklee’, the former employing figured-bass notation and both upper and lower case characters, and the latter resembling chord symbols and using all upper case characters.

    See more

    Declaration

    Swift

    public struct RomanNumeral