Csound Csound-dev Csound-tekno Search About

Manual Waveguide Pluck Orc/Sco (again)

Date1999-08-13 04:39
FromHans Mikelson
SubjectManual Waveguide Pluck Orc/Sco (again)
Hi,

Craig Routt asked me about using zak for implementing a pluck sound.  I'm
not sure if this is what he wanted but here is a simple version of a
waveguide pluck implemented with out using one of the pluck opcodes.

Bye,
Hans Mikelson

; ORC
sr     =      44100 ; sr=kr
kr     =      44100
ksmps  =      1
nchnls =      2
      zakinit 50, 50 ; Initialize the zak system

      instr  1             ; Instrument 1 is for the impulse

ioutch =      p4           ; Zak channel number

arnd  rand   1             ; Generate a noise signal
      zaw    arnd, ioutch  ; Ouput to the zak channel

      endin

      instr 2              ; Instrument 2 implements feedback loop

iamp  =     p4             ; Amplitude
itime =     1/cpspch(p5)   ; Convert pitch to time
iinch =     p6             ; Input channel

aflt init   0              ; Initially filtered signal is zero

asig  zar   iinch          ; Read the zak channel

adel delay asig+aflt, itime ; Mix the filtered signal with the original and
delay
alp  butterlp adel, 5000   ; Lowpass filter
aflt butterhp alp, 20      ; High pass filter

     outs  aflt*iamp, aflt*iamp ; Amplify and output

     endin

; SCO
;  Sta  Dur  OutCh
i1 0    .02  1     ; Generate an impulse

;  Sta  Dur  Amp    Fqc   InCh
i2 0    1    20000  7.00  1     ; Do the pluck