Class: Note

Note()

Encapsulates each note in the music composed of the string part of the note, octave, duration in alphaTex, set of beateffects, set of noteeffects

Constructor

new Note()

Creates a new Note
Source:

Methods

addBeatEffect(effect)

Adds beat effect to set
Parameters:
Name Type Description
effect string effect to be added
Source:

containsBeatEffect(effect) → {boolean}

Checks if beateffects contains the effect
Parameters:
Name Type Description
effect string String of effect to check for
Source:
Returns:
boolean if the effect is in the set of beat effects
Type
boolean

copyBeatEffects(source)

Copies beat effects from source
Parameters:
Name Type Description
source object Source must have getInt, getStr, attributesBool
Properties:
Name Type Description
source.getInt function Provides a number matched with the provided String else undefined
source.getStr function Provides a String matched with the provided String else undefined
source.attributesBool Set Set with String attributes
Source:

getDurationInSeconds(currentTempoFactor) → {number}

Gets the duration in seconds of the stored note
Parameters:
Name Type Description
currentTempoFactor number the current tempo factor affecting the length of the note
Source:
Returns:
The duration in seconds
Type
number

getMidiValue() → {number}

Calculates and returns the midi value of the stored string representation of the note with the stored octave
Source:
Returns:
The midi value of the stored note or -1 if no octave
Type
number

getNoteOffset() → {number}

Gets offset of note from base value based on string part stored in this.note
Source:
Returns:
The offset of the note
Type
number

setDuration(duration)

Sets duration of the note based on alphaTex
Parameters:
Name Type Description
duration number duration of the note in alphatex (1,2,4,8,16, etc.)
Source:

setNote(note)

Sets the string part of the note
Parameters:
Name Type Description
note string string part of a note including sharps (#) and flats (b)
Source:

setOctave(octave)

Sets the octave of the note
Parameters:
Name Type Description
octave number octave of the note to be set
Source:

toString() → {string}

Converts Note to a pretty string
Source:
Returns:
The pretty string representation of the note
Type
string