Messages Search About

Re: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes

Date2022-08-27 22:13
FromScott Daughtrey
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include

aexc = 0

and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).


 
-odac -d ;--midi-key-cps=5 --midi-velocity-amp=4



sr=44100
ksmps = 32
nchnls=1
0dbfs=1

instr 1

/* now we combine the modern waveguide model
with the ideas developed with the KS model */

ipi = -4*taninv(-1)

iamp = p4
ifun = p5
idec = 12
ipkpos = 0.5
ipos = 0.01
idts = sr/ifun      /* total delay time (samples) */
idtt = int(sr/ifun) /* truncated delay time */
idel = idts/sr      /* delay time (secs) */
 
ifac init 1          /* decay shortening factor (fdb gain) */
is   init 0.5        /* loss filter coefficient */

igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */

if igf > ig igoto stretch /* if decay needs lengthening */
ifac = igf/ig             /* if decay needs shortening */
goto continue

stretch:       /* this is the LP coefficient calculation to
                  provide the required decay stretch */       
icosfun = cos(2*ipi*ifun/sr)
ia = 2 - 2*icosfun
ib = 2*icosfun - 2
ic = 1 - igf*igf 
id = sqrt(ib*ib - 4*ia*ic)
is1 = (-ib + id)/(ia*2)
is2 = (-ib - id)/(ia*2)
is = (is1 < is2 ? is1 : is2) 

continue:
idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
ifd = (idts - (idtt + is))  /* fractional delay */
icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
kcount timeinsts    /* time counter */

aexcr = 0

if kcount > idel kgoto wguide
/* this is the string initial state,
   based on a ideal triangle shape
   filtered by a gentle lowpass  */
awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0  
aexcr = (awvr+delay1(awvr))*0.5

wguide:
adump  delayr 1
adel   deltapn idtt
aflt = (adel*(1-is) + delay1(adel)*is)*ifac 
alps filter2 aflt,1,1,icoef,1,icoef
ipkpr = (1-ipkpos)*idtt
ipkpl = ipkpos*idtt
apkupr deltapn ipkpr   /* right-going wave pickup */
apkupl deltapn ipkpl   /* left-going wave pickup */
       delayw    aflt+aexcr
aout  dcblock (apkupr+apkupl)*0.25
      out  aout
endin




i1   0  4  1  220
i1   2  4  .  440
i1   4  4  .  880
i1   6  4  . 1760




Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-08-27 23:50
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
No crashes here. It works right up the register, you are probably.

The line to be corrected was

 aexcr = 0

