Csound Csound-dev Csound-tekno Search About

streson question with example

Date1999-08-13 20:56
FromDavid Boothe
Subjectstreson question with example
When varying streson's fundamental resonator frequency (argument labeled
kfr), the output contains small impulses as if the "string" were being
plucked. The documentation gives no indication that this should be the case.
When the resonance fundamental is fixed, these artifacts are absent.

Since the Karplus-Strong alogrithm is a plucked sting model, is this just
the nature of it and/or its implementation in streson? Or is there a bug in
streson? I'm using Windows console version 3.57.

The example below is from a more elaborate instrument, but demonstrates
this. (Watch out for line wraps.)

Thanks in advance.

-David.

; Orchestra for streson demo=============================

sr     = 44100
kr     = 4410
ksmps  = 10
nchnls = 1 

instr 1

   if1    =          400       ;filter cf beg/end
   if2    =          800       ;filter cf mid
   ib1    =          if1*.5    ;filter bw beg/end
   ib2    =          if2*.5    ;filter bw mid
   iseg  =           p3/2

   kamp   linseg     .1, iseg, 9830, iseg, .1
   kcf    linseg     if1, iseg, if2, iseg, if1
   kbw    linseg     ib1, iseg, ib2, iseg, ib1

   a1     randi      kamp, 3*(if1+if2)   ;noise
   a2     reson      a1, kcf, kbw        ;noise filter

   a3     balance    a2, a1

 ;variable resonance fundamental:
   kfr1    line       350, p3, 700

 ;fixed resonance fundamental:
   kfr2    line       500, p3, 500

 ;select fixed or variable resonance:
   kfr = (p4 = 1 ? kfr1 : kfr2)
   
   a4     streson    a3*.8, kfr, .9
          out        a4
endin

; Score for streson demo==========================

i1 0 4 1    ;variable resonance freq
i1 5 4 2    ;fixed resonance freq
e