Chord Library

OnSong Connect provides access to the device's chord library as well. This can be used for returning chord variations for different instruments.

List instruments

URL/api/<auth_token>/instruments
MethodGET
Version1.0

Description

Returns a list of instruments supported by the device.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required

Response

This call returns an array of instrument objects. Instruments contain the following fields:

Name Type Description
ID string The identifier of the instrument. This should be passed to calls for more information about the instrument.
title string The name of the instrument.
polyphony number The number of notes that the instrument can play. For instance, a guitar has six strings so the polyphony is 6.
tuning array This returns an array describing the tuning of the instrument. Numeric values correspond with steps above the lowest key on an 88=key piano keyboard.
soundbank boolean Determines if a sound bank exists to playback chords using this instrument.
[
    {
        "ID": "guitar",
        "title": "Guitar",
        "tuning": [
            32,
            37,
            42,
            47,
            51,
            56
        ],
        "polyphony": 6,
        "soundbank": false
    },
    {
        "ID": "piano",
        "title": "Piano",
        "tuning": null,
        "polyphony": 5,
        "soundbank": false
    }...
]

List Chords

URL/api/<auth_token>/instruments/<instrument_id>/chords/
MethodGET
Version1.0

Description

Returns a list of available chords for the specified instrument.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required
instrument_id string The identifier of the instrument. Required

Response

Returns an array notes with chord variations available. Each element in the array contains the following fields:

Name Type Description
key string The root of a chord for which different forms of the chord are to be returned. For instance, C or Gb.
chords string The chord formations that are supported such as Cm, Csus4, Gbmaj9, etc.
{
    "chords": [
        {
            "key": "Ab",
            "chords": [
                "Ab",
                "Ab#5",
                "Ab/A",
                "Ab/F",
                "Ab/Gb",
                "Ab2/F",
                "Ab5",
                "Ab6",
                "Ab7",
                "Abaug",
                "Abdim/E",
                "Abdim/Eb",
                "Abdim/F",
                "Abdim7",
                "Abm",
                "Abm/D",
                "Abm/E",
                "Abm/Gb",
                "Abm7",
                "Absus",
                "Absus4"
            ]
        }, ...
    ],
    "instrument": "guitar"
}

Get chord variations

URL/api/<auth_token>/instruments/<instrument_id>/chords/<chord_name>
MethodGET
Version1.0

Description

Returns variations in the form of fret or note positions for the specified chord.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required
instrument_id string The identifier of the instrument. Required
chord_name string The name of the chord formation for which variations should be returned. Required

Response

Returns an object containing the variations as an array of objects containing frets and optional fingerings as well as basic information about the request.

{
    "alternates": false,
    "chord": "C",
    "instrument": "guitar",
    "variations": [
		{ frets: "032010" },
        { frets: "x35550" },
        { frets: "035553" },
        { frets: "x32010" },
        { frets: "3x2010" },
        { frets: "332010" }
    ]
}

Add chord

URL/api/<auth_token>/instruments/<instrument_id>/chords/<chord_name>/<variation>
MethodPUT
Version1.0

Description

Adds a new chord variation to the chord library.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required
instrument_id string The identifier of the instrument. Required
chord_name string The name of the chord formation for which the variation should be added. Required
variation string The chord variation to be added to the chord library. For example, x01234 Required

Response

Returns an object with either an error or success property to indicate if the call was successful.

{
    "success": "Chord variation was added"
}
{
    "error": "Instrument, chord and variation are required"
}

Delete chord

URL/api/<auth_token>/instruments/<instrument_id>/chords/<chord_name>/<variation>
MethodPUT
Version1.0

Description

Deletes a chord variation from the chord library.

Path arguments

Name Type Description Required
auth_token string The authentication token used to authenticate the request. Required
instrument_id string The identifier of the instrument. Required
chord_name string The name of the chord formation from which the variation will be deleted. Required
variation string The chord variation to be deleted from the chord library. For example, x01234 Required

Response

Returns an object with either an error or success property to indicate if the call was successful.

{
    "success": "Chord variation was deleted"
}
{
    "error": "Instrument, chord and variation are required"
}