splitrigInstrument Control:Sensing and Controlsplitrigsplitrig
Split a trigger signal
Descriptionsplitrig splits a trigger signal (i.e. a timed sequence of control-rate impulses) into several channels following a structure designed by the user.
Syntaxsplitrig ktrig, kndx, imaxtics, ifn, kout1 [,kout2,...,koutN]Initializationimaxtics - number of tics belonging to largest pattern
ifn - number of table containing channel-data structuring
Performanceasig - incoming (input) signal
ktrig - trigger signal
The splitrig opcode splits a trigger signal into several output channels according to one or more patterns provided by the user. Normally the regular timed trigger signal generated by metro opcode is used to be transformed into rhythmic pattern that can trig several independent melodies or percussion riffs. But you can also start from non-isocronous trigger signals. This allows to use some "interpretative" and less "mechanic" groove variations.
Patterns are looped and each numtics_of_pattern_N the cycle is repeated.
The scheme of patterns is defined by the user and is stored into ifn table according to the following format:
This scheme can contain more than one pattern, each one with a
different number of rows. Each pattern is preceded by a a special row
containing a single numtics_of_pattern_N field;
this field expresses the number of tics that makes up the
corresponding pattern. Each pattern's row makes up a tic. Each
pattern's column corresponds to a channel, and each field of a row is
a number that makes up the value outputted by the corresponding
koutXX channel (if number is a zero,
corresponding output channel will not trigger anything in that
particular arguments). Obviously, all rows must contain the same
number of fields that must be equal to the number of
koutXX channel. All patterns must contain the
same number of rows, this number must be equal to the largest pattern
and is defined by imaxtics variable. Even if a
pattern has less tics than the largest pattern, it must be made up of
the same number of rows, in this case, some of these rows, at the end
of the pattern itself, will not be used (and can be set to any value,
because it does not matter).
The kndx variable chooses the number of the pattern to be played, zero indicating the first pattern. Each time the integer part of kndx changes, tic counter is reset to zero.
Patterns are looped and each numtics_of_pattern_N the cycle is repeated.
examples
4 - calculate average value of asig in the time interval
This opcode can be useful in several situations, for example to implement a vu-meter
Examples
Here is an example of splitrig opcode. It uses the file splitrig.csd.
Example of the splitrig opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.See alsoSensing and Control: Tempo and SequencingCreditsWritten by &namegabriel;.New in Csound 5 (Previously available only on CsoundAV)