Fill a gap in a recorded part
doseedo_fill_gapINPAINT (repair) a part: send ONE recorded part (a stem, a DAW track's audio) with a gap in it — the silence between two clips, a bar to redo, a dropout — and get it back with the gap PLAYED: the take before and after the gap is kept bit-exact (spliced back), and the gap is generated against both, so it continues out of what comes before and leads into what follows. What fills it is planned first (the DSP plane's extend planner, which hears the part): the take's own LOOP when it has one — the gap is seeded from its own passes at the matching bar phase, so a groove keeps turning — else a part written in its key and over its chords, performed in the take's own sound. Pass the session's bpm and bar grid (bar_offset_seconds: where a bar line falls in the audio you send); the gap is in seconds of that audio. Send the part with some of the take on each side of the gap (8 bars or more before it is best). Async: job_id → doseedo_wait_task (~40–150 s) → takes[{url}]: WAVs as long as the audio you sent, the gap filled — cut out the gap (or the span you need) to drop it into the DAW. output.plan says what filled it (loop bars, or the writer and the changes). Cancel: a render that has not reached the GPU yet is stopped and its credits refunded; one already rendering finishes on the GPU (its credits are spent), the job ends as canceled and the output is discarded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bpm | Yes | REQUIRED. The session's tempo — the gap is filled on its bar grid. | |
| fill | No | What fills the gap: "context" = the span played AGAIN from the take around it — no plan, no notes: a variation of what is there, in its own sound and level (INPAINTING a span that has audio — the right default there); "loop" = the take's own passes (a groove that keeps turning), "written" = a part written in its key and chords, "auto" (default) = the loop when the part has one, else written. | |
| keep | No | fill "context": how much of what is in the span its regeneration keeps, 0.01–0.9 (default 0.05: a variation; 0.45 ≈ the same playing again). | |
| name | No | Optional: a name for this job's files, e.g. "rainy-loop-3". Every file it returns downloads as <name>_<part>.<ext> (rainy-loop-3_Celesta.wav, rainy-loop-3_rough-mix.wav; one take: rainy-loop-3.wav), so the user can find them. Give each job its own name (a second take: "rainy-loop-3b"). Default: doseedo-<last 6 characters of the job id>. | |
| role | No | The part's role, when you know it (the planner hears it otherwise). | |
| seed | No | Optional random seed (the same seed plans and renders the same). | |
| notes | No | YOUR part for the gap — a custom part (a MIDI region drawn there in the DAW): [{pitch, start_seconds, duration_seconds, velocity?}], seconds of the audio you send. It is the written part, no planner: the take plays exactly these notes, in its own sound (notes outside the gap are ignored; silence where there are none). fill "written" or omitted. ≤2000. | |
| takes | No | How many takes, 1–4 (default: the server's best-of-N). | |
| audio_key | No | R2 ingest key of an uploaded audio file (from doseedo_get_upload_url / POST /api/upload/r2/ingest-url; starts with "ingest/"). The part, with the gap in it. Provide this or audio_url. | |
| audio_url | No | https URL of the audio, as an alternative to audio_key: a doseedo result URL exactly as a job returned it (a stem, a take, a bounce), or any public URL. The gateway fetches it (≤256 MB) into your account's ingest storage before the job starts. Pass audio_key OR audio_url. | |
| exact_grid | No | true = the audio is cut from a DAW session, so bpm and bar_offset_seconds are its EXACT grid: the fill keeps it (default false: the planner fine-tunes the grid to the audio's own onsets — right for a stem whose tempo you only know roughly). | |
| instrument | No | What plays the part (an id from doseedo_instruments). Optional — the take's own sound is kept either way; a written fill is played by it. | |
| track_name | No | The part's track name in the DAW ("Drums", "Bass", "Strings") — the planner hears a role from the name first, then from the sound. | |
| time_signature | No | The session's meter, e.g. "4/4" (default) or "3/4". | |
| gap_end_seconds | Yes | REQUIRED. Where the gap ends (and the take resumes), in seconds of the audio. | |
| idempotency_key | No | Optional. Any unique string for THIS request (e.g. a UUID). Re-sending the same call with the same key after a timeout returns the same job instead of starting a second one. | |
| duration_seconds | Yes | REQUIRED. The audio's length in seconds (1–600). | |
| gap_start_seconds | Yes | REQUIRED. Where the gap starts, in seconds of the audio. | |
| bar_offset_seconds | No | Where a bar line falls in the audio (seconds; default 0 = the audio starts on a downbeat). Sending a span of a DAW track that starts mid-bar? Give the first downbeat's time in it. |