Directive

enum Directive: String, CaseIterable

The directives Chord Provider supports

Official directives

  • t

    Meta-data directives

    This directive defines the title of the song

    Declaration

    Swift

    case t
  • Declaration

    Swift

    case t, title
  • st

    This directive defines a subtitle of the song

    Note

    It will be used as artist

    Declaration

    Swift

    case st
  • Declaration

    Swift

    case st, subtitle
  • This directive defines an artist

    Declaration

    Swift

    case artist
  • This directive defines an album this song occurs on

    Declaration

    Swift

    case album
  • The year this song was first published, as a four-digit number

    Declaration

    Swift

    case year
  • key

    This directive specifies the key the song is written in

    Declaration

    Swift

    case key
  • This directive specifies a time signature

    Declaration

    Swift

    case time
  • This directive specifies the tempo in number of beats per minute for the song

    Declaration

    Swift

    case tempo
  • This directive specifies the capo setting for the song

    Declaration

    Swift

    case capo
  • This directive specifies the instrument setting for the song

    Declaration

    Swift

    case instrument
  • c

    Formatting directives

    This directive introduce a comment line

    Declaration

    Swift

    case c
  • Declaration

    Swift

    case c, comment
  • Environment directives

    Chorus

    This directive indicates that the lines that follow form the song’s chorus

    Declaration

    Swift

    case startOfChorus = "start_of_chorus"
  • soc

    This directive indicates that the lines that follow form the song’s chorus

    Declaration

    Swift

    case soc
  • This directive indicates the end of the chorus

    Declaration

    Swift

    case endOfChorus = "end_of_chorus"
  • eoc

    This directive indicates the end of the chorus

    Declaration

    Swift

    case eoc
  • This directive indicates that the song chorus must be played here

    Declaration

    Swift

    case chorus
  • Verse

    Specifies that the following lines form a verse of the song

    Declaration

    Swift

    case startOfVerse = "start_of_verse"
  • sov

    Specifies that the following lines form a verse of the song

    Declaration

    Swift

    case sov
  • Specifies the end of the verse

    Declaration

    Swift

    case endOfVerse = "end_of_verse"
  • eov

    Specifies the end of the verse

    Declaration

    Swift

    case eov
  • Bridge

    Specifies that the following lines form a bridge of the song

    Declaration

    Swift

    case startOfBridge = "start_of_bridge"
  • sob

    Specifies that the following lines form a bridge of the song

    Declaration

    Swift

    case sob
  • Specifies the end of the bridge

    Declaration

    Swift

    case endOfBridge = "end_of_bridge"
  • eob

    Specifies the end of the bridge

    Declaration

    Swift

    case eob
  • Tab

    This directive indicates that the lines that follow form a section of guitar TAB instructions

    Declaration

    Swift

    case startOfTab = "start_of_tab"
  • sot

    This directive indicates that the lines that follow form a section of guitar TAB instructions

    Declaration

    Swift

    case sot
  • This directive indicates the end of the tab

    Declaration

    Swift

    case endOfTab = "end_of_tab"
  • eot

    This directive indicates the end of the tab

    Declaration

    Swift

    case eot
  • Grid

    This directive indicates that the lines that follow define a chord grid in the style of Jazz Grilles

    Declaration

    Swift

    case startOfGrid = "start_of_grid"
  • sog

    This directive indicates that the lines that follow define a chord grid in the style of Jazz Grilles

    Declaration

    Swift

    case sog
  • This directive indicates the end of the grid

    Declaration

    Swift

    case endOfGrid = "end_of_grid"
  • eog

    This directive indicates the end of the grid

    Declaration

    Swift

    case eog
  • Textblock

    This directive indicates that the lines that follow define a piece of text that is combined into a single object that can be placed as an image

    Declaration

    Swift

    case startOfTextblock = "start_of_textblock"
  • This directive indicates the end of the textblock

    Declaration

    Swift

    case endOfTextblock = "end_of_textblock"
  • Chord diagrams

    This directive defines a chord in terms of fret/string positions and, optionally, finger settings

    Declaration

    Swift

    case define

Custom directives

  • This directive has the path to the music file

    Declaration

    Swift

    case musicPath = "musicpath"
  • tag

    This directive defines a tag for the song

    Declaration

    Swift

    case tag
  • Not a directive

    Declaration

    Swift

    case none
  • Strum

    This directive indicates that the lines that follow defines a strum pattern

    Declaration

    Swift

    case startOfStrum = "start_of_strum"
  • sos

    This directive indicates that the lines that follow defines a strum pattern

    Declaration

    Swift

    case sos
  • This directive indicates the end of the strum

    Declaration

    Swift

    case endOfStrum = "end_of_strum"
  • eos

    This directive indicates the end of the strum

    Declaration

    Swift

    case eos

Details of a directive

Directive extensions

  • The start and end of the directive

    Declaration

    Swift

    var format: (start: String, end: String)
  • The raw label of the directive

    Declaration

    Swift

    func label(_ directive: ChordPro.Directive) -> String

    Parameters

    directive

    The ChordPro/Directive

    Return Value

    The raw value as String

  • The kind of directive (block, inline or optional label)

    Declaration

    Swift

    var kind: Kind
  • The kind of directive (block or inline)

    See more

    Declaration

    Swift

    enum Kind

Grouped directives