and not

 aexc = 0 
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Aug 2022, at 22:13, Scott Daughtrey  wrote:
> 
> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
> 
> aexc = 0
> 
> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
> 
> 
>  
> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
> 
> 
> 
> sr=44100
> ksmps = 32
> nchnls=1
> 0dbfs=1
> 
> instr 1
> 
> /* now we combine the modern waveguide model
> with the ideas developed with the KS model */
> 
> ipi = -4*taninv(-1)
> 
> iamp = p4
> ifun = p5
> idec = 12
> ipkpos = 0.5
> ipos = 0.01
> idts = sr/ifun      /* total delay time (samples) */
> idtt = int(sr/ifun) /* truncated delay time */
> idel = idts/sr      /* delay time (secs) */
> 
> ifac init 1          /* decay shortening factor (fdb gain) */
> is   init 0.5        /* loss filter coefficient */
> 
> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
> 
> if igf > ig igoto stretch /* if decay needs lengthening */
> ifac = igf/ig             /* if decay needs shortening */
> goto continue
> 
> stretch:       /* this is the LP coefficient calculation to
>                  provide the required decay stretch */       
> icosfun = cos(2*ipi*ifun/sr)
> ia = 2 - 2*icosfun
> ib = 2*icosfun - 2
> ic = 1 - igf*igf 
> id = sqrt(ib*ib - 4*ia*ic)
> is1 = (-ib + id)/(ia*2)
> is2 = (-ib - id)/(ia*2)
> is = (is1 < is2 ? is1 : is2) 
> 
> continue:
> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
> ifd = (idts - (idtt + is))  /* fractional delay */
> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
> kcount timeinsts    /* time counter */
> 
> aexcr = 0
> 
> if kcount > idel kgoto wguide
> /* this is the string initial state,
>   based on a ideal triangle shape
>   filtered by a gentle lowpass  */
> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0  
> aexcr = (awvr+delay1(awvr))*0.5
> 
> wguide:
> adump  delayr 1
> adel   deltapn idtt
> aflt = (adel*(1-is) + delay1(adel)*is)*ifac 
> alps filter2 aflt,1,1,icoef,1,icoef
> ipkpr = (1-ipkpos)*idtt
> ipkpl = ipkpos*idtt
> apkupr deltapn ipkpr   /* right-going wave pickup */
> apkupl deltapn ipkpl   /* left-going wave pickup */
>       delayw    aflt+aexcr
> aout  dcblock (apkupr+apkupl)*0.25
>      out  aout
> endin
> 
> 
> 
> 
> i1   0  4  1  220
> i1   2  4  .  440
> i1   4  4  .  880
> i1   6  4  . 1760
> 
> 
> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C319e9c7336b74eb6bedd08da8870fe55%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972316701205075%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=2iFMtUGOQj0eSL9147CwIsz6JErVhypZ%2BESSQkqk4fg%3D&reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C319e9c7336b74eb6bedd08da8870fe55%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972316701205075%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=4PZffoGzZxGTTeu8r%2Bo276Rh%2F7yGlkUg0h6YmvMNY58%3D&reserved=0
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-08-27 23:52
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
Notes above the normal guitar range will not work well of course.

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Aug 2022, at 23:50, Victor Lazzarini  wrote:
> 
> The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
> No crashes here. It works right up the register, you are probably.
> 
> The line to be corrected was
> 
> aexcr = 0
> 
> and not
> 
> aexc = 0 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 27 Aug 2022, at 22:13, Scott Daughtrey  wrote:
>> 
>> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
>> 
>> aexc = 0
>> 
>> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
>> 
>> 
>>  
>> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
>> 
>> 
>> 
>> sr=44100
>> ksmps = 32
>> nchnls=1
>> 0dbfs=1
>> 
>> instr 1
>> 
>> /* now we combine the modern waveguide model
>> with the ideas developed with the KS model */
>> 
>> ipi = -4*taninv(-1)
>> 
>> iamp = p4
>> ifun = p5
>> idec = 12
>> ipkpos = 0.5
>> ipos = 0.01
>> idts = sr/ifun      /* total delay time (samples) */
>> idtt = int(sr/ifun) /* truncated delay time */
>> idel = idts/sr      /* delay time (secs) */
>> 
>> ifac init 1          /* decay shortening factor (fdb gain) */
>> is   init 0.5        /* loss filter coefficient */
>> 
>> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
>> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
>> 
>> if igf > ig igoto stretch /* if decay needs lengthening */
>> ifac = igf/ig             /* if decay needs shortening */
>> goto continue
>> 
>> stretch:       /* this is the LP coefficient calculation to
>>                 provide the required decay stretch */       
>> icosfun = cos(2*ipi*ifun/sr)
>> ia = 2 - 2*icosfun
>> ib = 2*icosfun - 2
>> ic = 1 - igf*igf 
>> id = sqrt(ib*ib - 4*ia*ic)
>> is1 = (-ib + id)/(ia*2)
>> is2 = (-ib - id)/(ia*2)
>> is = (is1 < is2 ? is1 : is2) 
>> 
>> continue:
>> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
>> ifd = (idts - (idtt + is))  /* fractional delay */
>> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
>> kcount timeinsts    /* time counter */
>> 
>> aexcr = 0
>> 
>> if kcount > idel kgoto wguide
>> /* this is the string initial state,
>>  based on a ideal triangle shape
>>  filtered by a gentle lowpass  */
>> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0  
>> aexcr = (awvr+delay1(awvr))*0.5
>> 
>> wguide:
>> adump  delayr 1
>> adel   deltapn idtt
>> aflt = (adel*(1-is) + delay1(adel)*is)*ifac 
>> alps filter2 aflt,1,1,icoef,1,icoef
>> ipkpr = (1-ipkpos)*idtt
>> ipkpl = ipkpos*idtt
>> apkupr deltapn ipkpr   /* right-going wave pickup */
>> apkupl deltapn ipkpl   /* left-going wave pickup */
>>      delayw    aflt+aexcr
>> aout  dcblock (apkupr+apkupl)*0.25
>>     out  aout
>> endin
>> 
>> 
>> 
>> 
>> i1   0  4  1  220
>> i1   2  4  .  440
>> i1   4  4  .  880
>> i1   6  4  . 1760
>> 
>> 
>> 
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&reserved=0
>> Send bugs reports to
>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&reserved=0
>> Discussions of bugs and features can be posted here
> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&reserved=0
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-08-28 00:05
FromST Music
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
Thank you for the reply. I was not aware ksmps defaulted to 10, seems I am learning something new everyday.

I set ksmps to 10 and everything works fine now. 

I was aware the correct line was 
aexcer = 0  
you will notice in the post I made I actually used the correct line in the instr code, however I made the same mistake you did in your first reply to me
aexc = 0
although like me you used the correct line in the instr itself. You may have missed my follow up "Oops" post where I corrected myself. 

Thank you again, it will fun to have another useful instr. Cheers.


