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

ParameterTypeRequiredDefaultDescription
file_idstringYes-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

FieldTypeDescription
output_result.file_idstringGenerated MIDI file ID
output_result.download_urlstringDownload 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 CodeHTTP StatusDescriptionResolution
6013400Missing file_idPass the file_id field
6014400Unsupported file typeUpload a supported audio file
6017400Media probe failedEnsure the file is a valid, non-corrupt audio
6004404File not foundVerify the file_id
6502401Authentication failedCheck the Authorization header
6202402Insufficient balanceRecharge in the Dashboard