seqtime

seqtime — Generates a trigger signal according to the values stored in a table.

Description

Generates a trigger signal according to the values stored in a table.

Syntax

ktrig_out seqtime ktime_unit, kstart, kloop, kinitndx, kfn_times

Performance

ktrig_out -- output trigger signal

ktime_unit -- unit of measure of time, related to seconds.

kstart -- start index of looped section

kloop -- end index of looped section

kinitndx -- initial index

[Note] 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_times -- number of table containing a sequence of times

This opcode handles timed-sequences of groups of values stored into a table.

seqtime generates a trigger signal (a sequence of impulses, see also trigger opcode), according to the values stored in the kfn_times table. This table should contain a series of delta-times (i.e. times beetween to adjacent events). The time units stored into table are expressed in seconds, but can be rescaled by means of ktime_unit argument. The table can be filled with GEN02 or by means of an external text-file containing numbers, with GEN23.

It is possible to start the sequence from a value different than the first, by assigning to initndx 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 initndx) correspond to valid table numbers, otherwise Csound will crash (because no range-checking is implementeted).

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. It is possible to trigger two events almost at the same time (actually separated by a k-cycle) by giving a zero value to the corresponding delta-time. First element contained in the table should be zero, if the user intends to send a trigger impulse, it should come immediately after the orchestra instrument containing seqtime opcode.

Examples

Example 355. Example of the seqtime opcode.

        instr   1
icps    cpsmidi
iamp    ampmidi 5000
ktrig   seqtime 1,       1,          10,      0,   1
trigseq ktrig, 0, 10, 0, 2, kdur, kampratio, kfreqratio
        schedkwhen      ktrig, -1, -1, 2, 0, kdur, kampratio*iamp, kfreqratio*icps
        endin


        instr  2
**** put here your intrument code *******
        out     a1
        endin
        

See Also

GEN02, GEN23, trigseq seqtime2

Credits

Author: Gabriel Maldonado

November 2002. Added a note about the kinitndx parameter, thanks to Rasmus Ekman.

New in version 4.06