Skip to content
HALOWERK

Podcast and Music Analysis

rhythm swing onsets

Swing rhythm generation returns alternating eighth-note onsets in milliseconds at a supplied quarter-note tempo. Use it when an agent needs a deterministic music calculation.

POST https://ton.halowerk.com/v1/rhythm-swing-onsets

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
meterstringYes
bpmnumberYes
swingnumberYes
snapshotSee schemaNo
Show full input schema
{
  "type": "object",
  "properties": {
    "meter": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12
    },
    "bpm": {
      "type": "number",
      "minimum": 30,
      "maximum": 300
    },
    "swing": {
      "type": "number",
      "minimum": 0.5,
      "maximum": 0.8
    },
    "snapshot": {
      "enum": [
        "music-v1"
      ]
    }
  },
  "required": [
    "meter",
    "bpm",
    "swing"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "meter": "4/4",
  "bpm": 120,
  "swing": 0.6,
  "snapshot": "music-v1"
}

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": {
        "bar_ms": {
          "type": "number"
        },
        "onsets": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "required": [
        "bar_ms",
        "onsets"
      ]
    },
    "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 โ†’