Chords
public enum Chords
Bits and pieces to get chord definitions
-
Get all the guitar chords in a
ChordDefinition
arrayDeclaration
Swift
public static let guitar = Chords.importDefinitions(instrument: .guitarStandardETuning)
-
Get all the guitalile chords in a
ChordDefinition
arrayDeclaration
Swift
public static let guitalele = Chords.importDefinitions(instrument: .guitaleleStandardATuning)
-
Get all the ukulele chords in a
ChordDefinition
arrayDeclaration
Swift
public static let ukulele = Chords.importDefinitions(instrument: .ukuleleStandardGTuning)
-
Get all the database definitions in JSON format
Declaration
Swift
public static func jsonDatabase(instrument: Instrument) -> String
Parameters
instrument
The
Instrument
Return Value
The
Database
in JSON format -
Import a
Database
in JSON format to aChordDefinition
arrayDeclaration
Swift
public static func importDatabase(database: String) -> [ChordDefinition]
Parameters
database
The
Database
in JSON formatReturn Value
A
ChordDefinition
array -
Export a
ChordDefinition
array to aDatabase
in JSON formatDeclaration
Swift
public static func exportDatabase(definitions: [ChordDefinition]) -> String
Parameters
definitions
A
ChordDefinition
arrayReturn Value
The
Database
in JSON format -
Get all chord definitions for an instrument
Declaration
Swift
public static func getAllChordsForInstrument(instrument: Instrument) -> [ChordDefinition]
Parameters
instrument
The
Instrument
Return Value
An
ChordDefinition
array
-
Import a definition database from a JSON database file
Declaration
Swift
static func importDefinitions(instrument: Instrument) -> [ChordDefinition]
Parameters
database
The
Instrument
Return Value
An array of
ChordDefinition
-
Import a definition database from a JSON string
Declaration
Swift
static func importDefinitions(database: String) -> [ChordDefinition]
Parameters
database
The database in JSON format
Return Value
An array of
ChordDefinition
-
Export the definitions to a String
Declaration
Swift
static func exportDefinitions(definitions: [ChordDefinition]) -> String
Parameters
definitions
The chord definitions
Return Value
A String will all definitions
-
Import a database with chord definitions
Declaration
Swift
static func importDatabase(database: Database) -> [ChordDefinition]
Parameters
database
The
Database
to importReturn Value
An array of
ChordDefinition
-
Parse a String with chord definitions
Declaration
Swift
static func parseDefinitions(instrument: Instrument, definitions: String) -> [ChordDefinition]
Parameters
instrument
The
Instrument
definitions
The definitions as String
Return Value
An array of
ChordDefinition