Audio-to-MIDI Pro

Transcribe audio to MIDI (sync)

Transcribe audio with Audio-to-MIDI Pro into MIDI, structured notes, and MusicXML. The v1.0 URL versions the API contract, not the model. The result’s model field identifies the producing Audio-to-MIDI release; retain it with your transcript. Input audio can be up to 30 minutes and 100 MiB. The byte limit is independent, so some uncompressed files reach it before the duration limit; use a compressed format for long sources. Sync has a separate 12-minute limit based on the probed duration. Longer inputs return 422 sync_too_long before transcription or billing; use POST /v2/audio-to-midi/v1.0/jobs instead. After success the server bills max(1, round(seconds × 2.5)) over the duration it probes from the downloaded media, so the charge can differ from a preflight quote based on an inaccurate duration_ms. This request blocks until the filtered final result is ready and must finish within one server action; a longer client timeout does not extend the sync server runtime. Send one stable Idempotency-Key per logical sync request so a timed-out call can be retried safely.

post/v2/audio-to-midi/v1.0/sync

Request

  • Base URL: https://api.mirelo.ai
  • URL: https://api.mirelo.ai/v2/audio-to-midi/v1.0/sync
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Stable key for one logical sync request, for retrying after an ambiguous response such as a transport timeout. Reuse it only with the identical body. While the original request is in progress, after it completed, or with a different body, the retry returns 409 idempotency_conflict instead of starting another billable request. A failed attempt may run again with the same key. A completed request's key is remembered for 24 to 48 hours after the original request completes, depending on when the daily sweep runs. A 409 retry does not extend this window; reusing the key after it is forgotten starts and bills a new request.

Request body

timing'performance' | 'quantized'

How note times are written. performance (default) keeps the take as played and describes it with a tempo map. quantized snaps notes onto the detected beats, and is honoured only when the beat grid is reliable enough to move notes onto — otherwise the response reports performance with a fallback_reason.

subdivision'automatic' | 'straight_sixteenths' | 'eighth_triplets' | 'sixteenth_triplets' | 'swing_eighths'

Rhythmic grid shared by MIDI and MusicXML. Automatic selects triplet timing only when onset fit clears the confidence gate; sparse or ambiguous material stays on straight sixteenths.

optimize_musicxmlboolean

Request more conventional, readable sheet music, with improved staff assignment, voices, beaming, rests, and spacing. This affects only the MusicXML output; it does not improve transcription accuracy or change MIDI or note data. This option adds processing time and is disabled by default. Synchronous requests wait for the score, and asynchronous jobs remain processing until it is ready. The result's musicxml_optimized reports whether the optimized score was delivered; when it could not be, the standard MusicXML is returned instead.

page_size'a4' | 'letter'

Paper layout used by MusicXML and sheet music PDFs: a4 (210 x 297 mm) or letter (8.5 x 11 in). Defaults to a4.

score_pdfsboolean

Also deliver engraved sheet music as PDFs: the full score, one PDF per part, tablature for eligible fretted parts, and one ZIP containing those PDFs. Implies optimize_musicxml, since the PDFs are set from the MusicXML you receive. Adds processing time and is disabled by default. When PDF rendering is unavailable the response omits score_bundle_url, score_manifest_url, and score_pdfs and the MIDI and MusicXML are still returned.

instrumentsstring[]

Every instrument in the recording. Optional: without it the model transcribes whatever it hears. A list is treated as exhaustive. An instrument missing from it cannot appear in the output, and a name that is not playing makes the model split a real part in two, so a partial list is worse than none. Order does not matter. An unknown name is a 400. Accepted names: acoustic_piano, electric_piano, chromatic_percussion, organ, acoustic_guitar, clean_electric_guitar, distorted_electric_guitar, acoustic_bass, electric_bass, violin, viola, cello, contrabass, orchestral_harp, timpani, string_ensemble, synth_strings, voice, orchestra_hit, trumpet, trombone, tuba, french_horn, brass_section, soprano_and_alto_sax, tenor_sax, baritone_sax, oboe, english_horn, bassoon, clarinet, flutes, synth_lead, synth_pad, drums.

instrument_detection_idstring

The instrument_detection_id from POST /v2/audio-to-midi/v1.0/instruments whose suggestions you reviewed. It must be yours, and audio must be an asset with the same content (the detection's asset_id works). When the transcription succeeds the detection counts as used, and if the detection was charged, its credits come off this transcription's charge.

Example request

{
  "audio": {
    "type": "url",
    "audio_url": "https://example.com/song.mp3"
  },
  "timing": "quantized",
  "subdivision": "automatic",
  "time_signature": {
    "numerator": 6,
    "denominator": 8
  },
  "tempo": {
    "mode": "fixed",
    "bpm": 120
  },
  "optimize_musicxml": true,
  "instruments": [
    "acoustic_guitar",
    "voice"
  ]
}

Response

Transcription artifacts and metadata

modelstring nullable required

Public release that produced this result. Null when unknown or when multiple releases contributed; not a runtime fingerprint or reproducibility guarantee.

midi_urlstring uri required

Presigned URL to the generated MIDI file

musicxml_urlstring uri

Presigned URL to the generated MusicXML file. Omitted when transcription produced no notes.

musicxml_optimizedboolean

Present with musicxml_url. True when the file is the optimized score requested with optimize_musicxml; false when optimization was not requested or the standard score was delivered instead.

score_bundle_urlstring uri

Presigned URL to an immutable ZIP containing the full score, part PDFs, and eligible tablature PDFs. Present only when score_pdfs was requested and rendering succeeded.

score_manifest_urlstring uri

Presigned URL to the export bundle's hash and tuning manifest.

duration_secondsnumber required

Duration of the input audio in seconds

note_countinteger required

Number of transcribed notes

tempo_bpmnumber

Estimated tempo in BPM when beat-grid detection succeeds

instrument_detection_credits_returnedinteger

Present when the request's instrument_detection_id was a charged detection: the credits that came off this transcription's charge.

Changes

No recorded changes to this operation across all 1 revision of this API.