copyf2array

copyf2array — Copy data from an f-table to a vector.

Description

The copyf2array opcode takes an f-table and copies the contents to a t-var.

Syntax

copyf2array tab, kftbl

Performance

tab -- tables for destination.

kftbl -- f-tables for source.

Example

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

Example 162. Example of the copyf2array 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

;8 points sine wave function table
giSine  ftgen   0, 0, 8, 10, 1


  instr 1
;create array
kArr[]  init    8

;copy table values in it
        copyf2array kArr, giSine
        
;print values
kndx    =       0
  until kndx == lenarray(kArr) do
        printf  "kArr[%d] = %f\n", kndx+1, kndx, kArr[kndx]
kndx    +=      1
  od

;turn instrument off
        turnoff
  endin
  
</CsInstruments>
<CsScore>
i 1 0 0.1
</CsScore>
</CsoundSynthesizer>


See Also

copya2ftab

Credits

Author: John ffitch
October 2011

New in Csound version 5.15

Renamed in Csound version 6.00