oscil1
Prev | Orchestra Opcodes and Operators | Next

## 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 zero or negative value will cause all initialization to be skipped.

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 585. 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 oscil1i.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    instr     1

    ipanfn = p4
    asig   vco2 .3, 220
    kpan   oscil1i 0, 1, p3, ipanfn	;create panning &
    kleft  = sqrt(kpan)		;start right away
    kright = sqrt(1-kpan)
           outs kleft*asig, kright*asig

    endin
    </CsInstruments>
    <CsScore>

    f 1 0  3 -7 .5  3  .5		;remain in center (.5 CONSTANT)
    f 2 0 129 7  1 129 0 		;left-->right
    f 3 0 129 7 .5  32 1 64 0 33 .5 ;center-->left-->right-->center

    i 1  0  2  1			;use table 1
    i 1  3  2  2			;use table 2
    i 1  6  2  3			;use table 3

    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, tablei, table3, oscil1i, osciln

Prev | Up | Next
oscbnk | Home | oscil1i