On Sat, Aug 27, 2022, 6:52 PM Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
Notes above the normal guitar range will not work well of course.

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Aug 2022, at 23:50, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:
>
> The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
> No crashes here. It works right up the register, you are probably.
>
> The line to be corrected was
>
> aexcr = 0
>
> and not
>
> aexc = 0
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 27 Aug 2022, at 22:13, Scott Daughtrey <stunes6556@GMAIL.COM> wrote:
>>
>> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
>>
>> aexc = 0
>>
>> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
>> </CsOptions>
>>
>> <CsInstruments>
>> sr=44100
>> ksmps = 32
>> nchnls=1
>> 0dbfs=1
>>
>> instr 1
>>
>> /* now we combine the modern waveguide model
>> with the ideas developed with the KS model */
>>
>> ipi = -4*taninv(-1)
>>
>> iamp = p4
>> ifun = p5
>> idec = 12
>> ipkpos = 0.5
>> ipos = 0.01
>> idts = sr/ifun      /* total delay time (samples) */
>> idtt = int(sr/ifun) /* truncated delay time */
>> idel = idts/sr      /* delay time (secs) */
>>
>> ifac init 1          /* decay shortening factor (fdb gain) */
>> is   init 0.5        /* loss filter coefficient */
>>
>> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
>> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
>>
>> if igf > ig igoto stretch /* if decay needs lengthening */
>> ifac = igf/ig             /* if decay needs shortening */
>> goto continue
>>
>> stretch:       /* this is the LP coefficient calculation to
>>                 provide the required decay stretch */       
>> icosfun = cos(2*ipi*ifun/sr)
>> ia = 2 - 2*icosfun
>> ib = 2*icosfun - 2
>> ic = 1 - igf*igf
>> id = sqrt(ib*ib - 4*ia*ic)
>> is1 = (-ib + id)/(ia*2)
>> is2 = (-ib - id)/(ia*2)
>> is = (is1 < is2 ? is1 : is2)
>>
>> continue:
>> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
>> ifd = (idts - (idtt + is))  /* fractional delay */
>> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
>> kcount timeinsts    /* time counter */
>>
>> aexcr = 0
>>
>> if kcount > idel kgoto wguide
>> /* this is the string initial state,
>>  based on a ideal triangle shape
>>  filtered by a gentle lowpass  */
>> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0 
>> aexcr = (awvr+delay1(awvr))*0.5
>>
>> wguide:
>> adump  delayr 1
>> adel   deltapn idtt
>> aflt = (adel*(1-is) + delay1(adel)*is)*ifac
>> alps filter2 aflt,1,1,icoef,1,icoef
>> ipkpr = (1-ipkpos)*idtt
>> ipkpl = ipkpos*idtt
>> apkupr deltapn ipkpr   /* right-going wave pickup */
>> apkupl deltapn ipkpl   /* left-going wave pickup */
>>      delayw    aflt+aexcr
>> aout  dcblock (apkupr+apkupl)*0.25
>>     out  aout
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>>
>> i1   0  4  1  220
>> i1   2  4  .  440
>> i1   4  4  .  880
>> i1   6  4  . 1760
>>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
>> Send bugs reports to
>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-09-03 17:52
FromAaron Krister Johnson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
Victor,

I'm revisiting this code. May I ask: where is `alps` being referenced in the code that follows? It looks like a dangling variable. (specifically, the output of `filter2`)

It looks like it's being calculated, but not being used as an input (by my reading, the `aflt` is the only filter output being fed to output)

Also, what is your suggestions for using this MIDI since the `line` using `p3` won't be a thing (unless it's negative, as you mentioned)...I've already adapted it to use amp and pch from MIDI opcodes.


Thanks,

On Sat, Aug 27, 2022 at 4:07 PM ST Music <stunes6556@gmail.com> wrote:
Thank you for the reply. I was not aware ksmps defaulted to 10, seems I am learning something new everyday.

I set ksmps to 10 and everything works fine now. 

I was aware the correct line was 
aexcer = 0  
you will notice in the post I made I actually used the correct line in the instr code, however I made the same mistake you did in your first reply to me
aexc = 0
although like me you used the correct line in the instr itself. You may have missed my follow up "Oops" post where I corrected myself. 

Thank you again, it will fun to have another useful instr. Cheers.


On Sat, Aug 27, 2022, 6:52 PM Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
Notes above the normal guitar range will not work well of course.

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Aug 2022, at 23:50, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:
>
> The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
> No crashes here. It works right up the register, you are probably.
>
> The line to be corrected was
>
> aexcr = 0
>
> and not
>
> aexc = 0
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 27 Aug 2022, at 22:13, Scott Daughtrey <stunes6556@GMAIL.COM> wrote:
>>
>> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
>>
>> aexc = 0
>>
>> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
>> </CsOptions>
>>
>> <CsInstruments>
>> sr=44100
>> ksmps = 32
>> nchnls=1
>> 0dbfs=1
>>
>> instr 1
>>
>> /* now we combine the modern waveguide model
>> with the ideas developed with the KS model */
>>
>> ipi = -4*taninv(-1)
>>
>> iamp = p4
>> ifun = p5
>> idec = 12
>> ipkpos = 0.5
>> ipos = 0.01
>> idts = sr/ifun      /* total delay time (samples) */
>> idtt = int(sr/ifun) /* truncated delay time */
>> idel = idts/sr      /* delay time (secs) */
>>
>> ifac init 1          /* decay shortening factor (fdb gain) */
>> is   init 0.5        /* loss filter coefficient */
>>
>> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
>> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
>>
>> if igf > ig igoto stretch /* if decay needs lengthening */
>> ifac = igf/ig             /* if decay needs shortening */
>> goto continue
>>
>> stretch:       /* this is the LP coefficient calculation to
>>                 provide the required decay stretch */       
>> icosfun = cos(2*ipi*ifun/sr)
>> ia = 2 - 2*icosfun
>> ib = 2*icosfun - 2
>> ic = 1 - igf*igf
>> id = sqrt(ib*ib - 4*ia*ic)
>> is1 = (-ib + id)/(ia*2)
>> is2 = (-ib - id)/(ia*2)
>> is = (is1 < is2 ? is1 : is2)
>>
>> continue:
>> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
>> ifd = (idts - (idtt + is))  /* fractional delay */
>> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
>> kcount timeinsts    /* time counter */
>>
>> aexcr = 0
>>
>> if kcount > idel kgoto wguide
>> /* this is the string initial state,
>>  based on a ideal triangle shape
>>  filtered by a gentle lowpass  */
>> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0 
>> aexcr = (awvr+delay1(awvr))*0.5
>>
>> wguide:
>> adump  delayr 1
>> adel   deltapn idtt
>> aflt = (adel*(1-is) + delay1(adel)*is)*ifac
>> alps filter2 aflt,1,1,icoef,1,icoef
>> ipkpr = (1-ipkpos)*idtt
>> ipkpl = ipkpos*idtt
>> apkupr deltapn ipkpr   /* right-going wave pickup */
>> apkupl deltapn ipkpl   /* left-going wave pickup */
>>      delayw    aflt+aexcr
>> aout  dcblock (apkupr+apkupl)*0.25
>>     out  aout
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>>
>> i1   0  4  1  220
>> i1   2  4  .  440
>> i1   4  4  .  880
>> i1   6  4  . 1760
>>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
>> Send bugs reports to
>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-09-03 20:58
FromAaron Krister Johnson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
Oh, I see `line` was replaced by `timeinsts`...

