Skip to content

Main content

Random Tuning System Comparison Set Generator

Sample supplied rational intervals and matched 12-TET steps into frequency and cents comparisons at an explicit reference frequency.

Loading tool…

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

  1. Supply count, intervals, referenceHertz 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 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 fieldMeaning and unitsAccepted input
countRequested count; the mechanics explain whether one draw expands into several returned records.Required. Safe integer; minimum 1; maximum 128.
intervalsIntervalsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 64.
intervals[].idLiteral identifier used to match records, independently of their display labels.Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 64.
intervals[].numeratorNumeratorRequired. Safe integer; minimum 1.
intervals[].denominatorDenominatorRequired. Safe integer; minimum 1.
intervals[].matchedSemitonesMatched SemitonesRequired. Finite number.
referenceHertzReference HertzRequired. Finite number; strictly above 0.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
referenceHertzReference HertzRequired. Finite number; strictly above 0.
comparisonsComparisonsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 128.
comparisons[].intervalIdInterval IdRequired. Text.
comparisons[].numeratorNumeratorRequired. Safe integer.
comparisons[].denominatorDenominatorRequired. Safe integer.
comparisons[].matchedSemitonesMatched SemitonesRequired. Finite number.
comparisons[].justRatioJust RatioRequired. Finite number; strictly above 0.
comparisons[].equalRatioEqual RatioRequired. Finite number; strictly above 0.
comparisons[].justHertzJust HertzRequired. Finite number; strictly above 0.
comparisons[].equalHertzEqual HertzRequired. Finite number; strictly above 0.
comparisons[].justCentsJust CentsRequired. Finite number.
comparisons[].equalCentsEqual CentsRequired. Finite number.
comparisons[].differenceCentsDifference CentsRequired. Finite number.
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": {
    "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

  1. Tool behavior and example: Random Tuning System Comparison Set Generator — tool.io

  2. Calculation or validation: music/just-intonation-ratio-to-cents — tool.io

  3. Calculation or validation: music/equal-temperament-ratio-from-semitones — 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.