Class: Measure

Measure()

Class representation of a measure

Constructor

new Measure()

Source:

Extends

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:

addConnector(stave1:, stave2:, type:)

Adds a connector between two staves
Parameters:
Name Type Description
stave1: Stave First stave
stave2: Stave Second stave
type: Flow.StaveConnector.type Type of connector
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

getNotesByStaff(Number) → {Note}

Get all the notes belonging to the given staff. The staff number can be retrieved from getStaves
Parameters:
Name Type Description
Number Number of the staff.
Source:
See:
  • getStaves
Returns:
A Note class object
Type
Note

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

getStaves() → {Number}

Get the unique numbers of all staves in this measure
Source:
Returns:
Staves in this measure
Type
Number

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

hasAttributes() → {Boolean}

Check if this Measure has Attributes
Deprecated:
  • since version 0.2 every measure has attributes.
Source:
Returns:
Indicates if the measure has Attributes
Type
Boolean

isFirst()

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