Skip to content
AINSOFAPI Get API key

GuidesCut to a length

Cut to a length

Ask for 7, 15 or 45 seconds and get the same track at the nearest musical length: its own opening, whole bars joined where both sides sound alike, and its real ending. Never stretched, never faded mid phrase.

Along The River, 2:35 in full, cut to 20.44 seconds with its opening and its real ending

MCP toolfit_to_lengthRESTaction: "fit"

Try it

curl https://mcp.ainsof.io/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AINSOF_API_KEY" \
  -d '{"action": "fit", "track_id": "AIN-CAT 030_001", "seconds": 15}'

What you send

track_idrequired
string
Cue id or title.
Also accepted as title
secondsrequired
number
Target length (for kind: "video", the video's length). Rounded to 0.1.
1 to 300.
kind
string
length, video or loop. Case-insensitive.
Default: length
Allowed: length, video, loop
hit_at
number
Second at which the cue's climax should land. Rounded to 0.01.
0 or more and less than seconds; not allowed with loop.
stems
boolean
Also cut every stem at the same points.
Default: false
Only with version MAIN.
version
string
Version to cut from. Upper-cased.
Default: MAIN
Letters, digits and underscores, up to 32 characters.

Good to know

  • kind: "length" returns the nearest musical length (a 5-second request may come back at 6 to 8 seconds); video returns exactly seconds; loop returns a seamless loop of whole bars close to seconds. hit_at places the cue's climax on that second.
  • Listening (listen_url) needs nothing. download_url opens ainsof.io, which asks the person to sign in (Google or email) before the zip downloads. Edits are kept for 7 days.
  • An identical request within 15 minutes returns the same edit. Each caller (key, or address when anonymous) can have two edits in progress.

Every field it returns, and its errors, in the API Reference