The Alternative Csound Reference Manual
Previous |  | Next

# wgbow

wgbow -- Creates a tone similar to a bowed string.

## Description

Audio output is a tone similar to a bowed string, using a physical model developed from Perry Cook, but re-coded for Csound.

## Syntax

ar wgbow kamp, kfreq, kpres, krat, kvibf, kvamp, ifn [, iminfreq]

## Initialization

ifn -- table of shape of vibrato, usually a sine table, created by a function

iminfreq (optional) -- lowest frequency at which the instrument will play. If it is omitted it is taken to be the same as the initial kfreq. If iminfreq is negative, initialization will be skipped.

## Performance

A note is played on a string-like instrument, with the arguments as below.

kamp -- amplitude of note.

kfreq -- frequency of note played.

kpres -- a parameter controlling the pressure of the bow on the string. Values should be about 3. The useful range is approximately 1 to 5.

krat -- the position of the bow along the string. Usual playing is about 0.127236. The suggested range is 0.025 to 0.23.

kvibf -- frequency of vibrato in Hertz. Suggested range is 0 to 12

kvamp -- amplitude of the vibrato

## Examples

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

Example 1. Example of the wgbow opcode.

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

    ; Instrument #1.
    instr 1
      kamp = 31129.60
      kfreq = 440
      kpres = 3.0
      krat = 0.127236
      kvibf = 6.12723
      ifn = 1

      ; Create an amplitude envelope for the vibrato.
      kv linseg 0, 0.5, 0, 1, 1, p3-0.5, 1
      kvamp = kv * 0.01

      a1 wgbow kamp, kfreq, kpres, krat, kvibf, kvamp, ifn
      out a1
    endin
    /* wgbow.orc */

    /* wgbow.sco */
    ; Table #1, a sine wave.
    f 1 0 128 10 1

    ; Play Instrument #1 for two seconds.
    i 1 0 2
    e
    /* wgbow.sco */

## Credits

Author: John ffitch (after Perry Cook)
University of Bath, Codemist Ltd.
Bath, UK

New in Csound version 3.47

Previous | Home | Next
weibull | Up | wgbowedbar