Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace tLibrary

Index

Functions

fromArray

  • fromArray(techniques: Technique[]): tLibrary

Const merge

  • merge(...libraries: any[]): {}
  • Merge multiple event libraries into one, throw an error if any of the input libraries have overlapping keys.

    Parameters

    • Rest ...libraries: any[]

    Returns {}

midiScale

  • midiScale(startingNoteNumber?: number): tLibrary
  • Create a technique Library containing 3 octaves in a harmonic minor scale.

    solfege:    do re me fa sol le te ti
    half steps: 0  2  3  5  7   8  10 11
    0va keys:   A  B  C  D  E   F  G  T
    8va keys:   a  b  c  d  e   f  g  t
    16va keys:  0  1  2  3  4   5  6  7  8
    

    Parameters

    • startingNoteNumber: number = 33

      the lowest midi note number note in the scale. The default value, midi note number 33 has fundamental frequency 55hz. setting startingNoteNumber to an 'A' in any octave will align the the letter keys with their respective harmonic notes, so you can use 'B' or 'b' to indicate a musical 'b' note, 'c' or 'C' to indicate a musical c note (and so on).

    Returns tLibrary

Const stringsToNoteNumbers

  • stringsToNoteNumbers(arrayOrNum: any): any
  • Accept a deeply nested array of strings, and return a new deep array of midi note numbers. String arrays can be easier to read than number arrays:

    const chord = ['e4', 'a4', 'b4', 'c#5'];
    

    Only works with Arrays of strings, not Objects. Objects are output unchanged.

    Parameters

    • arrayOrNum: any

    Returns any