Description
Generate synthetic paired-event timings from supplied ratios and tempos with delegated share and swing labels under caller tolerance.
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.
Generate synthetic paired-event timings from supplied ratios and tempos with delegated share and swing labels under caller tolerance.
When to use this tool
Use this generator to create reproducible swing timing dataset 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
- Supply count, ratios, tempoBpm, startMilliseconds, straightShareTolerance in the field shapes below. Set seed when you need an explicit replay.
- 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.
- Read pairs. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Draw an integer BPM and a supplied positive first/second timing ratio. Convert BPM to milliseconds per beat, normalize the ratio into two subdivisions, and accumulate their onset and ending times. A delegated swing classification uses the requested straightTolerance.1
Delegated operations used for this result: bpm to ms; swing ratio percentage classifier. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 1; maximum 128. |
| ratios | Ratios | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| ratios[].first | First | Required. Finite number; strictly above 0. |
| ratios[].second | Second | Required. Finite number; strictly above 0. |
| tempoBpm | Tempo Bpm | Required. Object; no unknown keys. |
| tempoBpm.minimum | Minimum | Required. Safe integer; minimum 1. |
| tempoBpm.maximum | Maximum | Required. Safe integer; minimum 1. |
| startMilliseconds | Start Milliseconds | Required. Finite number. |
| straightShareTolerance | Straight Share Tolerance | Required. Finite number; minimum 0; strictly below 0.5. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| pairs | Pairs | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 128. |
| pairs[].index | Index | Required. Safe integer; minimum 0; maximum 127. |
| pairs[].ratioFirst | Ratio First | Required. Finite number; strictly above 0. |
| pairs[].ratioSecond | Ratio Second | Required. Finite number; strictly above 0. |
| pairs[].beatsPerMinute | Beats Per Minute | Required. Finite number; strictly above 0. |
| pairs[].beatMilliseconds | Beat Milliseconds | Required. Finite number; strictly above 0. |
| pairs[].firstOnsetMilliseconds | First Onset Milliseconds | Required. Finite number. |
| pairs[].secondOnsetMilliseconds | Second Onset Milliseconds | Required. Finite number. |
| pairs[].endMilliseconds | End Milliseconds | Required. Finite number. |
| pairs[].firstDurationMilliseconds | First Duration Milliseconds | Required. Finite number; strictly above 0. |
| pairs[].secondDurationMilliseconds | Second Duration Milliseconds | Required. Finite number; strictly above 0. |
| pairs[].firstSubdivisionSharePercent | First Subdivision Share Percent | Required. Finite number. |
| pairs[].longToShortSubdivisionRatio | Long To Short Subdivision Ratio | Required. Finite number; strictly above 0. |
| pairs[].swingTimingClass | Swing Timing Class | Required. Text. |
| randomness | Replay 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.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. 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.
{
"input": {
"count": 2,
"ratios": [
{
"first": 1,
"second": 1
},
{
"first": 2,
"second": 1
},
{
"first": 1,
"second": 2
}
],
"tempoBpm": {
"minimum": 120,
"maximum": 120
},
"startMilliseconds": 0,
"straightShareTolerance": 0.01,
"seed": 42
},
"output": {
"pairs": [
{
"index": 0,
"ratioFirst": 2,
"ratioSecond": 1,
"beatsPerMinute": 120,
"beatMilliseconds": 500,
"firstOnsetMilliseconds": 0,
"secondOnsetMilliseconds": 333.3333333333333,
"endMilliseconds": 500,
"firstDurationMilliseconds": 333.3333333333333,
"secondDurationMilliseconds": 166.66666666666666,
"firstSubdivisionSharePercent": 66.66666666666666,
"longToShortSubdivisionRatio": 2,
"swingTimingClass": "long-short-swing"
},
{
"index": 1,
"ratioFirst": 1,
"ratioSecond": 2,
"beatsPerMinute": 120,
"beatMilliseconds": 500,
"firstOnsetMilliseconds": 500,
"secondOnsetMilliseconds": 666.6666666666666,
"endMilliseconds": 1000,
"firstDurationMilliseconds": 166.66666666666666,
"secondDurationMilliseconds": 333.3333333333333,
"firstSubdivisionSharePercent": 33.33333333333333,
"longToShortSubdivisionRatio": 0.5,
"swingTimingClass": "reverse-short-long"
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Ratios describe a nominal timing grid, not performed groove or perceptual swing. BPM bounds must be ordered and accumulated times must remain numerically representable.
- 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
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.