note library

Constants

LETTERS → const String
"CDEFGAB"

Properties

altToAcc → dynamic Function([num alt])
Given an alteration number, return the accidentals
final
build → dynamic
Deprecated. This is kept for backwards compatibility only. Use Note.from instead
final
chroma → dynamic Function(dynamic str)
Return the chroma of a note. The chroma is the numeric equivalent to the pitch class, where 0 is C, 1 is C# or Db, 2 is D... 11 is B
final
enharmonic → dynamic Function(dynamic note)
Get the simplified and enhramonic note of the given one.
final
fillStr String Function(String s, num n)
final
FLATS List
final
freq → dynamic Function(dynamic note)
Get the frequency of a note
final
freqToMidi double Function(num freq)
Get the midi number from a frequency in hertz. The midi number can contain decimals (with two digits precission)
final
from → dynamic
Creates a note name in scientific notation from note properties, and optionally another note name. It receives an object with:
final
isMidiRange bool Function(dynamic m)
final
L2 double
final
L440 double
final
memo → dynamic Function([dynamic str]) Function([dynamic fn, Map cache])
final
midi → dynamic Function(dynamic note)
Get the note midi number. It always return a number between 0 and 127
final
midiToFreq num Function(dynamic midi, [dynamic tuning = 440])
Get the frequency from midi number
final
name → dynamic Function([dynamic str])
Given a note name, return the note name or null if not valid note. The note name will ALWAYS have the letter in upercase and accidentals using # or b
final
NAMES List<String>
npm version tonal
final
names List Function([dynamic accTypes])
Get a list of note names (pitch classes) within a octave
final
NO_NOTE Map<String, Null>
final
numToStr → dynamic Function(dynamic n, dynamic op)
final
oct → dynamic Function(dynamic str)
Get the octave of the given pitch
final
pc → dynamic Function(dynamic str)
Get pitch class of a note. The note can be a string or a pitch array.
final
properties Map<String, dynamic> Function(dynamic str)
final
props → dynamic Function([dynamic str])
Get note properties. It returns an object with the following information:
final
REGEX RegExp
final
SEMI List<int>
final
SHARPS List
final
simplify → dynamic Function(dynamic note, [dynamic sameAcc = true])
Simplify the note: find an enhramonic note with less accidentals.
final
stepToLetter String Function(num step)
Given a step number return it's letter (0 = C, 1 = D, 2 = E)
final

Functions

fromMidi(dynamic n, [dynamic sharps = false]) → dynamic
Given a midi number, returns a note name. The altered notes will have flats unless explicitly set with the optional useSharps parameter.
tokenize([dynamic str]) → dynamic
Split a string into tokens related to note parts. It returns an array of strings [letter, accidental, octave, modifier]