String
struct String
Extensions to the String type to enable parsing chord symbols in a functional style.
-
Separate a chord symbol’s root from its suffix in a string and return both in a SeparatedChordSymbol instance.
Declaration
Swift
public func separateRoot() -> SeparatedChordSymbol?
-
Map a string containing a pitch-letter to a pitch-class.
Declaration
Swift
public func mapPitch() -> PitchClass?
-
Map a string containing a pitch-letter to a PitchLetter instance.
Declaration
Swift
public func mapPitchToLetter() -> PitchLetter?
-
Parse a chord symbol’s suffix and get a pitch-class set from it as it would apply to C (pitch-class 0). E.g.
m7
.mapSuffix().Declaration
Swift
public func mapSuffix() -> PCSet?
-
Helper function to get substrings using a JavaScript-like interface.
Declaration
Swift
public func substring(_ fromIndex: Int, _ toIndex: Int) -> String