Blog, Editing

How we built an AI agent that cuts music like an editor

Ads, pre-rolls, bumpers and logo stings all need music at an exact length, and a short version has to sound as if the song was written that long. How we built an AI agent that makes our cuts, how we trained it on our own editor's corrections, and how you can ask for the same kind of cut in ChatGPT or Claude.

Noa Lavi
Noa Lavi21 October 2026 · 7 min read
Fourteen seconds of silent footage, scored by AINSOF with the fifteen-second cut of Sovereign Ascent, already on the picture and ending on the last frame. Unmute to hear it.
In short: Our cutting agent measures a track before it touches it: tempo, beats, downbeats, the climax and where the music really ends. It keeps the real opening, moves in whole bars and lands on the song's real ending, and it never stretches the audio or fades in the middle. Every correction from our editor became a written rule it applies to similar songs, and every file is measured before anyone listens. The same craft is behind the cut you can ask for in ChatGPT or Claude, at any length from 1 to 300 seconds.

Why we built an agent for cuts

The fastest way to make a two-minute track fit a fifteen-second spot is to trim it where the picture ends and pull a fade over the last second. The music doesn't end, it gets turned down, and on a pre-roll the logo arrives while the melody is still mid-sentence. A six-second bumper is three or four bars of music, so there is nowhere to hide a bad edit.

Most cues come with ready-made versions at 15, 30, 40 and 60 seconds, and clients ask for lengths in between. Cut by hand, that is slow, and no two people cut the same song the same way. We built an agent so every version is made by the same rules, measured the same way before anyone hears it, and judged by the same ear. For us, it meant our editor's time goes to listening and deciding, not cutting, and a correction he makes once becomes a rule the agent applies to later songs instead of a fix repeated by hand. What it solved is inconsistent cuts and fades in the middle; the same principles (the real ending, whole bars, no stretching, no mid fade) are behind the any-length cut you can ask for in ChatGPT or Claude.

What the agent measures first

The agent has no ears, so it starts with measurement. Before it cuts anything it maps the track: the tempo, where every beat falls, where every downbeat (the first beat of a bar) falls, where the climax sits, and where the music really ends. That last one matters more than it sounds. A file often runs on for seconds after the final chord has died away, and a cut timed to the end of the file instead of the end of the music sounds wrong. Every cut point the agent chooses comes from this map, never from a stopwatch.

The rules it cuts by

These are the same rules a music editor works by, and they work in any NLE or DAW if you cut by hand.

1.Start from the ending

The song's natural ending is the anchor, always. Composers write endings (a final chord, a hit, a ring-out) and the ending is what tells the audience the spot is over, so it is the one part you never fake. For our ready-made versions the agent works backwards: the ending is fixed, and the start is found by counting back from it. If the logo or end card appears before the last frame, line the music's arrival up with the logo rather than with the cut to black.

2.Start on a real downbeat, and a real phrase

A start has to land on a downbeat the analysis actually found, not on a point of an evenly spaced grid. Landing on a downbeat is necessary but not enough: a downbeat can fall in the middle of a phrase or on a held note. On a song with vocals, the start should be a clean entry at the beginning of a sung line, never mid-word.

3.Move in whole bars

Count bars, not seconds. In 4/4 at 120 BPM a bar lasts exactly two seconds, so a jump from one downbeat to another lands back in the groove. A jump is always a whole number of bars. How many depends on the length you need, and the bar it lands on should be the start of a phrase, so the music picks up where a new line begins. In the examples below, the jumps run from 20 to 80 bars.

4.Never stretch, never fade in the middle

The agent doesn't time-stretch the recording, doesn't fade in, and never fades in the middle of a phrase. The only fade it is allowed is on the song's own decaying tail. A fade at the very end of a ring-out is invisible; a fade in the middle of a phrase is not.

Before you export a cut: does it start on a downbeat at the top of a phrase, is every jump a whole number of bars, does it end on the song's own last chord, and is any fade only on the final ring?

How we trained it

The agent cuts; our composer-editor, Or Chausha, listens. Whenever he rejects a cut, the reason is written down as a rule, and the agent applies that rule to every similar song from then on. Where a rule can be written as code, it is. Cuts he has approved by ear are kept as reference answers that the agent has to reproduce before any change goes live, and they are never re-cut by a later rule. A few of the rules that came out of his corrections:

  1. A downbeat is not automatically a good start. It also has to be where the music opens a phrase.
  2. On a ballad, a pause in the vocal is not an ending. The cut waits for the song's real close.
  3. On a track with drums, the start lines up with the kick itself, not just with the beat grid.
  4. On very short edits, a long single-note tail can swallow the edit. It gets shortened with a fade at the very end, so most of the edit is still music.