On Sat, Sep 3, 2022, 09:52 Aaron Krister Johnson <akjmicro@gmail.com> wrote:
Victor,

I'm revisiting this code. May I ask: where is `alps` being referenced in the code that follows? It looks like a dangling variable. (specifically, the output of `filter2`)

It looks like it's being calculated, but not being used as an input (by my reading, the `aflt` is the only filter output being fed to output)

Also, what is your suggestions for using this MIDI since the `line` using `p3` won't be a thing (unless it's negative, as you mentioned)...I've already adapted it to use amp and pch from MIDI opcodes.


Thanks,

On Sat, Aug 27, 2022 at 4:07 PM ST Music <stunes6556@gmail.com> wrote:
Thank you for the reply. I was not aware ksmps defaulted to 10, seems I am learning something new everyday.

I set ksmps to 10 and everything works fine now. 

I was aware the correct line was 
aexcer = 0  
you will notice in the post I made I actually used the correct line in the instr code, however I made the same mistake you did in your first reply to me
aexc = 0
although like me you used the correct line in the instr itself. You may have missed my follow up "Oops" post where I corrected myself. 

Thank you again, it will fun to have another useful instr. Cheers.


On Sat, Aug 27, 2022, 6:52 PM Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
Notes above the normal guitar range will not work well of course.

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Aug 2022, at 23:50, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:
>
> The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
> No crashes here. It works right up the register, you are probably.
>
> The line to be corrected was
>
> aexcr = 0
>
> and not
>
> aexc = 0
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 27 Aug 2022, at 22:13, Scott Daughtrey <stunes6556@GMAIL.COM> wrote:
>>
>> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
>>
>> aexc = 0
>>
>> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
>> </CsOptions>
>>
>> <CsInstruments>
>> sr=44100
>> ksmps = 32
>> nchnls=1
>> 0dbfs=1
>>
>> instr 1
>>
>> /* now we combine the modern waveguide model
>> with the ideas developed with the KS model */
>>
>> ipi = -4*taninv(-1)
>>
>> iamp = p4
>> ifun = p5
>> idec = 12
>> ipkpos = 0.5
>> ipos = 0.01
>> idts = sr/ifun      /* total delay time (samples) */
>> idtt = int(sr/ifun) /* truncated delay time */
>> idel = idts/sr      /* delay time (secs) */
>>
>> ifac init 1          /* decay shortening factor (fdb gain) */
>> is   init 0.5        /* loss filter coefficient */
>>
>> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
>> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
>>
>> if igf > ig igoto stretch /* if decay needs lengthening */
>> ifac = igf/ig             /* if decay needs shortening */
>> goto continue
>>
>> stretch:       /* this is the LP coefficient calculation to
>>                 provide the required decay stretch */       
>> icosfun = cos(2*ipi*ifun/sr)
>> ia = 2 - 2*icosfun
>> ib = 2*icosfun - 2
>> ic = 1 - igf*igf
>> id = sqrt(ib*ib - 4*ia*ic)
>> is1 = (-ib + id)/(ia*2)
>> is2 = (-ib - id)/(ia*2)
>> is = (is1 < is2 ? is1 : is2)
>>
>> continue:
>> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
>> ifd = (idts - (idtt + is))  /* fractional delay */
>> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
>> kcount timeinsts    /* time counter */
>>
>> aexcr = 0
>>
>> if kcount > idel kgoto wguide
>> /* this is the string initial state,
>>  based on a ideal triangle shape
>>  filtered by a gentle lowpass  */
>> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0 
>> aexcr = (awvr+delay1(awvr))*0.5
>>
>> wguide:
>> adump  delayr 1
>> adel   deltapn idtt
>> aflt = (adel*(1-is) + delay1(adel)*is)*ifac
>> alps filter2 aflt,1,1,icoef,1,icoef
>> ipkpr = (1-ipkpos)*idtt
>> ipkpl = ipkpos*idtt
>> apkupr deltapn ipkpr   /* right-going wave pickup */
>> apkupl deltapn ipkpl   /* left-going wave pickup */
>>      delayw    aflt+aexcr
>> aout  dcblock (apkupr+apkupl)*0.25
>>     out  aout
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>>
>> i1   0  4  1  220
>> i1   2  4  .  440
>> i1   4  4  .  880
>> i1   6  4  . 1760
>>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
>> Send bugs reports to
>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-09-03 21:40
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
Ah, alps should replace aflt in the delay line input, that's the allpass filter out. I probably fiddled with it and ended up removing it.

