Skip to main content
POST
Python
Convert an audio file into a MIDI file using AI-driven audio analysis and transcription. The Audio to MIDI endpoint processes audio files to generate MIDI sequences. It can optionally create a sonified .wav file of the MIDI output and export note events into a .csv file for further analysis or editing. Ideal for music production, remixing, and advanced audio content creation.

Endpoint

This is the primary endpoint for initiating audio-to-MIDI conversion tasks.

Sample Output

Generated MIDI and optional outputs from a sample audio file: Download MIDI(.mid) Download Sonified MIDI(.wav)

Try it Yourself

Visit the Audio to MIDI Endpoint Explorer to test it live. Upload an audio file, and get back the MIDI version!

🛠️ Request Parameters

💡Note: audio_path must be a valid and accessible S3 URL.
content-type: multipart/form-data

Sample Request

cURL

Python

🔐 Replace api_key, audio_path, and webhook_url with your own values before sending.

Sample Response

Success (200 OK)


Common Errors

  • 400 Bad Request: Invalid audio_path or missing required parameters.
  • 404 Not Found: Provided audio file not found in S3.
  • 422 Unprocessable Entity: Unsupported audio format.
  • 500 Internal Server Error: An unexpected error occurred while processing.

Webhook Response

When the conversion process completes, if a webhook_url was provided, the system sends a POST request:
You can download your generated files using the provided URLs.

Payload and Request Formation

Authorizations

Authorization
string
header
required

Body

multipart/form-data
audio_url
string
required

Input audio URL (supported format: YouTube URL).

Example:

"https://example.com/audio.mp3"

audio_file
file

Audio file to upload and process directly.

sonify_midi
boolean
default:true

If true, generates a .wav file that sonifies the MIDI output.

save_note_events
boolean
default:true

If true, saves predicted note events as a CSV file.

webhook_url
string

Callback URL to receive conversion results.

Example:

"https://your-webhook-url.com/callback"

Response

MIDI conversion task initiated successfully

success
boolean
Example:

true

task_id
string
Example:

"task789"

message
string
Example:

"MIDI conversion task queued successfully"