Returns the amount of time (in milleseconds) that a button takes to transition from it's boosted size and color to it's regular held values when it's activated.
Sets the amount of time (in milleseconds) that a button takes to transition from it's boosted size and color to it's regular held values when it's activated.
Value must be a positive number.
Returns the amount of buttons in each column.
Returns the amount of buttons in each row.
Returns the isFadeToBackground flag, which if true, fades buttons immediately to the idle color rather than holding.
Sets the isFadeToBackground flag.
Set this property to true if you want to represent MIDI notes without sustain, typically on percussive instruments.
Note that notes will immediately render as inactive if the note duration is shorter than the boost threshold, as it cannot track notes that aren't currently being played.
Returns the width (in pixels) of an individual drum pad.
Returns the width (in pixels) for the ring that separates the core of each button from the edge.
Returns the root note -- the lowest note that can be read.
Returns the amount (in pixels) that the buttons increase when hit.
Sets the amount (in pixels) that the buttons increase when hit.
Value must be greater or equal to zero. Setting this value to zero means that the buttons never change in size.
Returns the width (in pixels) for the border that is inbetween the core of the button and the ring around it.
Called by the rendering engine on every frame.
When overriding this method, ensure that the p5 instance is configured properly. For example, rectangles may be drawn incorrectly if a previous CanvasDrawer had modified p5.rectMode(). CanvasDrawer classes are not obligated/expected to use the default p5 attributes.
See the p5 documentation on attributes for more information: https://p5js.org/reference/#Attributes
Calculates and returns the pixel height of the grid.
Calculates and returns the pixel width of the grid.
Invoked by the rendering engine to generate a frame.
DrumPadGrid generates a grid of square buttons, meant to represent the soft rectangular pads you would see on a MIDI controller.