GMListPianoRoll displays a simple configurable pianoroll.
It is however limited compared to other pianoroll implementations : it can be viewed as a 2D checkbox, which manipulates a List, allowing to fill its indices with predefined values. This means that it does not have a time representation, and as such, it is not possible to offset the position of an item on the grid, and it is not possible to stretch the size of an item on the grid (like one would do to increase the sustain of a note).
One must provide a list of entries that can be checked and unchecked on every beat of the grid. Each index of the values
List will contain every checked item, or be equal to nil
if no entry has been checked.
The size of the grid is determined by both entries
and values
sizes. Please not that the first entry corresponds to the row on the bottom of the grid, and the last entry correspodns to the topmost row.
It is possible to highlight cases on both horizontal and vertical axis, and to highlight the current beat using a Routine (seee example below).
Creates a new instance of GMListPianoRoll.
Its graphical properties are defined by its associated GMStyle.
a GMListPianoRoll instance.
Sets or gets the Function that will be evaluated when the GMListPianoRoll has been interacted with. The arguments passed to the function depend on the actionMode
.
Sets or gets which arguments are passed to the action
's Function when the GMListPianoRoll has been interacted with. If set to \values
, the whole values
List will be passed as argument. If set to \index
, the index of the modified value and the new value will be passed as arguments.
Sets or gets the pianoroll values. Takes a Collection containing collections, or nil
as argument. The size of the collection determines the horizontal size of the pianoroll (i.e. the number of beats).
Sets or gets the available pianoroll entries. Takes a Collection as argument. The size of the collection determines the vertical size of the pianoroll.
Sets or gets the displayed beat. Set to -1
to disable. This will internally defer the graphical update.
Sets or gets the policy that highlights columns. Takes an Array containing floats between 0
and 1
, that should be the size of the values
. The closer the highlight is to 1
, the more opaque the highlight will be.
Sets or gets wether the horizontal highlights should be displayed.
Sets or gets the policy that highlights rows. Takes an Array containing floats between 0
and 1
, that should be the size of the entries
. The closer the highlight is to 1
, the more opaque the highlight will be.
Sets or gets wether the vertical highlights should be displayed.
Sets or gets the grid color.
Sets or gets the grid width.
Sets or gets the ratio of the checkbox relative to the case size where it is displayed. Valid values are between 0
and 1
.
Sets or gets whether the widget should respond to mouse move action when it is being pressed.