Physical Modelling and WaveshapingLecture SlidesA series of gif images of the lecture slides... (sorry, only accesible from within Stanford University)
Physical ModellingExamplessinger.insPerry Cook's Singer physical modeling instrument in clm. And a couple of examples by Perry Cook. See paper references at the beginning of the clm instrument. This instrument was translated by Bill from the original C code as implemented for Perry's thesis. Here is the (very simple!) header of the instrument and a short description of its parameters: (definstrument singer (beg amp data) Mandatory parameters
Glotal excitations:
(with-sound () (singer 0 .1 '((.4 ehh.shp test.glt 523.0 .8 0.0 .01) (.6 oo.shp test.glt 523.0 .7 .1 .01)))) (with-sound () (singer 0 .1 '((.05 ehh.shp test.glt 523.0 0.8 0.0 .01) (.15 ehh.shp test.glt 523.0 0.8 0.0 .01) (.05 kkk.shp test.glt 523.0 0.0 0.0 .01) (.05 kkk.shp test.glt 523.0 0.0 0.0 .01) (.02 kk+.shp test.glt 523.0 0.0 1.0 .01) (.08 kk+.shp test.glt 523.0 0.0 0.2 .01) (.05 ooo.shp test.glt 523.0 0.8 0.0 .01) (.15 ooo.shp test.glt 523.0 0.8 0.0 .01) (.05 eee.shp test.glt 523.0 0.8 0.0 .01) (.15 eee.shp test.glt 523.0 0.8 0.0 .01) (.05 ehh.shp test.glt 523.0 0.8 0.0 .01) (.15 ehh.shp test.glt 523.0 0.8 0.0 .01) (.05 mmm.shp test.glt 523.0 0.8 0.0 .01) (.15 mmm.shp test.glt 523.0 0.8 0.0 .01) (.10 mmm.shp test.glt 523.0 0.0 0.0 .01) )))In the following example we are using a soundfile as an excitation function. In this case a gunshot would be processed by the vocal tract of the model. Highly unpleasant for the singer, I guess (you will need to find a gunshot sample if you want to run this code).
(with-sound () (singer 0 .1 '((.05 ehh.shp "pistol.snd" 523.0 0.8 0.0 .01) (.15 ehh.shp "pistol.snd" 523.0 0.8 0.0 .01) (.05 kkk.shp "pistol.snd" 523.0 0.0 0.0 .01) (.05 kkk.shp "pistol.snd" 523.0 0.0 0.0 .01) (.02 kk+.shp "pistol.snd" 523.0 0.0 1.0 .01) (.08 kk+.shp "pistol.snd" 523.0 0.0 0.2 .01) (.05 ooo.shp "pistol.snd" 523.0 0.8 0.0 .01) (.15 ooo.shp "pistol.snd" 523.0 0.8 0.0 .01) (.05 eee.shp "pistol.snd" 523.0 0.8 0.0 .01) (.15 eee.shp "pistol.snd" 523.0 0.8 0.0 .01) (.05 ehh.shp "pistol.snd" 523.0 0.8 0.0 .01) (.15 ehh.shp "pistol.snd" 523.0 0.8 0.0 .01) (.05 mmm.shp "pistol.snd" 523.0 0.8 0.0 .01) (.15 mmm.shp "pistol.snd" 523.0 0.8 0.0 .01) (.10 mmm.shp "pistol.snd" 523.0 0.0 0.0 .01) ))) piano.insScott Van Dyne's piano physical modeling instrument in clm.Here is the header of the instrument and a short description of some of its parameters:
(definstrument p (&key (start 0.0) (duration 1.0) (keyNum 60.0) (strike-velocity 0.5) (pedal-down nil) (release-time-margin 0.75) (amp .5) ;;slider controls (detuningFactor 1.0) (detuningFactor-table '()) (stiffnessFactor 1.0) (stiffnessFactor-table '()) (pedalPresenceFactor .3) (longitudinalMode 10.5) (StrikePositionInvFac -0.9) (singleStringDecayRateFactor 1.0) ;; parameter tables indexed by keyNum ;; NB: you can override the loudPole-table by directly setting :loudPole to a value loudPole (loudPole-table default-loudPole-table) softPole (softPole-table default-softPole-table) loudGain (loudGain-table default-loudGain-table) softGain (softGain-table default-softGain-table) strikePosition (strikePosition-table default-strikePosition-table) detuning2 (detuning2-table default-detuning2-table) detuning3 (detuning3-table default-detuning3-table) stiffnessCoefficient (stiffnessCoefficient-table default-stiffnessCoefficient-table) singleStringDecayRate (singleStringDecayRate-table default-singleStringDecayRate-table) singleStringZero (singleStringZero-table default-singleStringZero-table) singleStringPole (singleStringPole-table default-singleStringPole-table) releaseLoopGain (releaseLoopGain-table default-releaseLoopGain-table) DryTapFiltCoefT60 (DryTapFiltCoefT60-table default-DryTapFiltCoefT60-table) DryTapFiltCoefTarget (DryTapFiltCoefTarget-table default-DryTapFiltCoefTarget-table) DryTapFiltCoefCurrent (DryTapFiltCoefCurrent-table default-DryTapFiltCoefCurrent-table) DryTapAmpT60 (DryTapAmpT60-table default-DryTapAmpT60-table) sustainPedalLevel (sustainPedalLevel-table default-sustainPedalLevel-table) pedalResonancePole (pedalResonancePole-table default-pedalResonancePole-table) pedalEnvelopeT60 (pedalEnvelopeT60-table default-pedalEnvelopeT60-table) soundboardCutoffT60 (soundboardCutoffT60-table default-soundboardCutoffT60-table) DryPedalResonanceFactor (DryPedalResonanceFactor-table default-DryPedalResonanceFactor-table) unaCordaGain (unaCordaGain-table default-unaCordaGain-table)) Some key parameters
Normal...(with-sound (:srate 44100 :output "/zap/thnormal.snd") (loop for i from 0 to 7 do (p (* i .5) :duration .5 :keyNum (+ 24 (* 12 i)) :strike-velocity .5 ; 0 to 1, 0 is softest played note, 1 is loud note :amp .4 ;overall volume level :DryPedalResonanceFactor .25 ;0 no open string resonance ;1.0 is about full resonance of dampers raised ;can be greater than 1.0 ))) Detuning and stiffness...(with-sound (:srate 44100 :output "/zap/thstiff.snd") (loop for i from 0 to 7 do (p (* i .5) :duration .5 :keyNum (+ 24 (* 12 i)) :strike-velocity .5 ;0 to 1, 0 is softest played note, 1 is loud note :amp .4 ;overall volume level :DryPedalResonanceFactor .25 ;0 no open string resonance ;1.0 is about full resonance of dampers raised ;can be greater than 1.0 ;;modification to do detunedness :detuningFactor-table '(24 5 36 7.0 48 7.5 60 12.0 72 20 84 30 96 100 108 300) ;scales the above detuning values ; so 1.0 is nominal detuning ; 0.0 is exactly in tune (no two stage decay...) ; > 1.0 is out of tune... ;;modification to do stiffness :stiffnessFactor-table '(21 1.5 24 1.5 36 1.5 48 1.5 60 1.4 72 1.3 84 1.2 96 1.0 108 1.0) ;0.0 to 1.0 is less stiff, 1.0 to 2.0 is more stiff... ))) Overdamped...(with-sound (:srate 44100:output "/zap/thdamped.snd") (loop for i from 0 to 7 do (p (* i .5) :duration .5 :keyNum (+ 24 (* 12 i)) :strike-velocity .5 ;0 to 1, 0 is softest played note, 1 is loud note :amp .4 ;overall volume level :DryPedalResonanceFactor .25 ;0 no open string resonance ;1.0 is about full resonance of dampers raised ;can be greater than 1.0 ;;modifications to do damped sounds :singleStringDecayRate-table '(21 -5 24.000 -5.000 36.000 -5.4 41.953 -5.867 48.173 -7.113 53.818 -8.016 59.693 -8.875 66.605 -9.434 73.056 -10.035 78.931 -10.293 84.000 -12.185) :singleStringPole-table '(21 .8 24 0.7 36.000 .6 48 .5 60 .3 84 .1 96 .03 108 .03) :stiffnessCoefficient-table '(21.000 -0.920 24.000 -0.900 36.000 -0.700 48.000 -0.250 60.000 -0.100 75.179 -0.040 82.986 -0.040 92.240 .3 96.000 .5 99.000 .7 108.000 .7) ;these are the actual allpass coefficients modified here ;to allow dampedness at hig freqs ))) prc-toolkit95.lispPerry Cook's physical modelling toolkit translated to clm.
Karplus Strong synthesis(definstrument plucky (beg dur freq amplitude &optional (maxA 1.0)) Mandatory and optional parameters
Bowed string(defcinstrument bow (beg dur frq amplitude &optional (maxA 1.0))NOTE: freq is off in this one (in PRC's original also)
Mandatory and optional parameters
Wind instruments(defcinstrument brass (beg dur freq amplitude &optional (maxA 1.0)) (defcinstrument clarinet (beg dur freq amplitude &optional (maxA 1.0)) (defcinstrument flute (beg dur freq amplitude &optional (maxA 1.0)) Mandatory and optional parameters
pluck.insThe Karplus-Strong algorithm as extended by David Jaffe and Julius Smith
(definstrument pluck (start dur freq amp &key (weighting 0.9) (lossfact 0.99) (decaytime 6) (attacktime 0.01)) Mandatory and key parameters
flute.insA stereo flute by Nicky Hind. maraca.insPerry Cook's maraca from CMJ vol 21 no 3 (Fall 97) p 44. Used by Juan Reyes in the piece "wadimusa or the monteria hat" (example played in class) |
©1997/98-2002 Fernando Lopez-Lezcano. All Rights Reserved. nando@ccrma.stanford.edu
|