trigseq
Accepts a trigger signal as input and outputs a group of values.
Syntax
Performance
ktrig_in -- input trigger signal
kstart -- start index of looped section
kloop -- end index of looped section
kinitndx -- initial index
Note
Although kinitndx is listed as k-rate, it is in fact accessed only at init-time. So if you are using a k-rate argument, it must be assigned with init.
kfn_values -- number of a table containing a sequence of groups of values
kout1 -- output values
kout2, ... (optional) -- more output values
This opcode handles timed-sequences of groups of values stored into a table.
trigseq accepts a trigger signal (ktrig_in) as input and outputs group of values (contained in the kfn_values table) each time ktrig_in assumes a non-zero value. Each time a group of values is triggered, table pointer is advanced of a number of positions corresponding to the number of group-elements, in order to point to the next group of values. The number of elements of groups is determined by the number of koutX arguments.
It is possible to start the sequence from a value different than the first, by assigning to kinitndx an index different than zero (which corresponds to the first value of the table). Normally the sequence is looped, and the start and end of loop can be adjusted by modifying kstart and kloop arguments. User must be sure that values of these arguments (as well as kinitndx) correspond to valid table numbers, otherwise Csound will crash because no range-checking is implemented.
It is possible to disable loop (one-shot mode) by assigning the same value both to kstart and kloop arguments. In this case, the last read element will be the one corresponding to the value of such arguments. Table can be read backward by assigning a negative kloop value.
trigseq is designed to be used together with seqtime or trigger opcodes.
Examples
Here is an example of the trigseq opcode. It uses the file trigseq.csd.
Example of the trigseq opcode. | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
See also
Sensing and Control: Tempo and Sequencing
Credits
Author: Gabriel Maldonado
November 2002. Added a note about the kinitndx parameter, thanks to Rasmus Ekman.
January 2003. Thanks to a note from Øyvind Brandtsegg, I corrected the credits.
New in version 4.06