fit_to_length
Use this when the user has chosen an AINSOF cue and needs it at a specific length — a 15-second ad, a 6-second bumper, a loop. It edits the composer's own recording; it does not generate new music. Cut one catalog cue to the length you need — for an ad, a reel, a sting or a video — the way an editor would: the song's opening, a jump of whole bars, and the song's REAL ending ringing out. Never stretched, never faded in the middle. kind='length' returns the nearest MUSICAL length (ask for 5 and you may get 6-8 seconds, so the ending still lands); kind='video' returns exactly seconds with the final hit before the last frame; kind='loop' returns a seamless loop of whole bars close to seconds. hit_at puts the song's arrival (its climax) on that second — use it for a reveal or a logo. stems=true also cuts every stem at the same points. Returns a listen link and a zip (MP3 192k mix + stems), kept 7 days. Identify the cue by the track_id or title search_music returned. For an ordinary request such as 'an 11-second version', use kind='length' and report the returned musical duration. Use kind='video' only when the user supplies a video's duration or explicitly asks for an exact duration. Do not carry a previous test's exact-length setting into a new request. When the user asks you to create, shorten or adapt a selected cue to a duration, call fit_to_length with that cue and the requested seconds. This works for arbitrary durations from 1 to 300 seconds, not just stock 15/30/40/60-second cuts or clips below 15 seconds. Preserve their chosen source version (for example NO_VOCALS); never silently use MAIN instead. If no cue has been chosen, search using their musical brief and help them choose first; a search result is not a newly generated edit. When status is processing, continue the same returned retry arguments without asking the user to repeat their request. Do not claim the edit is ready until status is ready and the returned edit links exist. Reply in the user's language, naming the cue, requested duration and actual duration. Show the supplied player and a clearly labeled download link; never show the source track's audio as the generated edit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | For an ordinary request such as 'an 11-second version', use kind='length' and report the returned musical duration. Use kind='video' only when the user supplies a video's duration or explicitly asks for an exact duration. Do not carry a previous test's exact-length setting into a new request. Use loop for an explicitly requested loop. | |
| stems | No | also cut every stem the same way | |
| hit_at | No | optional: the second where the song's arrival should land | |
| seconds | Yes | the length you need (for kind='video', the video's length) | |
| version | No | optional: cut from this version instead of MAIN | |
| track_id | Yes | e.g. 'AIN-CAT 038_007', or the cue's title |