String Sequencer
The stringsequencer widget is string based sequencer that can be used to send strings to Csound at a particular BPM. It takes the style of an old-school tracker, but can be adapted to a wide range of uses. The "channel" identifier takes at least 2 strings. The first will be a channel that transmits the current beat number to Csound. This is a bi-directional channel that users can send data to the widget on. For example, users may wish to set the current beat at some point. The next channels represent the tracks that appear in the widget, from left to right. Details of this widget's identifiers are given below.
stringsequencer bounds(x, y, width, height), channel("beatChan", "chan1", "chan2", "chan3"),
colour("colour"), fontcolour("colour"), bpm(val), numberofsteps(val), shownumbers(val), cellwidth(val),
cellheight(val), identchannel("channel"), alpha(val), visible(val), text("Track1", "Track2", "Track3")
rotate(radians, pivotx, pivoty), active(val)
Identifiers
Specific Identifiers
bpm(val)
Sets the current BPM.
numberofsteps(val)
Sets the number of steps, or rows in a string sequencer.
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.
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.
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.
bpm(val)
Sets the current BPM.
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 stringsequencer 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.
text("string")
"string" will be the text that appears on the widget. button
widgets take two strings, one for on and one for off.
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 size(400, 500), caption("Untitled"), pluginID("plu1"), colour(39, 40, 34)
button bounds(20, 16, 100, 30), channel("button"), text("Push me"), fontcolour("white")
infobutton bounds(120, 16, 100, 30), channel("button"), file("README.txt"), text("Info")
filebutton bounds(220, 16, 100, 30), channel("button"), populate("*.wav", ""), text("Browse")
</Cabbage>