sumtab
Prev | Orchestra Opcodes and Operators | Next

## sumtab

sumtab — returns the sum of the elements in a vector.

## Description

The sumtab opcode returns the sum of all elements in a vector.

## Syntax

    ksum sumtab tab

## Performance

ksum -- variable for result.

tab -- table for reading.

## Examples

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

Example 801. Example of the sumtab opcode.

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

    <CsoundSynthesizer>
    <CsInstruments>

    instr 1
      t1 init 10
      t1[3] = 42
      k1 sumtab t1
      printk2 k1
    endin
    </CsInstruments>
    <CsScore>
    i1 0 0.1
    e
    </CsScore>
    </CsoundSynthesizer>

## See Also

plustab, multtab, mintab, sumtab, scalet,

## Credits

Author: John ffitch
October 2011

New in Csound version 5.14

Prev | Up | Next
sum | Home | svfilter