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

    Class ABCBridge

    Bridge between Universal Music Theory and ABC Notation. Converts UMT objects to ABC strings for visual rendering. Lengths assume L:1/4, as wrapInHeaders writes. Notes of other tunings are written at the nearest 12-TET pitch.

    Index

    Constructors

    Methods

    • Converts a chord (or array of notes) to an ABC chord string, with accidentals written against the signature of key.

      Parameters

      Returns string

    • Converts a single Note to ABC notation, with its accidental if it has one and no key or measure context (see streamToABC for naturals against a signature). C4 (middle C) → C, C5 → c, C3 → C,, Bb4 → _B.

      Parameters

      Returns string

    • Converts a progression (array of note arrays) to ABC, one chord per measure.

      Parameters

      • progression: Note[][]
      • key: string = 'C major'

      Returns string

    • Converts a scale to an ABC sequence of quarter notes (one measure, no barlines), with accidentals written against the signature of key.

      Parameters

      • scale: Scale
      • octaves: number = 1
      • key: string = 'C major'

      Returns string

    • Converts a MusicStream to ABC notation (body only; see wrapInHeaders). Barlines follow the stream's time signature; notes that cross one are tied, and lengths with no single written value are split into tied values. Lengths count in quarter notes (L:1/4) whatever the meter: in 6/8 an eighth is /2. Triplet notes are written (3:2:1.

      Parameters

      Returns string

    • Converts a MusicStream to ABC notation with optional chord symbols above the staff.

      Parameters

      • stream: MusicStream
      • OptionalchordNames: string[]

        Optional chord names aligned to stream.events; each is written above the first note of its event.

      • options: ABCStreamOptions = {}

      Returns string

    • Generates an ABC tuplet string.

      Parameters

      • notes: Note[]

        Notes within the tuplet.

      • p: number

        How many notes in the tuplet (e.g. 3 for triplet).

      • q: number

        Normal note value they fit into (e.g. 2 for triplet).

      • duration: number

        Written length of each note in quarter notes (0.5 = an eighth).

      Returns string

    • Wraps ABC content in standard headers for rendering.

      Parameters

      • content: string
      • title: string = ''
      • meter: string = '4/4'
      • keySymbol: string = 'C major'

        UMT key symbol (e.g. 'C major', 'G major', 'D minor'). Automatically converted to ABC K: field (e.g. 'C', 'G', 'Dm').

      Returns string