ChordProgression
public struct ChordProgression: CustomStringConvertible, Codable, Equatable
Chord progression enum that you can create hard-coded and custom progressions.
-
Initilizes the chord progression with its nodes.
Declaration
Swift
public init(nodes: [ChordProgressionNode])
Parameters
nodes
Nodes of the chord progression.
-
All hard-coded chord progressions.
Declaration
Swift
public static var all: [ChordProgression]
-
Generates chord progression for a
Scale
withScale.HarmonicField
and optionally inverted chords.Declaration
Parameters
scale
Scale of the chords going to be generated.
harmonicField
Harmonic field of the chords going to be generated.
inversion
Inversion of the chords going to be generated.
Return Value
Returns all possible chords for a scale. Returns nil if the chord is not generated for particular
ChordProgressionNode
.
-
Returns the chord progression name.
Declaration
Swift
public var description: String
-
Initilizes chord progression with a
Decoder
.Throws
Throws error if can not decodes.Declaration
Swift
public init(from decoder: Decoder) throws
Parameters
decoder
The decoder.
-
Encodes the chord progression.
Throws
Throws error if can not encodes.Declaration
Swift
public func encode(to encoder: Encoder) throws
Parameters
encoder
The encoder.