Piano Audio to MIDI
Convert uploaded piano audio into a MIDI file. This is useful for melody extraction, arrangement reconstruction, score production, music education, and creative reuse.
- Endpoint:
POST /task/piano_audio_to_midi - Task Type:
piano_audio_to_midi - Billing: By audio duration (per minute)
- Output Format: MIDI
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file_id | string | Yes | - | File ID returned from upload, see File Upload |
Request Example
curl -X POST "https://cloud.ai-mcn.tv/task/piano_audio_to_midi" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": "537489015178246"
}'
Response Example
{
"code": 0,
"message": "success",
"data": {
"task_id": "537489015178247"
}
}
The task runs asynchronously. Poll the task query endpoint or subscribe through Task Progress Query.
Result Retrieval
After completion, request GET /task/piano_audio_to_midi/{task_id}:
{
"code": 0,
"message": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"file_id": "537489015178248",
"download_url": "/download/a1/537489015178248.mid"
}
}
}
Field Reference
| Field | Type | Description |
|---|---|---|
output_result.file_id | string | Generated MIDI file ID |
output_result.download_url | string | Download URL for the MIDI file |
Limitations
- Input supports audio files only (
mp3,wav,m4a,aac,flac,ogg, etc.). - Best suited for solo piano or piano-dominant audio. Dense mixes may reduce transcription accuracy.
- Billed by audio duration. Failed tasks are refunded according to backend billing rules.
Error Codes
| Error Code | HTTP Status | Description | Resolution |
|---|---|---|---|
6013 | 400 | Missing file_id | Pass the file_id field |
6014 | 400 | Unsupported file type | Upload a supported audio file |
6017 | 400 | Media probe failed | Ensure the file is a valid, non-corrupt audio |
6004 | 404 | File not found | Verify the file_id |
6502 | 401 | Authentication failed | Check the Authorization header |
6202 | 402 | Insufficient balance | Recharge in the Dashboard |