Skip to content

array

Converts an input into an array, optionally creating it.

If the array does not exist, it is created. Otherwise, the data is just copied into the array.

Syntax

array(arg:a)
array(arg1:k, arg2:k, ...)
array(arg1:i, arg2:i, ...)

The a-type version produces an array with ksmps numbers. The other versions produce an array with as many numbers as their inputs.

Examples

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

Example of the array opcode.
<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
ksmps = 64
nchnls = 1
0dbfs = 1

instr 1
 Params:i[] = array(p4, p5)
 Audio:k[] = array(oscili(Params[0],Params[1]))
 out a(Audio)
endin
schedule(1,0,2,0.5,440)
event_i("e",0,2)

</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>

See also

array opcodes

Credits

Author: John ffitch, Victor Lazzarini
a-sig version introduced in version 7.