Structure
Chord
public struct Chord
A custom musical chord.
As someone familiar with music theory might expect, a custom chord has its component notes and a root note. The chord's quality is determined by these notes.
Relationships
Conforms To
CustomStringConvertible
Initializers
init(_:notes:over:)
Create a chord by specifying root, notes, and slash.
init(_:_:over:)
Create a chord by specifying root, quality, and slash.
init(_:)
public init(_ name: String) throws
Create a chord directly from it's name.
Create a chord by using it's name directly.
let myChord = try! Chord("Cmaj9/G")
print(myChord.description)
// This is a slash chord named Cmaj9/G over G, with root note C,
// and component notes D, E, G, B, which are respectively major second,
// major third, perfect fifth, major seventh above the root.
If a chord is failed to create, it will print the error message in terminal. For full reference of available chords, go to doc:Chords-Reference
Properties
description
public var description: String
The name of a chord.
The following code generate a chord with name "Esus4"
let chord = Chord(root: .E, [.E, .A, .B])