The Alternative Csound Reference Manual
Previous |  | Next

# scans

scans -- Generate audio output using scanned synthesis.

## Description

Generate audio output using scanned synthesis.

## Syntax

ar scans kamp, kfreq, ifn, id [, iorder]

## Initialization

ifn -- ftable containing the scanning trajectory. This is a series of numbers that contains addresses of masses. The order of these addresses is used as the scan path. It should not contain values greater than the number of masses, or negative numbers. See the introduction to the scanned synthesis section.

id -- ID number of the scanu opcode's waveform to use

iorder (optional, default=0) -- order of interpolation used internally. It can take any value in the range 1 to 4, and defaults to 4, which is quartic interpolation. The setting of 2 is quadratic and 1 is linear. The higher numbers are slower, but not necessarily better.

## Performance

kamp -- output amplitude. Note that the resulting amplitude is also dependent on instantaneous value in the wavetable. This number is effectively the scaling factor of the wavetable.

kfreq -- frequency of the scan rate

## Examples

Here is an example of the scanned synthesis. It uses the files scans.orc, scans.sco, and string-128.matrix.

Example 1. Example of the scans opcode.

    /* scans.orc */
        sr =   44100
        kr =   4410
        ksmps =   10
        nchnls =   1

        instr 1
    a0  = 0
    ;   scanu init, irate, ifnvel, ifnmass, ifnstif, ifncentr, ifndamp, kmass, kstif, kcentr, kdamp, ileft, iright, kpos, kstrngth, ain, idisp, id
        scanu 1,     .01,    6,       2,       3,     4,        5,       2,     .1,    .1,     -.01,  .1,    .5,     0,    0,        a0,  1,     2
    ;ar scans kamp,      kfreq,      ifntraj, id
    a1  scans ampdb(p4), cpspch(p5), 7,       2
        out a1
        endin
    /* scans.orc */

    /* scans.sco */
    ; Initial condition
    f1 0 128 7 0 64 1 64 0

    ; Masses
    f2 0 128 -7 1 128 1

    ; Spring matrices
    f3 0 16384 -23 "string-128.matrix"

    ; Centering force
    f4  0 128 -7 0 128 2

    ; Damping
    f5 0 128 -7 1 128 1

    ; Initial velocity
    f6 0 128 -7 0 128 0

    ; Trajectories
    f7 0 128 -5 .001 128 128

    ; Note list
    i1 0  10  86 6.00
    i1 11 14  86 7.00
    i1 15 20  86 5.00
    e
    /* scans.sco */

The matrix file "string-128.matrix", as well as several other matrices, is also available in a zipped file from the Scanned Synthesis page at cSounds.com.

## Credits

Author: Paris Smaragdis
MIT Media Lab
Boston, Massachussetts USA

New in Csound version 4.05

Previous | Home | Next
scanhammer | Up | scantable