Description
Sample supplied rational intervals and matched 12-TET steps into frequency and cents comparisons at an explicit reference frequency.
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.
Sample supplied rational intervals and matched 12-TET steps into frequency and cents comparisons at an explicit reference frequency.
When to use this tool
Use this generator to create reproducible tuning system comparison set 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, intervals, referenceHertz 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 referenceHertz, comparisons. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Preflight all distinct supplied rational intervals, compare each numerator/denominator ratio with its matched 12-TET semitone ratio at referenceHertz, and calculate frequencies and signed just-minus-equal cents differences. Draw comparison records with replacement.1
Delegated operations used for this result: just intonation ratio to cents; equal temperament ratio from semitones. 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. |
| intervals | Intervals | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 64. |
| intervals[].id | Literal identifier used to match records, independently of their display labels. | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 64. |
| intervals[].numerator | Numerator | Required. Safe integer; minimum 1. |
| intervals[].denominator | Denominator | Required. Safe integer; minimum 1. |
| intervals[].matchedSemitones | Matched Semitones | Required. Finite number. |
| referenceHertz | Reference Hertz | 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 |
|---|---|---|
| referenceHertz | Reference Hertz | Required. Finite number; strictly above 0. |
| comparisons | Comparisons | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 128. |
| comparisons[].intervalId | Interval Id | Required. Text. |
| comparisons[].numerator | Numerator | Required. Safe integer. |
| comparisons[].denominator | Denominator | Required. Safe integer. |
| comparisons[].matchedSemitones | Matched Semitones | Required. Finite number. |
| comparisons[].justRatio | Just Ratio | Required. Finite number; strictly above 0. |
| comparisons[].equalRatio | Equal Ratio | Required. Finite number; strictly above 0. |
| comparisons[].justHertz | Just Hertz | Required. Finite number; strictly above 0. |
| comparisons[].equalHertz | Equal Hertz | Required. Finite number; strictly above 0. |
| comparisons[].justCents | Just Cents | Required. Finite number. |
| comparisons[].equalCents | Equal Cents | Required. Finite number. |
| comparisons[].differenceCents | Difference Cents | 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": {
"count": 2,
"intervals": [
{
"id": "fifth",
"numerator": 3,
"denominator": 2,
"matchedSemitones": 7
},
{
"id": "major-third",
"numerator": 5,
"denominator": 4,
"matchedSemitones": 4
}
],
"referenceHertz": 440,
"seed": 42
},
"output": {
"referenceHertz": 440,
"comparisons": [
{
"intervalId": "major-third",
"numerator": 5,
"denominator": 4,
"matchedSemitones": 4,
"justRatio": 1.25,
"equalRatio": 1.2599210498948732,
"justHertz": 550,
"equalHertz": 554.3652619537442,
"justCents": 386.3137138648348,
"equalCents": 399.9999999999997,
"differenceCents": -13.686286135165112
},
{
"intervalId": "fifth",
"numerator": 3,
"denominator": 2,
"matchedSemitones": 7,
"justRatio": 1.5,
"equalRatio": 1.4983070768766815,
"justHertz": 660,
"equalHertz": 659.2551138257398,
"justCents": 701.9550008653874,
"equalCents": 700,
"differenceCents": 1.9550008653876136
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- The interval correspondence is caller-supplied and frequencies must remain positive and finite. This is a tuning comparison rather than a claim that one tuning is perceptually or musically optimal.
- 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.