scantable
Prev | Orchestra Opcodes and Operators | Next

## scantable

scantable — A simpler scanned synthesis implementation.

## Description

A simpler scanned synthesis implementation. This is an implementation of a circular string scanned using external tables. This opcode will allow direct modification and reading of values with the table opcodes.

## Syntax

    aout scantable kamp, kpch, ipos, imass, istiff, idamp, ivel

## Initialization

ipos -- table containing position array.

imass -- table containing the mass of the string.

istiff -- table containing the stiffness of the string.

idamp -- table containing the damping factors of the string.

ivel -- table containing the velocities.

## Performance

kamp -- amplitude (gain) of the string.

kpch -- the string's scanned frequency.

## Examples

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

Example 410. Example of the scantable 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
    ; Audio out   Audio in    No messages
    -odac           -iadc     -d     ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
    ; -o scantable.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    ; Initialize the global variables.
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 1

    ; Table #1 - initial position
    git1 ftgen 1, 0, 128, 7, 0, 64, 1, 64, 0
    ; Table #2 - masses
    git2 ftgen 2, 0, 128, -7, 1, 128, 1
    ; Table #3 - stiffness
    git3 ftgen 3, 0, 128, -7, 0, 64, 100, 64, 0
    ; Table #4 - damping
    git4 ftgen 4, 0, 128, -7, 1, 128, 1
    ; Table #5 - initial velocity
    git5 ftgen 5, 0, 128, -7, 0, 128, 0

    ; Instrument #1.
    instr 1
      kamp init 20000
      kpch init 220
      ipos = 1
      imass = 2
      istiff = 3
      idamp = 4
      ivel = 5

      a1 scantable kamp, kpch, ipos, imass, istiff, idamp, ivel
      a2 dcblock a1

      out a2
    endin

    </CsInstruments>
    <CsScore>

    ; Play Instrument #1 for ten seconds.
    i 1 0 10
    e

    </CsScore>
    </CsoundSynthesizer>

## See Also

scanhammer

## Credits

Author: Matt Gilliard
April 2002

Example written by Kevin Conder.

New in version 4.20

Prev | Up | Next
scans | Home | scanu