streson
Prev | Orchestra Opcodes and Operators | Next

## streson

streson — A string resonator with variable fundamental frequency.

## Description

An audio signal is modified by a string resonator with variable fundamental frequency.

## Syntax

    ares streson asig, kfr, ifdbgain

## Initialization

ifdbgain -- feedback gain, between 0 and 1, of the internal delay line. A value close to 1 creates a slower decay and a more pronounced resonance. Small values may leave the input signal unaffected. Depending on the filter frequency, typical values are > .9.

## Performance

asig -- the input audio signal.

kfr -- the fundamental frequency of the string.

streson passes the input asig through a network composed of comb, low-pass and all-pass filters, similar to the one used in some versions of the Karplus-Strong algorithm, creating a string resonator effect. The fundamental frequency of the “string” is controlled by the k-rate variable kfr.This opcode can be used to simulate sympathetic resonances to an input signal.

streson is an adaptation of the StringFlt object of the SndObj Sound Object Library developed by the author.

## Examples

Here is an example of the streson opcode. It uses the files streson.orc and streson.sco.

Example 360. Example of the streson opcode.

    /* streson.orc */
    ; Initialize the global variables.
    sr = 44100
    kr = 4410
    ksmps = 10
    nchnls = 1

    ; Instrument #1.
    instr 1
      ; Generate a normal sine wave.
      asig oscils 8000, 440, 1

      ; Vary the fundamental frequency of the string
      ; resonator linearly from 220 to 880 Hertz.
      kfr line 220, p3, 880
      ifdbgain = 0.95

      ; Run our sine wave through the string resonator.
      astres streson asig, kfr, ifdbgain

      ; The resonance can get quite loud.
      ; So we'll clip the signal at 30,000.
      a1 clip astres, 1, 30000
      out a1
    endin
    /* streson.orc */

    /* streson.sco */
    ; Play Instrument #1 for five seconds.
    i 1 0 5
    e
    /* streson.sco */

## Credits

Author: Victor Lazzarini
Music Department
National University of Ireland, Maynooth
Maynooth, Co. Kildare
1998

Example written by Kevin Conder.

New in Csound version 3.494

Prev | Up | Next
strcmp | Home | strget