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 abutton 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 radius (in pixels) for each button.
Sets the radius (in pixels) for each button. Value must be a positive number.
Returns the value of the gap property.
Note that this property does not refer to the actual spacing between buttons, but as internal value used for calculations.
Returns the amount of buttons in each column.
Sets the amount of buttons that appear in each column. Value must be greater than zero.
Returns the amount of buttons in each row.
Sets the amount of buttons that appear in each row. Value must be greater than zero.
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.
ButtonGrid will immediately render a note 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) for the ring that separates the core of each button from the edge.
Sets the width (in pixels) for the ring that separates the core of each button from the edge. Setting the ring thickness to a value of zero will make the button a circle.
Value must be a positive number.
Returns the root note -- the lowest note that can be read by ButtonGrid.
Sets the root note. Value must be greater than zero.
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.
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.
CircleGrid generates a grid of buttons, with each button representing a MIDI note.
The default properties for ButtonGrid are configured to emulate the design of the MIDI Fighter 64, generating an 8 by 8 grid of buttons that light up when hit.