The funny thing about p3 is that you are right, the check won't work, but the code does because linseg produces 0 after idel seconds.

Better to use timeinsts anyway.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 3 Sep 2022, at 17:53, Aaron Krister Johnson <akjmicro@gmail.com> wrote:


Victor,

I'm revisiting this code. May I ask: where is `alps` being referenced in the code that follows? It looks like a dangling variable. (specifically, the output of `filter2`)

It looks like it's being calculated, but not being used as an input (by my reading, the `aflt` is the only filter output being fed to output)

Also, what is your suggestions for using this MIDI since the `line` using `p3` won't be a thing (unless it's negative, as you mentioned)...I've already adapted it to use amp and pch from MIDI opcodes.


Thanks,

On Sat, Aug 27, 2022 at 4:07 PM ST Music <stunes6556@gmail.com> wrote:
Thank you for the reply. I was not aware ksmps defaulted to 10, seems I am learning something new everyday.

I set ksmps to 10 and everything works fine now. 

I was aware the correct line was 
aexcer = 0  
you will notice in the post I made I actually used the correct line in the instr code, however I made the same mistake you did in your first reply to me
aexc = 0
although like me you used the correct line in the instr itself. You may have missed my follow up "Oops" post where I corrected myself. 

Thank you again, it will fun to have another useful instr. Cheers.


On Sat, Aug 27, 2022, 6:52 PM Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
Notes above the normal guitar range will not work well of course.

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 27 Aug 2022, at 23:50, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:
>
> The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
> No crashes here. It works right up the register, you are probably.
>
> The line to be corrected was
>
> aexcr = 0
>
> and not
>
> aexc = 0
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 27 Aug 2022, at 22:13, Scott Daughtrey <stunes6556@GMAIL.COM> wrote:
>>
>> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
>>
>> aexc = 0
>>
>> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
>> </CsOptions>
>>
>> <CsInstruments>
>> sr=44100
>> ksmps = 32
>> nchnls=1
>> 0dbfs=1
>>
>> instr 1
>>
>> /* now we combine the modern waveguide model
>> with the ideas developed with the KS model */
>>
>> ipi = -4*taninv(-1)
>>
>> iamp = p4
>> ifun = p5
>> idec = 12
>> ipkpos = 0.5
>> ipos = 0.01
>> idts = sr/ifun      /* total delay time (samples) */
>> idtt = int(sr/ifun) /* truncated delay time */
>> idel = idts/sr      /* delay time (secs) */
>>
>> ifac init 1          /* decay shortening factor (fdb gain) */
>> is   init 0.5        /* loss filter coefficient */
>>
>> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
>> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
>>
>> if igf > ig igoto stretch /* if decay needs lengthening */
>> ifac = igf/ig             /* if decay needs shortening */
>> goto continue
>>
>> stretch:       /* this is the LP coefficient calculation to
>>                 provide the required decay stretch */       
>> icosfun = cos(2*ipi*ifun/sr)
>> ia = 2 - 2*icosfun
>> ib = 2*icosfun - 2
>> ic = 1 - igf*igf
>> id = sqrt(ib*ib - 4*ia*ic)
>> is1 = (-ib + id)/(ia*2)
>> is2 = (-ib - id)/(ia*2)
>> is = (is1 < is2 ? is1 : is2)
>>
>> continue:
>> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
>> ifd = (idts - (idtt + is))  /* fractional delay */
>> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
>> kcount timeinsts    /* time counter */
>>
>> aexcr = 0
>>
>> if kcount > idel kgoto wguide
>> /* this is the string initial state,
>>  based on a ideal triangle shape
>>  filtered by a gentle lowpass  */
>> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0 
>> aexcr = (awvr+delay1(awvr))*0.5
>>
>> wguide:
>> adump  delayr 1
>> adel   deltapn idtt
>> aflt = (adel*(1-is) + delay1(adel)*is)*ifac
>> alps filter2 aflt,1,1,icoef,1,icoef
>> ipkpr = (1-ipkpos)*idtt
>> ipkpl = ipkpos*idtt
>> apkupr deltapn ipkpr   /* right-going wave pickup */
>> apkupl deltapn ipkpl   /* left-going wave pickup */
>>      delayw    aflt+aexcr
>> aout  dcblock (apkupr+apkupl)*0.25
>>     out  aout
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>>
>> i1   0  4  1  220
>> i1   2  4  .  440
>> i1   4  4  .  880
>> i1   6  4  . 1760
>>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
>> Send bugs reports to
>>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
> Send bugs reports to
>        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-09-03 22:22
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
and I just noticed that the filter2 manual page is misleading (well, it’s wrong), so the filter2 line I used for the allpass was incorrect.

