wgpluck2
Prev | Orchestra Opcodes and Operators | Next

## wgpluck2

wgpluck2 — Physical model of the plucked string.

## Description

wgpluck2 is an implementation of the physical model of the plucked string, with control over the pluck point, the pickup point and the filter. Based on the Karplus-Strong algorithm.

## Syntax

    ares wgpluck2 iplk, kamp, icps, kpick, krefl

## Initialization

iplk -- The point of pluck is iplk, which is a fraction of the way up the string (0 to 1). A pluck point of zero means no initial pluck.

icps -- The string plays at icps pitch.

## Performance

kamp -- Amplitude of note.

kpick -- Proportion of the way along the string to sample the output.

krefl -- the coefficient of reflection, indicating the lossiness and the rate of decay. It must be strictly between 0 and 1 (it will complain about both 0 and 1).

## Examples

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

Example 435. Example of the wgpluck2 opcode.

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

    ; Instrument #1.
    instr 1
      iplk = 0.75
      kamp = 30000
      icps = 220
      kpick = 0.75
      krefl = 0.5

      apluck wgpluck2 iplk, kamp, icps, kpick, krefl

      out apluck
    endin
    /* wgpluck2.orc */

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

## See Also

repluck

## Credits

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

New in Csound version 3.47

Prev | Up | Next
wgpluck | Home | wguide1