wguide1
Prev | Orchestra Opcodes and Operators | Next

## wguide1

wguide1 — A simple waveguide model consisting of one delay-line and one first-order lowpass filter.

## Description

A simple waveguide model consisting of one delay-line and one first-order lowpass filter.

## Syntax

    ares wguide1 asig, xfreq, kcutoff, kfeedback

## Performance

asig -- the input of excitation noise.

xfreq -- the frequency (i.e. the inverse of delay time) Changed to x-rate in Csound version 3.59.

kcutoff -- the filter cutoff frequency in Hz.

kfeedback -- the feedback factor.

wguide1 is the most elemental waveguide model, consisting of one delay-line and one first-order lowpass filter.

Implementing waveguide algorithms as opcodes, instead of orc instruments, allows the user to set kr different than sr, allowing better performance particulary when using real-time.

wguide1.

## Examples

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

Example 1050. Example of the wguide1 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 wguide1.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

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

    ; Instrument #1 - a simple noise waveform.
    instr 1
      ; Generate some noise.
      asig noise 20000, 0.5

      out asig
    endin

    ; Instrument #2 - a waveguide example.
    instr 2
      ; Generate some noise.
      asig noise 20000, 0.5

      ; Run it through a wave-guide model.
      kfreq init 200
      kcutoff init 3000
      kfeedback init 0.8
      awg1 wguide1 asig, kfreq, kcutoff, kfeedback

      out awg1
    endin

    </CsInstruments>
    <CsScore>

    ; Play Instrument #1 for 2 seconds.
    i 1 0 2
    ; Play Instrument #2 for 2 seconds.
    i 2 2 2
    e

    </CsScore>
    </CsoundSynthesizer>

## See Also

wguide2

## Credits

Author: Gabriel Maldonado
Italy
October 1998

Example written by Kevin Conder.

New in Csound version 3.49

Prev | Up | Next
wgpluck2 | Home | wguide2