deinterleave

deinterleave — Deinterleaves arrays by picking alternate data from its input.

Description

Takes an input array and deinterleaves its data by choosing the data from alternate positions.

Syntax

kout1[], kout2[] deinterleave kin[]

Performance

kout1[], kout2[] -- output arrays containing the deinterleaved output. They will be created if not existent.

kin[] -- input array containing the values to be deinterleaved.

Examples

Here is an example of the deinterleave opcode. Play deinterleave.csd

Example 214. Example of the deinterleave opcode.

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

<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>


instr 1

kInt[] fillarray 1,2,3,4,5,6,7,8

kout1[],kout2[] deinterleave kInt

printf "input: \n%d %d %d %d %d %d %d %d\n", 1,
         kInt[0], kInt[1], kInt[2], kInt[3],
         kInt[4], kInt[5], kInt[6], kInt[7]


printf "de-interleaved:\n%d %d %d %d \n%d %d %d %d\n", 1,
         kout1[0], kout1[1], kout1[2], kout1[3],
         kout2[0], kout2[1], kout2[2], kout2[3]
endin

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

See Also

Vectorial opcodes, array opcodes

Credits

Author: Victor Lazzarini
NUI Maynooth
2018

New in version 6.12