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 moreDeclaration
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 moreDeclaration
Swift
public struct Pitch: Equatable
-
The Note abstraction contains a Pitch instance, a Duration instance, and a velocity.
See moreDeclaration
Swift
public struct Note: Equatable
-
The NoteSequence abstraction represents an ordered collection of Note objects.
See moreDeclaration
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 moreDeclaration
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 moreDeclaration
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 moreDeclaration
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(
See moreFmaj7#11
)), or with MIDI note numbers as an Int array. Chord parity, considering inversional equivalence, can be checked using the == operator.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 moreDeclaration
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 moreDeclaration
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(
See moreAndante
). There is an internal soft limit that defaults to 400.0 and can be user-modified.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 moreDeclaration
Swift
public struct RomanNumeral