Class

Drawer

Drawer(topLine, distanceBetweenLines)

Keeps track of current note and where to draw it on the screen along with special information such as number of extra ledger lines

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
Author:

View Source vendors/P5/Drawer.js, line 16

Methods

# getExtraFeatures()

Gets the extra features of a note including how many ledger lines to add

View Source vendors/P5/Drawer.js, line 95

# getHeightOfNote()

Updates the height of the note based on its midi value

View Source vendors/P5/Drawer.js, line 70

# setBaseOctave(baseOctave)

Sets the base octave
Parameters:
Name Type Description
baseOctave number The base octave of the current clef

View Source vendors/P5/Drawer.js, line 53

# 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

View Source vendors/P5/Drawer.js, line 39

# 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

View Source vendors/P5/Drawer.js, line 61

Type Definitions

object

# NotePackage

Properties:
Name Type Description
charPart string The character part of the note
octave number The octave of the note

View Source vendors/P5/Drawer.js, line 185