Skip to content

product

Calculates the product of an array.

Takes a numeric array (k or i-rate) and calculates its product.

Syntax

kres/ires product karr[]/iarr[]  (k- or i-arrays )

Examples

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

Example of the product opcode.
<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>

instr 1
 kArr1[] fillarray 1,3,2,7,4
 k1 product kArr1
 printk2 k1
 turnoff
endin


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

See also

Array opcodes

Credits

Author: Victor Lazzarini

New in version 6.09