shiftout
Prev | Orchestra Opcodes and Operators | Next

## shiftout

shiftout — Shifts the contents of a 1-dimensional array into an audio variable.

## Description

This opcode can be used to push data to an audio variable from a 1-dimensional array. The array needs to be at least ksmps numbers long, but can be longer. Data is shifted out circularly, with the writing position moving by ksmps positions every k-cycle. When the array gets emptied, the writing position wraps around to the beginning of the array again. Together with the shiftin opcode, it can form a FIFO queue.

## Syntax

    asig shiftout kIn[][, ioff]

## Initialization

ioff -- initial read offset position (optional, defaults to 0).

## Performance

kin[] -- input array, needs to be at least ksmps numbers long.

asig -- output audio

## Examples

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

Example 940. Example of the shiftout opcode.

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

    <CsoundSynthesizer>
    <CsOptions>
    -d -odac
    </CsOptions>
    <CsInstruments>

    instr 1
    ideltime = 0.5
    kDel[] init sr*0.5
    a1 diskin2 "fox.wav",1,0,1
    a2 shiftout kDel
    kDel shiftin a1
         out a1 + a2
    endin

    </CsInstruments>
    <CsScore>
    i1 0 10
    </CsScore>
    </CsoundSynthesizer>

## See Also

Vectorial opcodes, array opcodes

## Credits

Author: Victor Lazzarini
NUI Maynooth
2014

New in version 6.04

Prev | Up | Next
shiftin | Home | signum