Skip to content

MCP: edit operations

audio.mark_beats

Writes markers on a music item at the beats of its audio.

Last updated:

Places a marker at each beat of the visible part of the item, or at every nth beat, so that cuts and transitions can be aligned to the music. Beats are frames of the asset and come from the beat grid of the asset, supplied by the service in resolved; the command never starts a job. Markers have no effect on the picture or the sound. When the analysis finds no steady pulse, give bpm (and offset, the time of the first beat on the asset's own time axis, default 0) and the beats are those of that tempo; the grid of the asset is then not used, for example {"item_id": "itm_s6t7v8w9x0", "bpm": 120, "offset": "0.25s"}.

Arguments#

ArgumentTypeRequiredNotes
bpmnumbernoManual tempo in beats per minute, 20 to 400, for music whose pulse the analysis cannot find; replaces the detected grid.; min 20; max 400
everyintegernoMark every nth beat of the visible part, from the first; default 1.; min 1; max 64
item_idstringyesAn audio item of an audio asset, or of a video asset with audio.; pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$
labelstringnoLabel of every marker, up to 60 characters; default none.; max length 60
offsetstringnoWith bpm: the time of the first beat on the asset's time axis, from its start; default "0s".
replacebooleannoTrue (default) replaces the item's markers; false keeps them and adds the beats.

Errors#

Scope#

Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help audio.mark_beats for the same description from the binary, or call the command_help tool.

Next steps#

As an MCP call

tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "edit",
    "arguments": {
      "project_id": "prj_7k2m9x4q1b",
      "base_revision": 12,
      "operations": [
        {
          "op": "audio.mark_beats",
          "args": {
            "every": 2,
            "item_id": "itm_s6t7v8w9x0",
            "label": "beat"
          }
        }
      ]
    }
  }
}

As a batch file for the CLI

batch.json
[
  {
    "op": "audio.mark_beats",
    "args": {
      "every": 2,
      "item_id": "itm_s6t7v8w9x0",
      "label": "beat"
    }
  }
]
Terminal
stuarty edit --project prj_7k2m9x4q1b --ops batch.json --json

Over HTTP

curl
curl -X POST "http://127.0.0.1:7878/api/v1/projects/prj_7k2m9x4q1b/edit" \
  -H "Authorization: Bearer $STUARTY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "base_revision": 12,
  "operations": [
    {
      "op": "audio.mark_beats",
      "args": {
        "every": 2,
        "item_id": "itm_s6t7v8w9x0",
        "label": "beat"
      }
    }
  ]
}'

The ids in the example are illustrative: read the real ones with project_get.