tabrec

tabrec — Recording of control signals.

Description

Records control-rate signals on trigger-temporization basis.

Syntax

tabrec   ktrig_start, ktrig_stop, knumtics, kfn, kin1 [,kin2,...,kinN]

Performance

ktrig_start -- start recording when non-zero.

ktrig_stop -- stop recording when knumtics trigger impulses are received by this input argument.

knumtics -- stop recording or reset playing pointer to zero when the number of tics defined by this argument is reached.

kfn -- table where k-rate signals are recorded.

kin1,...,kinN -- input signals to record.

The tabrec and tabplay opcodes allow to record/playback control signals on trigger-temporization basis.

tabrec opcode records a group of k-rate signals by storing them into kfn table. Each time ktrig_start is triggered, tabrec resets the table pointer to zero and begins to record. Recording phase stops after knumtics trigger impulses have been received by ktrig_stop argument.

These opcodes can be used like a sort of ``middle-term'' memory that ``remembers'' generated signals. Such memory can be used to supply generative music with a coherent iterative compositional structure.

Examples

Here is an example of the tabrec opcode. It uses the file tabrec.csd.

Example 1083. Example of the tabrec opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o oscil.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

gifn ftgen 0,0,1049576,2,0

; record control signals
instr 1
ktrig_start init    1
koct        rspline 7,10,1,2
kpan        rspline 7,10,0.1,0.9
ktrig_stop  =       1
knumtics    =       kr*p3
            tabrec  ktrig_start,ktrig_stop,knumtics,gifn,koct,kpan
ktrig_start =   0
endin

; play control signals
instr 2
koct,kpan   init    0
ktrig       init    1
knumtics    =       kr*p3
            tabplay ktrig,knumtics,gifn,koct,kpan

ktrig       =       0

asig        poscil 0.1, cpsoct(koct)
aL,aR       pan2    asig,kpan
            outs    aL,aR
endin


</CsInstruments>

<CsScore>
i1 0 10
i2 2 10
i2 4 10
e

</CsScore>

</CsoundSynthesizer>


See Also

tabplay

Credits

Written by Gabriel Maldonado.

Example written by Iain McCurdy