GMDuoSequencer:
Filter:
GraphicalModule/Classes (extension) | GUI > Graphical Module

GMDuoSequencer
ExtensionExtension

A simple deterministic sequencer for creating graphical interfaces

Description

GMDuoSequencer is an extension of the GMSequencer class. It allows to setup probabilistic rythms in conjonction with the coin method.

One must provide a set of different probabilities for the sound to be played. The widget allows to cycle through those probabilities for each individual beat. For example, [0, 0.25, 0.5, 0.75, 1] would allow to select a probability of 0%, 25%, 50%, 75% or 100% for a particular beat to be played.

The widget is divided in half vertically. Clicking on the upper side will set the probabilty to the last if it is not the last already, in which case it will be set to the first probability. This allows the top side of the widget to behave like a deterministic sequencer. Clicking the bottom side of the widget will increment the probabilty to the next index, or revert to the second one if the probability is the last.

Class Methods

.new

Creates a new instance of GMDuoSequencer.

Its graphical properties are defined by its associated GMStyle.

Returns:

a GMDuoSequencer instance.

Instance Methods

.probabilities

Sets or gets the probabilities the sequencer will cycle through. Takes an Array of Float as argument.

.action

Sets or gets the Function that will be evaluated when the GMDuoSequencer has been interacted with. The arguments passed to the function depend on the actionMode.

.actionMode

Sets or gets which arguments are passed to the action's Function when the GMDuoSequencer has been interacted with. If set to \values, the associated Array will be passed as argument. If set to \index, the index of the modified value and the new value will be passed as arguments.

.values

Sets or gets the sequencer values. Takes an Array containing only 0 or 1 as argument. The size of the array determines the size of the sequencer (i.e. the number of checkboxes).

.beat

Sets or gets the displayed beat. Set to -1 to disable. This will internally defer the graphical update.

.highlights

Sets or gets the policy that highlights checkboxes. 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 larger and opaque the highlight will be.

.drawHighlights

Sets or gets wether the highlights should be displayed.

.symbol

Sets or gets the shape of the symbol used to display checked indices. Can either be \circle, \square, or \diamond.

.symbolRatio

Sets or gets the ratio of the symbol relative to the case size where it is displayed. Valid values are between 0 and 1.

.allowMouseMoveAction

Sets or gets whether the widget should respond to mouse move action when it is being pressed.

Internal Methods

.draw

Examples