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)
aresrepluckiplk,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.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;realtime audio out;-iadc ;;;uncomment -iadc if realtime audio input is needed too; For Non-realtime ouput leave only the line below:; -o repluck.wav -W ;;; for file output any platform</CsOptions><CsInstruments>sr=44100ksmps=320dbfs=1nchnls=2instr1iplk=0.75kamp=.8icps=110krefl=p4kpick=p5axciteoscil1,1,1asigrepluckiplk,kamp,icps,kpick,krefl,axciteasigdcblock2asig;get rid of DC offsetoutsasig,asigendin</CsInstruments><CsScore>f1016384101;sine wave.si1010.950.75;sounds heavier (=p5)i1+1<i1+1<i1+1<i1+100.6si1010.950.15;sounds softer (=p5)i1+1<i1+1<i1+1<i1+100.6e</CsScore></CsoundSynthesizer>
Here is another example of the repluck opcode. It uses the file repluck-advanced.csd.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;realtime audio out;-iadc ;;;uncomment -iadc if realtime audio input is needed too; For Non-realtime ouput leave only the line below:; -o repluck_advanced.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; By Stefano Cucchi 2020sr=44100ksmps=320dbfs=1nchnls=2instr1iplk=p4kamp=p5icps=p6krefllrandomi0.52,0.99,0.61kpicklrandomi0.1,0.9,13kreflr=p7kpickr=p8ain1diskin"fox.wav",1,0asiglrepluckiplk,kamp,icps,kpickl,krefll,ain1asigldcblock2asiglasigrrepluckiplk,kamp,icps,kpickr,kreflr,ain1asigrdcblock2asigrkdeclicklinseg0,0.05,1,p3-0.1,1,0.05,0outch1,asigl*kdeclickoutch2,asigr*kdeclickendin</CsInstruments><CsScore>i1040.110.5690.90.11i1340.110.5120.90.11i1640.410.510.20.11i1940.110.53000.90.99i11240.110.51820.90.99i115150.990.512.0390.90.11e</CsScore></CsoundSynthesizer>