This is the right one

 alps filter2 aflt,2,1,icoef,1,icoef

The manual page stated that the second parameter was the number of zeros, and that was wrong. It’s the number
of feedfoward coefficients. I correct it in git. Pretty annoying actually when we get caught in this,. I was using biquad
previously, and changed to filter2 but because I had the allpass out of line, I never noticed it wasn’t working.

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 3 Sept 2022, at 21:40, Victor Lazzarini  wrote:
> 
> Ah, alps should replace aflt in the delay line input, that's the allpass filter out. I probably fiddled with it and ended up removing it.
> 
> The funny thing about p3 is that you are right, the check won't work, but the code does because linseg produces 0 after idel seconds.
> 
> Better to use timeinsts anyway.
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 3 Sep 2022, at 17:53, Aaron Krister Johnson  wrote:
>> 
>> 
>> Victor,
>> 
>> I'm revisiting this code. May I ask: where is `alps` being referenced in the code that follows? It looks like a dangling variable. (specifically, the output of `filter2`)
>> 
>> It looks like it's being calculated, but not being used as an input (by my reading, the `aflt` is the only filter output being fed to output)
>> 
>> Also, what is your suggestions for using this MIDI since the `line` using `p3` won't be a thing (unless it's negative, as you mentioned)...I've already adapted it to use amp and pch from MIDI opcodes.
>> 
>> 
>> Thanks,
>> 
>> 
>> Aaron Krister Johnson
>> Music, etc.:
>> http://www.untwelve.org
>> https://www.youtube.com/channel/UC_utjGYbSizWE0dNyr0Vdmg
>> https://soundcloud.com/aaron-krister-johnson
>> https://soundcloud.com/filtercreed
>> https://aaronkristerjohnson.bandcamp.com/
>> Code:
>> https://github.com/akjmicro
>> 
>> 
>> On Sat, Aug 27, 2022 at 4:07 PM ST Music  wrote:
>> Thank you for the reply. I was not aware ksmps defaulted to 10, seems I am learning something new everyday.
>> 
>> I set ksmps to 10 and everything works fine now. 
>> 
>> I was aware the correct line was 
>> aexcer = 0  
>> you will notice in the post I made I actually used the correct line in the instr code, however I made the same mistake you did in your first reply to me
>> aexc = 0
>> although like me you used the correct line in the instr itself. You may have missed my follow up "Oops" post where I corrected myself. 
>> 
>> Thank you again, it will fun to have another useful instr. Cheers.
>> 
>> Scott Daughtrey
>> https://soundcloud.com/stoons-1
>> 
>> https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg
>> 
>> 
>> On Sat, Aug 27, 2022, 6:52 PM Victor Lazzarini,  wrote:
>> Notes above the normal guitar range will not work well of course.
>> 
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>> > On 27 Aug 2022, at 23:50, Victor Lazzarini  wrote:
>> > 
>> > The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
>> > No crashes here. It works right up the register, you are probably.
>> > 
>> > The line to be corrected was
>> > 
>> > aexcr = 0
>> > 
>> > and not
>> > 
>> > aexc = 0 
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> > 
>> >> On 27 Aug 2022, at 22:13, Scott Daughtrey  wrote:
>> >> 
>> >> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
>> >> 
>> >> aexc = 0
>> >> 
>> >> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
>> >> 
>> >> 
>> >>  
>> >> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
>> >> 
>> >> 
>> >> 
>> >> sr=44100
>> >> ksmps = 32
>> >> nchnls=1
>> >> 0dbfs=1
>> >> 
>> >> instr 1
>> >> 
>> >> /* now we combine the modern waveguide model
>> >> with the ideas developed with the KS model */
>> >> 
>> >> ipi = -4*taninv(-1)
>> >> 
>> >> iamp = p4
>> >> ifun = p5
>> >> idec = 12
>> >> ipkpos = 0.5
>> >> ipos = 0.01
>> >> idts = sr/ifun      /* total delay time (samples) */
>> >> idtt = int(sr/ifun) /* truncated delay time */
>> >> idel = idts/sr      /* delay time (secs) */
>> >> 
>> >> ifac init 1          /* decay shortening factor (fdb gain) */
>> >> is   init 0.5        /* loss filter coefficient */
>> >> 
>> >> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
>> >> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
>> >> 
>> >> if igf > ig igoto stretch /* if decay needs lengthening */
>> >> ifac = igf/ig             /* if decay needs shortening */
>> >> goto continue
>> >> 
>> >> stretch:       /* this is the LP coefficient calculation to
>> >>                 provide the required decay stretch */       
>> >> icosfun = cos(2*ipi*ifun/sr)
>> >> ia = 2 - 2*icosfun
>> >> ib = 2*icosfun - 2
>> >> ic = 1 - igf*igf 
>> >> id = sqrt(ib*ib - 4*ia*ic)
>> >> is1 = (-ib + id)/(ia*2)
>> >> is2 = (-ib - id)/(ia*2)
>> >> is = (is1 < is2 ? is1 : is2) 
>> >> 
>> >> continue:
>> >> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
>> >> ifd = (idts - (idtt + is))  /* fractional delay */
>> >> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
>> >> kcount timeinsts    /* time counter */
>> >> 
>> >> aexcr = 0
>> >> 
>> >> if kcount > idel kgoto wguide
>> >> /* this is the string initial state,
>> >>  based on a ideal triangle shape
>> >>  filtered by a gentle lowpass  */
>> >> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0  
>> >> aexcr = (awvr+delay1(awvr))*0.5
>> >> 
>> >> wguide:
>> >> adump  delayr 1
>> >> adel   deltapn idtt
>> >> aflt = (adel*(1-is) + delay1(adel)*is)*ifac 
>> >> alps filter2 aflt,1,1,icoef,1,icoef
>> >> ipkpr = (1-ipkpos)*idtt
>> >> ipkpl = ipkpos*idtt
>> >> apkupr deltapn ipkpr   /* right-going wave pickup */
>> >> apkupl deltapn ipkpl   /* left-going wave pickup */
>> >>      delayw    aflt+aexcr
>> >> aout  dcblock (apkupr+apkupl)*0.25
>> >>     out  aout
>> >> endin
>> >> 
>> >> 
>> >> 
>> >> 
>> >> i1   0  4  1  220
>> >> i1   2  4  .  440
>> >> i1   4  4  .  880
>> >> i1   6  4  . 1760
>> >> 
>> >> 
>> >> 
>> >> 
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&reserved=0
>> >> Send bugs reports to
>> >>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&reserved=0
>> >> Discussions of bugs and features can be posted here
>> > 
>> > 
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&reserved=0
>> > Send bugs reports to
>> >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&reserved=0
>> > Discussions of bugs and features can be posted here
>> 
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2022-09-12 17:00
FromAaron Krister Johnson
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Tuning issues with the various pluck opcodes
Cool...thanks for that tip.

