feat: advanced split — per-instrument stems + MIDI via /api/advanced_split - #3
Open
francialisomlimoeiro wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
POST /api/advanced_split— Suno Studio "Extract Stems and MIDI" (Advanced split tab).What it does
"Drum Kit","Lead Vocal")GET /api/gen/{id}/midiRequest contract
{ "song_id": "<source clip id>", "instruments": ["Drum Kit", "Lead Vocal"], "mode": "extract", "include_midi": true }mode:"extract"(isolate) or"remove"(karaoke).include_midialso requests the MIDI batch and returns note-events.Implementation notes
gen_stemtask: onePOST /api/generate/v2-web/per instrument,stem_type_id=91(constant for advanced mode; the instrument is carried bystem_type_group_name/stem_name), source clip incontinue_clip_idpermission_denied)metadata.user_tiersourced fromGET /api/billing/info/,device-idheader includedgetCaptcha()flow and passed in the payload when upstream demands itGET /api/feed/?ids=until complete; MIDI clip keeps polling on 400Clip must be completeuntil it resolves within the deadline, then note-events are fetched from the midi endpointLink-first: all existing routes are untouched; this is purely additive (new endpoint + supporting
SunoApimethods, docs + swagger entry).Verified against a live account: 2 instruments in one call, 8 clips complete (extract/remove x audio/MIDI), audio downloadable from CDN, MIDI note-events non-empty.