Universal Music Theory Library - v0.12.0
    Preparing search index...

    Class NonOctaveTuning

    Non-octave tuning - the period of repetition is not the octave (2:1) but an arbitrary ratio. The canonical example is Bohlen-Pierce, which repeats at the tritave (3:1) with 13 equal steps.

    Example: Bohlen-Pierce

    new NonOctaveTuning('Bohlen-Pierce', 13, 3)
    

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • name: string
      • stepsPerPeriod: number

        Number of equal steps per period. Must be a positive integer.

      • periodRatio: number

        The frequency ratio of one period (e.g. 3 for tritave). Must be > 1.

      • baseFrequency: number = 440

      Returns NonOctaveTuning

    Properties

    baseFrequency: number = 440

    Reference frequency for step 0 (A4). Default: 440 Hz.

    name: string

    Display name: '12-TET', 'Ptolemaic Just Intonation', 'Werckmeister III'.

    periodRatio: number

    The frequency ratio of one period (e.g. 3 for tritave). Must be > 1.

    stepsPerPeriod: number

    Number of equal steps per period. Must be a positive integer.

    Accessors

    • get octaveSteps(): number

      Steps per period (not an octave - the period is periodRatio : 1).

      Returns number

    Methods

    • Returns the frequency in Hz for a given step offset from A4.

      Parameters

      • steps: number

      Returns number

    • Returns a note name for the given step: the 12-TET name of the note the step stands for (getStandardStep), in sharps ("C#4", "A4"), or "Step N" when it stands for none.

      Parameters

      • step: number

      Returns string

    • Converts a 12-TET step pattern (successive steps, e.g. major [2, 2, 1, 2, 2, 2, 1]) to this tuning. Each note's position above the first is mapped, not each step, so the pattern keeps its span: in 22-EDO the major scale spans 22 steps (rounding each step would give 24), and in a 7-note JI scale a semitone does not collapse to 0 steps. A step comes out 0 only when two notes land on the same step of this tuning.

      Parameters

      • pattern: readonly number[]

      Returns number[]

    • Converts a standard 12-TET step (A4 = 0) to the step of this tuning nearest in cents (standardStep × 100¢ above step 0). Works for any tuning whose steps rise: unequal (JI, cent tables, Scala) and non-octave ones alike — in Bohlen-Pierce a fifth (700¢) maps to step 5 (731.6¢). Tunings with 12 steps per octave map one to one.

      Parameters

      • standardStep: number

      Returns number

    • The step of target that stands for the same 12-TET note as step does here (getStandardStep on both sides): C4 is step -9 in 12-TET and step -23 in 31-EDO.

      Parameters

      Returns number | null

      The step in target, or null when step stands for no note or target has no step for it.