Every file is then checked by measurement before anyone hears it: the format, the exact length, whether the start sits on a detected downbeat, and clicks, silence or clipping. A cut that fails a check is flagged for a listen instead of being sent.

Ask for a cut in ChatGPT or Claude

First check whether the cue already comes in the length you need. Open Balloons and Brave Hearts by Tom Goldstein and you'll find:

  1. Cutdowns at 15s, 30s, 40s and 60s.
  2. Alternative mixes: No Drums and No Melody, at the full 2:19.
  3. Stems for bass, bells, brass chords, brass melody, drums, harp, piano and strings.

For any other length, ask your assistant. With AINSOF connected to ChatGPT, Claude or any assistant that supports MCP, a tool called fit_to_length cuts any cue to any length from 1 to 300 seconds. It edits the composer's own recording and doesn't generate new music: it keeps the song's opening, jumps whole bars into the song's real ending, and never stretches or fades in the middle. Everything below was run on the live AINSOF server on 21 October 2026, and the numbers are exactly what came back.

1.A version close to a length

This is the ordinary request. You get the nearest musical length, meaning the closest point where the song can still end on its real ending, so it may be a little over or under what you asked.

Make a 15-second version of Balloons and Brave Hearts.

It came back at 14.694 seconds: "The opening (2.2s), then a jump of 80 whole bars into the song's real ending." Asking the same song for 30 seconds returned 30.02 seconds, and for 6 seconds, 5.197 seconds. A 6-second request for We'll Be Right Back by Idan Zion came back at 5.981 seconds: "The opening (1.6s), then a jump of 48 whole bars into the song's real ending."

2.Exactly as long as your video

When the picture is locked and the music has to end on the last frame, say how long the video is. This kind returns exactly that length, with the final hit before the last frame.

My video is exactly 15 seconds. Cut Balloons and Brave Hearts to fit it.

It came back at 15 seconds exactly. The same request at 6 seconds came back at exactly 6.

3.The big moment on your logo

Every song has an arrival: the point it builds to. Tell the assistant the second where your logo or reveal appears, and the tool places the song's arrival there.

Cut Balloons and Brave Hearts to my 15-second video, with the big moment landing at 12 seconds.

It came back at exactly 15 seconds: "The song's arrival (22.5s in the original) lands at 12.00s, then a jump of 70 whole bars into the real ending." For a 6-second sting with the arrival at 5 seconds, it landed at 5.00 seconds. Asking Along The River for a 30-second video with the arrival at 12 seconds came back at exactly 30 seconds: “The song's arrival (81.4s in the original) lands at 12.00s, then a jump of 20 whole bars into the real ending.”

Waveform of a 30-second cut of Along The River with a marker at 12 seconds
Along The River cut to exactly 30 seconds, its arrival placed at 12 seconds (the marker).

4.A seamless loop

For a background under a product page, a menu or an installation, ask for a loop. You get whole bars chosen so the end flows straight back into the start.

Make a 15-second seamless loop of Balloons and Brave Hearts.

It came back at 14.984 seconds: "A seamless loop of 10 bars (15.0s) from 106.5s of the song." A 16-second loop of Along The River came back at 16.032 seconds, six bars long.

Waveform of a 16-second seamless loop of Along The River
The 16-second loop of Along The River. The end returns to the start.

5.Your version, your stems

Already picked a version? Say so, and the cut is made from it instead of the full mix ("the No Melody version, 30 seconds"). Ask for stems and every stem of the full mix is cut at the same points, so you can rebalance the edit yourself. Each edit comes back with a free link to listen and a zip (an MP3 at 192 kbps, plus the stems if you asked for them), kept for 7 days. Downloading the zip opens ainsof.io and needs a sign-in and an active plan.

The cues in these examples:

Open one to hear the full track and all its ready-made versions.

Building this into your own product? The same cuts are available through the AINSOF API; the cut to time guide covers every option, from cutting to a video to hitting a moment and making a loop.

The AI decides where to cut; the music itself was written, performed and produced by human composers, and nothing in the catalog is AI-generated. Every cut keeps their opening or their ending. Listening is free; licensing for every kind of project is on the pricing page.

Add AINSOF to ChatGPT Explore the music