Class: PatternModel

MusicXMLAnalyzer. PatternModel

new PatternModel()

Source:

Methods

<inner> addNoteElement()

This method adds notes and breaks to the noteElements Array and the noteElements4VexFlow Array
Source:

<inner> addNoteElementByCanvasClick(note)

This method gets called when your click on the canvas to add a note element. The paramter note looks like "c/4". It updates the model values curName and curOctave and calls addNoteElement.
Parameters:
Name Type Description
note string name in vexflow style like "c/4"
Source:

<inner> emptyNoteArrays()

This method empties the notes arrays and sets the val first to true.
Source:

<inner> getAllNoteElements() → {Array.<Notes>}

Returns an array with Note Elements
Source:
Returns:
array of Note Elements
Type
Array.<Notes>

<inner> getAllVexFlowNoteElements() → {Array.<vexflowNotes>}

Returns an array wtih vexflow notes elements
Source:
Returns:
array of vexflowNotes
Type
Array.<vexflowNotes>

<inner> getBeamArray() → {Array.<number>}

Returns an Array with beam end positions
Source:
Returns:
Array with beam end positions
Type
Array.<number>

<inner> getCurrentAccidential() → {string}

Returns the current accidential
Source:
Returns:
The current accidential
Type
string

<inner> getCurrentMode() → {number}

Returns the current mode
Source:
Returns:
The current mode
Type
number

<inner> getCurrentNoteDuration() → {string}

Returns the current note duration
Source:
Returns:
The current note duration
Type
string

<inner> getCurrentNoteName() → {string}

Returns the current note name
Source:
Returns:
The current note name
Type
string

<inner> getCurrentNoteRythSpecial() → {string}

Returns the current rhythmic special which can be a dot or triplet
Source:
Returns:
The current rhythmic special
Type
string

<inner> getCurrentOctave() → {string}

Returns the current octave
Source:
Returns:
The current octave
Type
string

<inner> getDuration4Vexflow() → {string}

Returns the duration label which is used by vexflow
Source:
Returns:
duration for vexflow
Type
string

<inner> getKeyContent4Vexflow() → {string}

Returns the content of a vexflow key
Source:
Returns:
content of vexflow key
Type
string

<inner> getPatternLength() → {number}

Returns the length of the noteElements Array
Source:
Returns:
length of noteElements Array
Type
number

<inner> getTripletEndPositions() → {Array.<number>}

Returns an Array with triplet end positions
Source:
Returns:
Array with trilet end positions
Type
Array.<number>

<inner> getTupletArray() → {Array.<number>}

Returns an Array with tuplet end positions
Source:
Returns:
Array with tuplet end positions
Type
Array.<number>

<inner> init()

Init method of PatternModel
Source:

<inner> removeLastNoteElement()

Removes last added note element from noteElementsArray and vexflowArray.
Source:

<inner> setCurrentAccidential(the)

Sets the current accidential
Parameters:
Name Type Description
the string current accidential
Source:

<inner> setCurrentMode(the)

Calls method to set the current Mode active
Parameters:
Name Type Description
the number current mode as number 0 (sound sequence), number 1 (rhythm) and number 2 (melody)
Source:

<inner> setCurrentNoteDuration(the)

Sets the current note duration
Parameters:
Name Type Description
the string current note duration
Source:

<inner> setCurrentNoteName(the)

Sets the current note name
Parameters:
Name Type Description
the string current note name
Source:

<inner> setCurrentNoteRythSpecial(the)

Sets the current rhythmic special
Parameters:
Name Type Description
the string current rhythmic special
Source:

<inner> setCurrentOctave(the)

Sets the current octave
Parameters:
Name Type Description
the string current octave
Source:

<inner> setDefaultValsForMelodyMode()

Sets the default values when you change to melody mode
Source:

<inner> setDefaultValsForRhythmMode()

Sets the default values when you change to rhythm mode
Source:

<inner> setDefaultValsForSoundSequenceMode()

Sets the default values when you change to sound sequence mode
Source:

<inner> setValuesForNoteElement()

This method sets vals for accidentials, dots and beams for noteElements-Array
Source: