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") or channel("chan1", "chan2") in the case of widgets that accept two channels such as xypad, soundfiler and range widgets. channel() accepts a string/s that names the channel/s that Cabbage will communicate with Csound on. The current value of this widget can be retrieved in Csound using a chnget, or a cabbageGetValue opcode. Its value can be set using the cabbageSet, or cabbageSetValue opcodes. hrange, vrange, xypad, and soundfiler all take two channels:

hrange, vrange : channel("min", "max") - min and max values

xypad : channel("x", "y") - x and y values

soundfiler : channel("start", "length") - start time and length of user selection, in samples

Channels named should start with a letter and cannot have any white spaces. Note that all widgets should have a unique channel name.


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") [!!! DEPRECATED !!!] Although identifier channels still work, they are no longer supported. Please use the new guiMode("queue") system and the cabbageGet and cabbageSet opcodes instead. They are far more efficient then identifiers channel.


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 takes no arguments and is only intended for use within the Csound orchestra. it makes no sense to call it when declaring the widget.


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>