Description
Generate exact rational event grids for shared-cycle polyrhythms or shared-beat polymeters with delegated tempo timing.
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 exact rational event grids for shared-cycle polyrhythms or shared-beat polymeters with delegated tempo timing.
When to use this tool
Use this generator to create reproducible polyrhythm event grid 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 pulseCounts, mode, sharedCycleQuarterNotes, beatsPerMinute 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 mode, pulseCounts, gridTicks, cycleQuarterNotes, cycleSeconds, events. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Draw layer pulse counts and form their least-common-multiple tick grid. Polyrhythm spreads each layer's pulses over the shared cycle; polymeter advances every layer on each shared beat, tracking its bar and pulse position. Sort events by tick then layer.1
Delegated operations used for this result: least common multiple; note value duration seconds at bpm. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| pulseCounts | Pulse Counts | Required. Array of Object; no unknown keys.; minimum items 2; maximum items 8. |
| pulseCounts[].minimum | Minimum | Required. Safe integer; minimum 1; maximum 32. |
| pulseCounts[].maximum | Maximum | Required. Safe integer; minimum 1; maximum 32. |
| mode | Mode | Required. Text; one of "polyrhythm", "polymeter". |
| sharedCycleQuarterNotes | Shared Cycle Quarter Notes | Required. Finite number; strictly above 0. |
| beatsPerMinute | Beats Per Minute | Required. Finite number; strictly above 0. |
| 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 |
|---|---|---|
| mode | Mode | Required. Text; one of "polyrhythm", "polymeter". |
| pulseCounts | Pulse Counts | Required. Array of Safe integer; minimum 1; maximum 32.; minimum items 2; maximum items 8. |
| gridTicks | Grid Ticks | Required. Safe integer; minimum 1; maximum 4096. |
| cycleQuarterNotes | Cycle Quarter Notes | Required. Finite number; strictly above 0. |
| cycleSeconds | Cycle Seconds | Required. Finite number; strictly above 0. |
| events | Events | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 2048. |
| events[].layer | Layer | Required. Safe integer; minimum 0; maximum 7. |
| events[].pulse | Pulse | Required. Safe integer; minimum 0; maximum 4095. |
| events[].bar | Bar | Required. Safe integer; minimum 0; maximum 4095. |
| events[].pulseInBar | Pulse In Bar | Required. Safe integer; minimum 0; maximum 31. |
| events[].tick | Tick | Required. Safe integer; minimum 0; maximum 4095. |
| events[].cycleFractionNumerator | Cycle Fraction Numerator | Required. Safe integer; minimum 0; maximum 4095. |
| events[].cycleFractionDenominator | Cycle Fraction Denominator | Required. Safe integer; minimum 1; maximum 4096. |
| events[].timeSeconds | Time Seconds | Required. Finite number. |
| 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": {
"pulseCounts": [
{
"minimum": 3,
"maximum": 3
},
{
"minimum": 2,
"maximum": 2
}
],
"mode": "polyrhythm",
"sharedCycleQuarterNotes": 4,
"beatsPerMinute": 120,
"seed": 42
},
"output": {
"mode": "polyrhythm",
"pulseCounts": [
3,
2
],
"gridTicks": 6,
"cycleQuarterNotes": 4,
"cycleSeconds": 2,
"events": [
{
"layer": 0,
"pulse": 0,
"bar": 0,
"pulseInBar": 0,
"tick": 0,
"cycleFractionNumerator": 0,
"cycleFractionDenominator": 6,
"timeSeconds": 0
},
{
"layer": 1,
"pulse": 0,
"bar": 0,
"pulseInBar": 0,
"tick": 0,
"cycleFractionNumerator": 0,
"cycleFractionDenominator": 6,
"timeSeconds": 0
},
{
"layer": 0,
"pulse": 1,
"bar": 0,
"pulseInBar": 1,
"tick": 2,
"cycleFractionNumerator": 2,
"cycleFractionDenominator": 6,
"timeSeconds": 0.6666666666666666
},
{
"layer": 1,
"pulse": 1,
"bar": 0,
"pulseInBar": 1,
"tick": 3,
"cycleFractionNumerator": 3,
"cycleFractionDenominator": 6,
"timeSeconds": 1
},
{
"layer": 0,
"pulse": 2,
"bar": 0,
"pulseInBar": 2,
"tick": 4,
"cycleFractionNumerator": 4,
"cycleFractionDenominator": 6,
"timeSeconds": 1.3333333333333333
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Polymeter requires sharedCycleQuarterNotes equal to one. Grid and event counts are bounded. Nominal event times use BPM and do not imply performed accents or auditory rendering.
- 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 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.