Skip to content
HALOWERK

Podcast and Music Analysis

midi clock tempo fit duration

MIDI tempo fit computes the scale and the integer tempo rounding error when retiming to a target duration. Use it when an agent needs fitting a fixed score to a production cue.

POST https://ton.halowerk.com/v1/midi-clock-tempo-fit-duration

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
midistringYes
target_secondsnumberYes
Show full input schema
{
  "type": "object",
  "properties": {
    "midi": {
      "type": "string",
      "maxLength": 60000,
      "minLength": 1
    },
    "target_seconds": {
      "type": "number",
      "minimum": 0.001,
      "maximum": 86400
    }
  },
  "required": [
    "midi",
    "target_seconds"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "midi": "TVRoZAAAAAYAAAABAeBNVHJrAAAAJgD/UQMHoSAAmSVQh0CJJQAAmSVQh0CJJQAAmSVQh0CJJQAA/y8A",
  "target_seconds": 3.4
}

Result & documentation

Show published result schema
{
  "type": "object",
  "required": [
    "measured_at",
    "source",
    "data",
    "limitations"
  ],
  "properties": {
    "measured_at": {
      "type": "string"
    },
    "source": {
      "type": "object",
      "required": [
        "reference",
        "retrieved_at"
      ],
      "properties": {
        "reference": {
          "type": "string"
        },
        "retrieved_at": {
          "type": "string"
        }
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "tempo_multiplier": {
          "type": "number"
        },
        "first_tempo_us": {
          "type": "integer"
        },
        "achieved_seconds": {
          "type": "number"
        }
      },
      "required": [
        "tempo_multiplier",
        "first_tempo_us",
        "achieved_seconds"
      ]
    },
    "limitations": {
      "type": "string"
    }
  }
}

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-12-05 UTC.

More endpoints in this hub

All endpoints in this hub โ†’