The OnSong API song object contains detailed information about a song in the library, serving to retrieve and update song information through a comprehensive set of parameters.
Library management using the song object involves several specific data fields and types. The parameters include the artist string representing the artist or byline of the song, and the ID string which provides the unique identifier of the song as a readonly value.
The title string handles the title of the song, while the keywords string manages keywords set for the song and the number string applies a song number for organization.
Timing and structural elements are defined by numeric and date parameters. The duration number records the duration of the song in seconds, and the tempo number tracks the tempo in beats per minute (BPM). The timeSignature string expresses the time signature like “3/4”, while created and modified date parameters record the date and time the song was originally created and last modified, both marked as readonly.
Playback and performance configurations involve multiple enumerations and booleans. The performTransposition boolean determines if transposition should be applied, working alongside the transposedKey string indicating the key to transpose into, the key string showing the original key as readonly, and the capo int parameter setting the capo default at 0 with the adjustForCapo boolean determining if the capo value should be applied to transpose the song.
Audio playback repeatMode uses an enum with options including 0 for default user preference, 1 for none, 2 for one, and 3 for all where the playlist continues to repeat.
Chord display and styling parameters offer extensive customization. The showChords boolean determines if chords are displayed, while chordPosition uses an enum where 0 places chords above the lyrics and 1 places them inline.
The chordStyle enum determines styles such as 0 for alphabetical letters, 1 for numeric Nashville notation, 2 for Roman numerals, and 3 for Italian do, re, mi, fa, so, la, and ti. Additionally, chords provide an array of objects for preferred chord diagrams variations, instrument specifies the preferred instrument affecting drawn diagrams, and usefile determines if an external file should be used.
Display controls also govern lyrics, metadata, and visual elements. The showLyrics, showMetadata, showNotes, showTablature, and showTitle booleans control the visibility of respective song components.
Furthermore, diagramPosition determines chord diagram placement at 0 for bottom or 1 for top just below the title and metadata, tablatureSize sets the diagram size as a percentage of the page width, dualChordDisplayStyle manages dual chords with options for off, first, or second, and stickyNotes contains an array of sticky notes applied to the page.
Additional administrative parameters complete the object structure. The imported boolean determines if the song was created through an import process as readonly, midi stores associated MIDI data, restrictions applies a bitwise mask for song restrictions, showExpanded determines expansion according to flow, and styles contains basic stylization characteristics.