Music

Start a song

POST/api/song
Open. Open to everyone who can reach Tempolight.

A song about to play in a browser, with its analysis (from preAnalyseCore() in /engine/analysis.js). With song memory on, songs over 20 s are remembered. Then send its clock.

Request body application/json

namestring
analysisobjectrequired

The result of preAnalyseCore() from /engine/analysis.js; must have bpm.

clientIdstring

The WebSocket connection's id, from its hello message.

Responses

200OKapplication/json
oktruerequired
400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequired

What went wrong, in a sentence for people.

Request
curl -X POST 'http://localhost:8080/api/song' \
  -H 'content-type: application/json' \
  -d '{
  "name": "My song.mp3",
  "analysis": {
    "bpm": 124,
    "dur": 210.5
  },
  "clientId": "c3k9"
}'
Response
{
  "ok": true
}
Edit on GitHub