fillarray
Prev | Orchestra Opcodes and Operators | Next

## fillarray

fillarray — Generate a vector with initial values.

## Description

Generate a vector (one-dimensional k-rate array) with a sequence of numeric or string values.

## Syntax

    karray[] fillarray ival1, ival2,.....ivaln

    karray fillarray ival1, ival2,.....ivaln

## Initialization

ival1,...ivaln -- values to place in the vector.

In the second form the answer array must be pre-declared, and it may be a multidimensional array which if filled in row-major order.

## Examples

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

Example 267. Example of the fillarray 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
    -n
    </CsOptions>
    <CsInstruments>

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

    instr 1

      kS[] fillarray 1,7,5
           printk 0, kS[0]
           printk 0, kS[1]
           printk 0, kS[2]
      turnoff
    endin

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

## See Also

Vectorial opcodes array

## Credits

Author: John ffitch
Codemist Ltd
2013

New in version 6.00

Prev | Up | Next
filevalid | Home | fft