Skip to content

Main content

Random Exact-Fill Rhythm Measure Generator

Fill one supplied meter exactly in a bounded rational tick grid with reachable duration choices and independent rests, delegating tempo and tuplet seconds; choices are locally uniform, not uniform over complete measures, and tuplet engraving groups are not inferred.

Loading tool…

Description

Fill one supplied meter exactly in a bounded rational tick grid with reachable duration choices and independent rests, delegating tempo and tuplet seconds; choices are locally uniform, not uniform over complete measures, and tuplet engraving groups are not inferred.

A musical fixture expresses pitch or timing through explicit numeric conventions such as MIDI numbers, semitone intervals, beats, and durations. A reproducible symbolic sequence is separate from a performed sound or a judgment of musical quality.

Fill one supplied meter exactly in a bounded rational tick grid with reachable duration choices and independent rests, delegating tempo and tuplet seconds; choices are locally uniform, not uniform over complete measures, and tuplet engraving groups are not inferred.

When to use this tool

Use this generator to create reproducible rhythm measure cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply meterNumerator, meterDenominator, beatsPerMinute, noteValues, restProbability in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read divisionsPerQuarter, totalTicks, durationSeconds, events. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.

Convert meter and dotted or tuplet note values into exact rational quarter-note multiples and a common integer tick grid. Use reachability of remaining ticks to draw only durations that can finish the bar, then independently mark rests and calculate times at BPM.1

Delegated operations used for this result: tuplet ratio duration calculator. Their calculation or parsing conventions apply to the corresponding result fields.2

Input fieldMeaning and unitsAccepted input
meterNumeratorMeter NumeratorRequired. Safe integer; minimum 1; maximum 16.
meterDenominatorMeter DenominatorRequired. Safe integer; one of 1, 2, 4, 8, 16.
beatsPerMinuteBeats Per MinuteRequired. Finite number; strictly above 0.
noteValuesNote ValuesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 16.
noteValues[].denominatorDenominatorRequired. Safe integer; one of 1, 2, 4, 8, 16, 32, 64.
noteValues[].dotsDotsRequired. Safe integer; minimum 0; maximum 2.
noteValues[].tupletActualNotesTuplet Actual NotesRequired. Safe integer; minimum 1; maximum 16.
noteValues[].tupletNormalNotesTuplet Normal NotesRequired. Safe integer; minimum 1; maximum 16.
restProbabilityRest ProbabilityRequired. Finite number; minimum 0; maximum 1.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
divisionsPerQuarterDivisions Per QuarterRequired. Safe integer; minimum 1; maximum 4096.
totalTicksTotal TicksRequired. Safe integer; minimum 1; maximum 4096.
durationSecondsDuration SecondsRequired. Finite number; strictly above 0.
eventsEventsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 4096.
events[].tokenIndexToken IndexRequired. Safe integer; minimum 0; maximum 15.
events[].startTickStart TickRequired. Safe integer; minimum 0; maximum 4095.
events[].durationTicksDuration TicksRequired. Safe integer; minimum 1; maximum 4096.
events[].quarterNoteMultiplesQuarter Note MultiplesRequired. Finite number; strictly above 0.
events[].durationSecondsDuration SecondsRequired. Finite number; strictly above 0.
events[].startSecondsStart SecondsRequired. Finite number; minimum 0.
events[].isRestIs RestRequired. Boolean.
randomnessReplay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source.Required. Object; no unknown keys.
randomness.seedOptional numeric replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "meterNumerator": 3,
    "meterDenominator": 4,
    "beatsPerMinute": 120,
    "noteValues": [
      {
        "denominator": 8,
        "dots": 0,
        "tupletActualNotes": 1,
        "tupletNormalNotes": 1
      },
      {
        "denominator": 4,
        "dots": 0,
        "tupletActualNotes": 1,
        "tupletNormalNotes": 1
      }
    ],
    "restProbability": 0.5,
    "seed": 42
  },
  "output": {
    "divisionsPerQuarter": 2,
    "totalTicks": 6,
    "durationSeconds": 1.5,
    "events": [
      {
        "tokenIndex": 1,
        "durationTicks": 2,
        "quarterNoteMultiples": 1,
        "durationSeconds": 0.5,
        "startTick": 0,
        "startSeconds": 0,
        "isRest": true
      },
      {
        "tokenIndex": 1,
        "durationTicks": 2,
        "quarterNoteMultiples": 1,
        "durationSeconds": 0.5,
        "startTick": 2,
        "startSeconds": 0.5,
        "isRest": false
      },
      {
        "tokenIndex": 0,
        "durationTicks": 1,
        "quarterNoteMultiples": 0.5,
        "durationSeconds": 0.25,
        "startTick": 4,
        "startSeconds": 1,
        "isRest": false
      },
      {
        "tokenIndex": 0,
        "durationTicks": 1,
        "quarterNoteMultiples": 0.5,
        "durationSeconds": 0.25,
        "startTick": 5,
        "startSeconds": 1.25,
        "isRest": false
      }
    ],
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Both grid divisions and bar ticks are limited to 4096. Infeasible note banks are rejected. Duration choices are not uniform over complete rhythms, and nominal seconds do not model performance nuance.
  • A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Exact-Fill Rhythm Measure Generator — tool.io

  2. Calculation or validation: music/tuplet-ratio-duration-calculator — tool.io

Similar or alternative tools

  • Random Bounded-Interval Melody Generator

    Generate a MIDI melody from an explicit starting pitch with uniform local choices including repeated notes inside a pitch range and maximum semitone step, delegating frequency and signed interval answers; not uniform over complete melodies.

  • Random Polyrhythm Event Grid Generator

    Generate exact rational event grids for shared-cycle polyrhythms or shared-beat polymeters with delegated tempo timing.