Audio to MusicXML

Home / Music APIs / API Endpoint Reference / Audio to MusicXML

Audio to MusicXML

Translate audio to MusicXML

Start

POST https://api.doremir.com/v1/audio-to-musicxml/start

Request Parameters

HEADER FIELDVALUE
AuthorizationRequired. A valid access token from the DoReMIR Accounts service: see the My Applications for details.
Content-TypeRequired. The content type of the request body: application/json

REQUEST BODY DATA (JSON)VALUE TYPEVALUE
analysisTypestringRequired. "monophonic" or "polyphonic"
audioFormatstringRequired. < "m4a" | "mp3" | "ogg" | "pcm" | "wav" >
fileTypestringRequired when audioFormat = "PCM".
"alaw" = A-law
"f32be" = 32-bit floating-point big-endian
"f32le" = 32-bit floating-point little-endian
"f64be" = 64-bit floating-point big-endian
"f64le" = 64-bit floating-point little-endian
"mulaw" = mu-law
"s16be" = signed 16-bit big-endian
"s16le" = signed 16-bit little-endian
"s24be" = signed 24-bit big-endian
"s24le" = signed 24-bit little-endian
"s32be" = signed 32-bit big-endian
"s32le" = signed 32-bit little-endian
"s8" = signed 8-bit
"u16be" = unsigned 16-bit big-endian
"u16le" = unsigned 16-bit little-endian
"u24be" = unsigned 24-bit big-endian
"u24le" = unsigned 24-bit little-endian
"u32be" = unsigned 32-bit big-endian
"u32le" = unsigned 32-bit little-endian
"u8" = unsigned 8-bit
samplingFrequencynumberRequired when audioFormat = "PCM". [Hz] 44100, 48000 etc.
channelsnumberRequired when audioFormat = "PCM". 1 (mono) or 2 (stereo).
removeTimenumberTime to remove from the beginning of the recording. [seconds] May be a decimal number.
silenceTimenumberTime to silence in the beginning of the recording. [seconds] May be a decimal number.

Response Format

On success, the response body contains a recordingId in JSON format and the HTTP status code in the response header is 200 OK. The recordingId is used to identify future Upload requests.

On error, the header status code is an error code.

Example

curl --request POST \
  --url https://api.doremir.com/v1/audio-to-musicxml/start \
  --header 'authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuZG9yZW1pci5jb20iLCJzdWIiOnsiY2xpZW50SWQiOiI1ODAzZTI4OTA1MGVkNzJkM2FkYzhkM2QifSwiYXVkIjoiNTgwM2UyODkwNTBlZDcyZDNhZGM4ZDNkIiwiaWF0IjoxNDkxNzYyODI2LCJleHAiOjE0OTM4MTQ4MjYsInNjb3BlcyI6WyJhbGwiXX0.usEBcf1pxX3rTZrLjiIccFZGBfqix80pytyZlXe1s4F' \
  --header 'content-type: application/json' \
  --data '{ "analysisType": "monophonic", \
            "audioFormat": "PCM", \
            "fileType": "s16le", \
            "samplingFrequency": 44100, \
            "channels": 1 \
          }'
{ "recordingId": "58ebeb784dc9f21a7944bfaf" }

Upload

POST https://api.doremir.com/v1/audio-to-musicxml/upload

Request Parameters

HEADER FIELDVALUE
AuthorizationRequired. A valid access token from the DoReMIR Accounts service: see the My Applications for details.
Content-TypeRequired. The content type of the request body: application/json

REQUEST BODY DATA (JSON)VALUE TYPEVALUE
recordingIdstringRequired. The recordingId value returned by the start request.
audiostringRequired. Base64 encoded audio data.
chunkNonumberRequired when there is more than one chunk. The chunk order number starting with 0 (zero).
lastChunktrue or falseRequired when there is more than one chunk. Set to true for the last chunk.

Response Format

On success, the response body contains the message “Uploaded successfully!” in JSON format and the HTTP status code in the response header is 200 OK.

On error, the header status code is an error code.

Example

curl --request POST \
  --url https://api.doremir.com/v1/audio-to-musicxml/upload \
  --header 'authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuZG9yZW1pci5jb20iLCJzdWIiOnsiY2xpZW50SWQiOiI1ODAzZTI4OTA1MGVkNzJkM2FkYzhkM2QifSwiYXVkIjoiNTgwM2UyODkwNTBlZDcyZDNhZGM4ZDNkIiwiaWF0IjoxNDkxNzYyODI2LCJleHAiOjE0OTM4MTQ4MjYsInNjb3BlcyI6WyJhbGwiXX0.usEBcf1pxX3rTZrLjiIccFZGBfqix80pytyZlXe1s4F' \
  --header 'content-type: application/json' \
  --data '{ "recordingId": "58ebeb784dc9f21a7944bfaf",
            "lastChunk": true,
            "chunkNo": 0,
            "audio": "<base64 encoded audio>" }'
{ "message": "Uploaded successfully!" }

Result

POST https://api.doremir.com/v1/audio-to-musicxml/result

Request Parameters

HEADER FIELDVALUE
AuthorizationRequired. A valid access token from the DoReMIR Accounts service: see the My Applications for details.
Content-TypeRequired. The content type of the request body: application/json

REQUEST BODY DATA (JSON)VALUE TYPEVALUE
recordingIdstringRequired. The recordingId value returned by the start request.

Response Format

On success, the response body is a JSON object with a string containing Base64 encoded MusicXML and the HTTP status code in the response header is 200 OK.

On error, the header status code is an error code.

Example

curl --request POST \
  --url https://api.doremir.com/v1/audio-to-musicxml/result \
  --header 'authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuZG9yZW1pci5jb20iLCJzdWIiOnsiY2xpZW50SWQiOiI1ODAzZTI4OTA1MGVkNzJkM2FkYzhkM2QifSwiYXVkIjoiNTgwM2UyODkwNTBlZDcyZDNhZGM4ZDNkIiwiaWF0IjoxNDkxNzYyODI2LCJleHAiOjE0OTM4MTQ4MjYsInNjb3BlcyI6WyJhbGwiXX0.usEBcf1pxX3rTZrLjiIccFZGBfqix80pytyZlXe1s4F' \
  --header 'content-type: application/json' \
  --data '{ "recordingId": "58ebeb784dc9f21a7944bfaf" }'
{ "musicxml": "<base64 encoded musicxml data>" }