repluck
Prev | Orchestra Opcodes and Operators | Next

## repluck

repluck — Physical model of the plucked string.

## Description

repluck is an implementation of the physical model of the plucked string. A user can control the pluck point, the pickup point, the filter, and an additional audio signal, axcite. axcite is used to excite the 'string'. Based on the Karplus-Strong algorithm.

## Syntax

    ares repluck iplk, kamp, icps, kpick, krefl, axcite

## 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).

## Performance

axcite -- A signal which excites the string.

## Examples

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

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

    ; 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
      axcite oscil 1, 1, 1

      apluck repluck iplk, kamp, icps, kpick, krefl, axcite

      out apluck
    endin

    </CsInstruments>
    <CsScore>

    ; Table #1, a sine wave.
    f 1 0 16384 10 1

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

    </CsScore>
    </CsoundSynthesizer>

## See Also

wgpluck2

## Credits

Author: John ffitch
University of Bath/Codemist Ltd.
Bath, UK
1997

New in version 3.47

Prev | Up | Next
remove | Home | reson