Class: Note

Note(node, divisions)

Class representation of a Note

Constructor

new Note(node, divisions)

Create a note from an XML node
Parameters:
Name Type Description
node NodeObject the XML Node representing the note
divisions Number The divisions entry from the measure node
Source:

Extends

Members

BeamState

The notes beam state. It indicates if a beam starts or ends here
Properties:
Name Type Description
Note.Beam Array is an array of beams. They can be 'begin', 'end', 'continue' or 'none'
Source:

Duration

The duration of the note
Properties:
Name Type Description
Note.Duration Number
Source:

isInChord

Shows if this note is part of a chord
Properties:
Name Type Description
Note.isInChord Boolean
Source:

isLast

Shows if this Note is before a backup element or the last in the measure
Properties:
Name Type Description
Note.isLast Boolean
Source:

isLastBeamNote

Indicates if this is the last not in a beam.
Properties:
Name Type Description
Note.isLastBeamNote Boolean is an boolean that indicates the last not in a beam
Source:

isRest

Shows if this note is a rest
Properties:
Name Type Description
Note.isRest Boolean
Source:

isUnpitched

Percussion notes don't have absolute values and are called "unpitched"
Source:

mAttributes

Private property to store attributes before this note
Properties:
Name Type Description
Note.mAttributes Number
Source:

mDivisions

Private property to store measures divions units
Properties:
Name Type Description
Note.mDivisions Number
Source:

NoteLength

The note's length. It is defined by the duration divided by the divisions in this measure.
Source:

Pitch

The notes pitch. It is defined by a step and the octave.
Properties:
Name Type Description
.Step: Object Step inside octave .Octave: Octave of the note
Source:

Stem

The notes stem direction (up, down)
Properties:
Name Type Description
Note.Stem String
Source:

Type

The notes type of representation (8th, whole, ...)
Properties:
Name Type Description
Note.Type String
Source:

Voice

The note's voice number
Source:

Methods

accept(visitor)

Methods to hook in converters that can use this XML type for formatting
Parameters:
Name Type Description
visitor Visitor that converts XML to other formats
Inherited From:
Source:

childExists(name) → {bool}

childExists - Check if a child exists
Parameters:
Name Type Description
name string The tag name of the child
Inherited From:
Source:
Returns:
true if child exists, false otherwise
Type
bool

getAttribute(name) → {string}

getAttribute - Gets a string representation of an attribute
Parameters:
Name Type Description
name string Attribute name
Inherited From:
Source:
Returns:
Attribute value
Type
string

getChild(name) → {DOMNode}

getChild - Gets a (usally the first) child by its tag name
Parameters:
Name Type Description
name string The tag name of the child
Inherited From:
Source:
Returns:
DOM node representation of the child
Type
DOMNode

getChildren(name) → {DOMNodeList}

getChildren - Gets all children by its tag name
Parameters:
Name Type Description
name string The tag name of the child. If empty all children will be given
Inherited From:
Source:
Returns:
DOM node list representation of the children
Type
DOMNodeList

getNum(name) → {float}

getNum - Get the numeric representation of the node. Will return NaN if failed
Parameters:
Name Type Description
name string The tag name of the child
Inherited From:
Source:
Returns:
Value of the node
Type
float

getSiblings(name) → {DOMNodeList}

getSiblings - Gets all siblings by its tag name
Parameters:
Name Type Description
name string The tag name of the sibling.
Inherited From:
Source:
Returns:
DOM node list representation of the children
Type
DOMNodeList

getText(name) → {string}

getText - Get the string representation of a node's text content
Parameters:
Name Type Description
name string The tag name of the child
Inherited From:
Source:
Returns:
string of the text content
Type
string

getTextArray(name) → {Arrray}

getTextArray - Get the strings of the given child tags as array instead of string
Parameters:
Name Type Description
name string The tag name of the child
Inherited From:
Source:
Returns:
string array of the text content
Type
Arrray

isFirst()

Check if this element is the first in the tag
Inherited From:
Source: