Constructor
# new Drawer(topLine, distanceBetweenLines)
Creates a new Drawer setting up storage of the most recent midi note and information about how to draw it on the screen
Parameters:
Name | Type | Description |
---|---|---|
topLine |
Number | Height of the top line of the selected part to sing |
distanceBetweenLines |
Number | Distance between lines in the staff |
Methods
# getExtraFeatures()
Gets the extra features of a note including how many ledger lines to add
# getHeightOfNote()
Updates the height of the note based on its midi value
# setBaseOctave(baseOctave)
Sets the base octave
Parameters:
Name | Type | Description |
---|---|---|
baseOctave |
number | The base octave of the current clef |
# setTopLineAndDistanceBetween(topLine, distanceBetweenLines, baseOctave)
Sets the stored height of the top line, the distance between ledger lines, and the base octave
Parameters:
Name | Type | Description |
---|---|---|
topLine |
number | The height of the top ledger line |
distanceBetweenLines |
number | The y distance between ledger lines |
baseOctave |
number | The base octave of the current clef |
# updateNote(note)
Updates the Drawer to the new provided note
Parameters:
Name | Type | Description |
---|---|---|
note |
Number | New midi value to store. Provide a -1 as a sentinel value for silence |
Type Definitions
object
# NotePackage
Properties:
Name | Type | Description |
---|---|---|
charPart |
string | The character part of the note |
octave |
number | The octave of the note |