Root
enum Root: String, CaseIterable, Codable, Comparable, Sendable, Identifiable
The root of a chord
Note
Changes to the raw value might break the databases-
Identifiable protocol
Declaration
Swift
var id: String -
All
Declaration
Swift
case all = "All" -
C
Declaration
Swift
case c = "C" -
C sharp
Declaration
Swift
case cSharp = "C#" -
D
Declaration
Swift
case d = "D" -
D sharp
Declaration
Swift
case dSharp = "D#" -
D flat
Declaration
Swift
case dFlat = "Db" -
E
Declaration
Swift
case e = "E" -
E flat
Declaration
Swift
case eFlat = "Eb" -
F
Declaration
Swift
case f = "F" -
F sharp
Declaration
Swift
case fSharp = "F#" -
G
Declaration
Swift
case g = "G" -
G sharp
Declaration
Swift
case gSharp = "G#" -
G flat
Declaration
Swift
case gFlat = "Gb" -
A
Declaration
Swift
case a = "A" -
A sharp
Declaration
Swift
case aSharp = "A#" -
A flat
Declaration
Swift
case aFlat = "Ab" -
B
Declaration
Swift
case b = "B" -
B flat
Declaration
Swift
case bFlat = "Bb" -
None
Declaration
Swift
case none = "None" -
Implement Comparable
Declaration
Swift
static func < (lhs: Self, rhs: Self) -> Bool -
The display of Root
Declaration
Swift
var display: String -
The accidental of the root
Declaration
Swift
var accidental: Accidental -
Natural and sharp notes
Declaration
Swift
static var naturalAndSharp: [Chord.Root] -
Display natural and sharp notes a string
Declaration
Swift
var naturalAndSharpDisplay: String -
Swap sharp for flat
Declaration
Swift
var swapSharpForFlat: Root -
Transpose a note
Declaration
Swift
mutating func transpose(transpose: Int, scale: Chord.Root)Parameters
transposeThe transpose value
scaleThe scale of the note
View on GitHub