BTW, I took this thread (sort-of) to another which proposed a solution for my issues with plucking-in-general in csound; but I felt a new thread was called for since it might be of general interest to folks using faust integration.

Cheers,


On Sat, Sep 3, 2022 at 2:22 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
and I just noticed that the filter2 manual page is misleading (well, it’s wrong), so the filter2 line I used for the allpass was incorrect.

This is the right one

 alps filter2 aflt,2,1,icoef,1,icoef

The manual page stated that the second parameter was the number of zeros, and that was wrong. It’s the number
of feedfoward coefficients. I correct it in git. Pretty annoying actually when we get caught in this,. I was using biquad
previously, and changed to filter2 but because I had the allpass out of line, I never noticed it wasn’t working.

========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 3 Sept 2022, at 21:40, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
>
> Ah, alps should replace aflt in the delay line input, that's the allpass filter out. I probably fiddled with it and ended up removing it.
>
> The funny thing about p3 is that you are right, the check won't work, but the code does because linseg produces 0 after idel seconds.
>
> Better to use timeinsts anyway.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 3 Sep 2022, at 17:53, Aaron Krister Johnson <akjmicro@gmail.com> wrote:
>>
>> 
>> Victor,
>>
>> I'm revisiting this code. May I ask: where is `alps` being referenced in the code that follows? It looks like a dangling variable. (specifically, the output of `filter2`)
>>
>> It looks like it's being calculated, but not being used as an input (by my reading, the `aflt` is the only filter output being fed to output)
>>
>> Also, what is your suggestions for using this MIDI since the `line` using `p3` won't be a thing (unless it's negative, as you mentioned)...I've already adapted it to use amp and pch from MIDI opcodes.
>>
>>
>> Thanks,
>>
>>
>> Aaron Krister Johnson
>> Music, etc.:
>> http://www.untwelve.org
>> https://www.youtube.com/channel/UC_utjGYbSizWE0dNyr0Vdmg
>> https://soundcloud.com/aaron-krister-johnson
>> https://soundcloud.com/filtercreed
>> https://aaronkristerjohnson.bandcamp.com/
>> Code:
>> https://github.com/akjmicro
>>
>>
>> On Sat, Aug 27, 2022 at 4:07 PM ST Music <stunes6556@gmail.com> wrote:
>> Thank you for the reply. I was not aware ksmps defaulted to 10, seems I am learning something new everyday.
>>
>> I set ksmps to 10 and everything works fine now.
>>
>> I was aware the correct line was
>> aexcer = 0 
>> you will notice in the post I made I actually used the correct line in the instr code, however I made the same mistake you did in your first reply to me
>> aexc = 0
>> although like me you used the correct line in the instr itself. You may have missed my follow up "Oops" post where I corrected myself.
>>
>> Thank you again, it will fun to have another useful instr. Cheers.
>>
>> Scott Daughtrey
>> https://soundcloud.com/stoons-1
>>
>> https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg
>>
>>
>> On Sat, Aug 27, 2022, 6:52 PM Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
>> Notes above the normal guitar range will not work well of course.
>>
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> > On 27 Aug 2022, at 23:50, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:
>> >
>> > The second code I sent earlier was correct. It doesn’t need to set ksmps (defaults to 10).
>> > No crashes here. It works right up the register, you are probably.
>> >
>> > The line to be corrected was
>> >
>> > aexcr = 0
>> >
>> > and not
>> >
>> > aexc = 0
>> > ========================
>> > Prof. Victor Lazzarini
>> > Maynooth University
>> > Ireland
>> >
>> >> On 27 Aug 2022, at 22:13, Scott Daughtrey <stunes6556@GMAIL.COM> wrote:
>> >>
>> >> Thank you for the reply. There were a few things missing here (ex. ksmps) and even with that Csound kept crashing. I modified the original to include
>> >>
>> >> aexc = 0
>> >>
>> >> and got the result below. It works better now but doesn't seem to like notes in upper registers (I only tried A880 and the octave above so I don't know where the break point is).
>> >>
>> >> <CsoundSynthesizer>
>> >> <CsOptions>
>> >> -odac -d ;--midi-key-cps=5 --midi-velocity-amp=4
>> >> </CsOptions>
>> >>
>> >> <CsInstruments>
>> >> sr=44100
>> >> ksmps = 32
>> >> nchnls=1
>> >> 0dbfs=1
>> >>
>> >> instr 1
>> >>
>> >> /* now we combine the modern waveguide model
>> >> with the ideas developed with the KS model */
>> >>
>> >> ipi = -4*taninv(-1)
>> >>
>> >> iamp = p4
>> >> ifun = p5
>> >> idec = 12
>> >> ipkpos = 0.5
>> >> ipos = 0.01
>> >> idts = sr/ifun      /* total delay time (samples) */
>> >> idtt = int(sr/ifun) /* truncated delay time */
>> >> idel = idts/sr      /* delay time (secs) */
>> >>
>> >> ifac init 1          /* decay shortening factor (fdb gain) */
>> >> is   init 0.5        /* loss filter coefficient */
>> >>
>> >> igf pow 10, -idec/(20*ifun) /* gain required for a certain decay */
>> >> ig  = cos(ipi*ifun/sr)      /* unitary gain with s=0.5 */
>> >>
>> >> if igf > ig igoto stretch /* if decay needs lengthening */
>> >> ifac = igf/ig             /* if decay needs shortening */
>> >> goto continue
>> >>
>> >> stretch:       /* this is the LP coefficient calculation to
>> >>                 provide the required decay stretch */       
>> >> icosfun = cos(2*ipi*ifun/sr)
>> >> ia = 2 - 2*icosfun
>> >> ib = 2*icosfun - 2
>> >> ic = 1 - igf*igf
>> >> id = sqrt(ib*ib - 4*ia*ic)
>> >> is1 = (-ib + id)/(ia*2)
>> >> is2 = (-ib - id)/(ia*2)
>> >> is = (is1 < is2 ? is1 : is2)
>> >>
>> >> continue:
>> >> idtt = ((idtt+is) > (idts) ? idtt - 1: idtt)
>> >> ifd = (idts - (idtt + is))  /* fractional delay */
>> >> icoef = (1-ifd)/(1+ifd)  /* allpass coefficient */
>> >> kcount timeinsts    /* time counter */
>> >>
>> >> aexcr = 0
>> >>
>> >> if kcount > idel kgoto wguide
>> >> /* this is the string initial state,
>> >>  based on a ideal triangle shape
>> >>  filtered by a gentle lowpass  */
>> >> awvr linseg 0, ipos*idel/2, -iamp, (1-ipos)*idel, iamp, ipos*idel/2,0,1,0 
>> >> aexcr = (awvr+delay1(awvr))*0.5
>> >>
>> >> wguide:
>> >> adump  delayr 1
>> >> adel   deltapn idtt
>> >> aflt = (adel*(1-is) + delay1(adel)*is)*ifac
>> >> alps filter2 aflt,1,1,icoef,1,icoef
>> >> ipkpr = (1-ipkpos)*idtt
>> >> ipkpl = ipkpos*idtt
>> >> apkupr deltapn ipkpr   /* right-going wave pickup */
>> >> apkupl deltapn ipkpl   /* left-going wave pickup */
>> >>      delayw    aflt+aexcr
>> >> aout  dcblock (apkupr+apkupl)*0.25
>> >>     out  aout
>> >> endin
>> >>
>> >> </CsInstruments>
>> >> <CsScore>
>> >>
>> >> i1   0  4  1  220
>> >> i1   2  4  .  440
>> >> i1   4  4  .  880
>> >> i1   6  4  . 1760
>> >>
>> >> </CsScore>
>> >> </CsoundSynthesizer>
>> >>
>> >> Csound mailing list
>> >> Csound@listserv.heanet.ie
>> >> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
>> >> Send bugs reports to
>> >>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
>> >> Discussions of bugs and features can be posted here
>> >
>> >
>> > Csound mailing list
>> > Csound@listserv.heanet.ie
>> > https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vz8usHuM88N8O72npSHVva34KDjU5EKewXZ10MhGTGM%3D&amp;reserved=0
>> > Send bugs reports to
>> >        https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&amp;data=05%7C01%7CVictor.Lazzarini%40mu.ie%7C1fc69f5ee88348c44a9008da887e9c96%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C637972374628491426%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MwePpOJasyxumIdUsO1mfUL05spl8C1yVWB53upnUqQ%3D&amp;reserved=0
>> > Discussions of bugs and features can be posted here
>>
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here