Event Sequencer

The eventsequencer widget is an event based sequencer that can be used to send score events to Csound. Each cell in the matrix represents a score event that will be sent to Csound. The associated "channel" sets the current position of the steps and is controlled by Csound using the chnset opcode.

eventsequencer celldata(xVal, yVal, "string"), cellheight(val), cellwidth(val), colprefix(row, "prefix"), orientation("val"), rowprefix(row, "prefix"), shownumbers(val), matrixsize(rows, cols), active(val), alpha(val), bounds(x, y, width, height), channel("chan"), colour("colour"), fontcolour("colour"), fontcolour("colour"), identchannel("channel"), rotate(radians, pivotx, pivoty), tofront(), visible(val),

Specific Identifiers

celldata(xVal, yVal, "string") Sets the contents of a cell. The first two values set the actual cell in terms of coordinates, while the 3rd parameter sets the contents of the cell. This identifier is best called within Csound using an identchannel. In order to pass inverted commas to cell data from Csound you will need to use several preceding backslashes. For example:

SScoreEvent sprintf "i \\\"Sine\\\" 0 1 %d", random(0, 100)
SMessage sprintf "celldata(%d, %d, \"%s\") ", iColCnt, iRowCnt, SScoreEvent 
chnset SScoreEvent, "eventseqIdent"

cellheight(val) Sets the height of a cell in a string sequencer. A value of 0 (the default is 20), will cause Cabbage to automatically resize each cell's height to fit the bounds of the sequencer.

cellwidth(val) Sets the width of a cell in a string sequencer. A value of 0 (the default), will cause Cabbage to automatically resize each cell's width to fit the bounds of the sequencer.

colprefix(row, "prefix") Will append "val" to all score events for the given column (column indices start at 0). These prefixes will not be seen in the matrix cells, but will be sent to Csound. This can be useful if you wish to free up and avoid text duplication in each cell. If you wish to set more than one column at a time, you may use a ':' between numbers, with no whitespace, e.g, colprefix(0:1:2:3, "i1 0 1")

Note you should never need to use both a colprefix()and a rowprefix(). Using both at the same time will only lead to inconsistent and erratic behaviour. Also note that in order to use inverted commas, you will need to use a preceding '/', e.g, colprefix(0:1:2:3, "i\"Sine\" 0")

orientation("val") Will set whether the eventsequencer widget moves scrubers from top to bottom(default), or left to right. "val" can be "vertical", or "horizontal"

rowprefix(row, "prefix") Will append "val" to all score events for the given row (row indices start at 0). These prefixes will not be seen in the matrix cells, but will be sent to Csound. This can be useful if you wish to free up and avoid text duplication in each cell. If you wish to set more than one row at a time, you may use a ':' between numbers, with no whitespace, e.g, rowprefix(0:1:2:3, "i1 0 1")

Note you should never need to use both a colprefix()and a rowprefix(). Using both at the same time will only lead to inconsistent and erratic behaviour. Also note that in order to use inverted commas, you will need to use a preceding '/', e.g, rowprefix(0:1:2:3, "i\"Sine\" 0")

shownumbers(val) A number great than 1 will show step numbers in a string sequencer. Note that each Nth number will be shown in bold. This can be used to highlight the start of each bar. If the number passed to shownumbers() match the total number of steps, all numbers will appear in the same font style.

matrixsize(rows, cols) Sets the number of cells in a matrix

Common Identifiers

active(val) Will deactivate a control if 0 is passed. Controls which are deactivate can still be updated from Csound.

alpha(val) A value between 0 and 1 will set the alpha blend value for the entire component. Can be useful if you need to fade widgets in and out.

bounds(x, y, width, height) integer values that set position and size on screen(in pixels).

channel("chan") "chan" is the name of the channel that Cabbage will communicate with Csound on. The current value of this widget can be retrieved in Csound using a chnget opcode, or can be set using a chnset opcode.

colour("colour") This sets the main colour. Any CSS or HTML colour string can be passed to this identifier. The colour identifier can also be passed an RBG, or RGBA value. All channel values must be between 0 and 255. For instance colour(0, 0, 255) will create a blue, while colour(0, 255, 0, 255) will create a green with an alpha channel set to full.

fontcolour("colour") Sets the colour of the font. In the case of slider this sets teh colour of the font in the value textbox if it is shown.

fontcolour("colour") Sets the colour of the font. In the case of slider this sets teh colour of the font in the value textbox if it is shown.

<!--UPDATE WIDGETINCSOUND SIdent sprintf "fontcolour(%d, %d, %d) ", rnd(255), rnd(255), rnd(255) SIdentifier strcat SIdentifier, SIdent
--> In the case of a eventsequencer it will determine the colour of the numbers corresponding to each step.

identchannel("channel") Sets the channel which data is sent and retrieved from Csound. When used with a chnset opcode users can override widget attributes. See Identifier channels

rotate(radians, pivotx, pivoty) Rotates the widget by a number of radians(2xPI=full rotation). pivotx and pivoty will determine the rotation pivot points, where 0, 0 represents the component's top-left position.

tofront() Brings a widget to the front of the z order. This identifier takses no arguments and is only intended for use with identifier channels.

visible(val) A value of 0 will cause the widget to become invisible. Widgets have their visibility set to 1 by default.

Example

<Cabbage>
form caption("String Sequencer") size(400, 400), pluginID("def1")
stringsequencer bounds(10, 10, 300, 320), channels("step", "track1", "track2", "track3", "track4"), active(0), identchannel("trackerIdent"), textcolour(200, 200, 200), highlightcolour(60, 60, 60) outlinecolour(80,80,80), bpm(180), fontcolour("white") backgroundcolour(20, 20, 20) showstepnumbers(4), numberofsteps(16)
rslider bounds(314, 10, 70, 70) channel("bpm") range(10, 300, 180, 1, 0.001) text("BPM") 
button bounds(314, 82, 70, 27) channel("startStop") text("Start", "Stop") 
rslider bounds(316, 112, 70, 70) channel("position") range(0, 15, 0, 1, 1) 
</Cabbage>