oscil1

oscil1 — Accesses table values by incremental sampling.

Description

Accesses table values by incremental sampling.

Syntax

kres oscil1 idel, kamp, idur [, ifn]

Initialization

idel -- delay in seconds before oscil1 incremental sampling begins.

idur -- duration in seconds to sample through the oscil1 table just once. A negative value will make the table be read from the end to the beginning.

ifn -- (optional) function table number. tablei, oscil1i require the extended guard point. The number defaults to -1 which indicates a sinewave.

Performance

kamp -- amplitude factor.

oscil1 accesses values by sampling once through the function table at a rate determined by idur. For the first idel seconds, the point of scan will reside at the first location of the table; it will then begin moving through the table at a constant rate, reaching the end in another idur seconds; from that time on (i.e. after idel + idur seconds) it will remain pointing at the last location. Each value obtained from sampling is then multiplied by an amplitude factor kamp before being written into the result.

Examples

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

Example 686. Example of the oscil1 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 oscil1.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

giPan ftgen 0, 0, 8, -2, .5, .2, .8, .1, .9, 0, 1, .5

instr     1   

istay = 2 ;how many seconds to stay on the first table value
asig   vco2 .3, 220
kpan   oscil1 istay, 1, p3-istay, giPan ;create panning 
       printk2 kpan ;print when new value
aL, aR pan2 asig, kpan ;apply panning
       outs aL, aR

endin
</CsInstruments>
<CsScore>                                                                                  
i 1  0  10
e
</CsScore>
</CsoundSynthesizer>


The example will produce the following output:

 i1     0.50000
 i1     0.20000
 i1     0.80000
 i1     0.10000
 i1     0.90000
 i1     0.00000
 i1     1.00000
 i1     0.50000
      

See Also

Table Access