Hi list,
I am trying to implement Karplus-Strong and am wondering about the following questions:
sample blocksize. Will a biquad~ object work correctly with blocksizes of 1 as well?
The Karplus-Strong paper recommends a simple one sample delay moving average filter: y(n) = 0.5 * [x(n) + x(n+1)]. Would [biquad~ 0 0 0.5 0.5 0] be the correct implementation of it then?
Low frequencies (DC) recirculate forever in such a patch. I wonder what practice people have came up with to cope with this. I would suspect putting a factor <1 into the feedback loop, or a [hip~ 3] or something similar? Is there a standard way? I guess not...
Karplus-Strong seems to get interesting if the phase of each sample is randomly reversed in the feedback path (the 'drum' algorithm). The probability of such a phase reversal should be controllable using a 'p' parameter, which is a float value between 0 and 1, and which describes the probability that a sample is phase-reversed (multiplied by one). How can this be implemented in vanilla Pd (using blocksize 1)?
Thank you for any ideas to the above questions. I checked the mailinglist-archive and have not found anything about these ones.
P
Hi Peter,
Am Dienstag, den 14. Juni 2016 um 10:51:16 Uhr (+0200) schrieb Peter P.:
Hi list,
I am trying to implement Karplus-Strong and am wondering about the following questions:
not an answer to your question, but here is an implementation of Karplus Strong:
http://www.pd-tutorial.com/english/ch03s04.html
(see section 3.4.2.10 Karplus-Strong algorithm)
-- Orm
Hi Peter,
BTW: The patch in the pd tutorial uses [z~ 1] which you can replace with [biquad~ 0 0 0 1 0] and your suggestion to do the averaging in the biquad~ should simplify that patch even more.
The probability based polarity change could be done using the attached patch.
-- Orm
Am Dienstag, den 14. Juni 2016 um 10:51:16 Uhr (+0200) schrieb Peter P.:
Hi list,
I am trying to implement Karplus-Strong and am wondering about the following questions:
- I run the feedback-delay inside a subpatch that is re[block~ 1]ed to 1
sample blocksize. Will a biquad~ object work correctly with blocksizes of 1 as well?
The Karplus-Strong paper recommends a simple one sample delay moving average filter: y(n) = 0.5 * [x(n) + x(n+1)]. Would [biquad~ 0 0 0.5 0.5 0] be the correct implementation of it then?
Low frequencies (DC) recirculate forever in such a patch. I wonder what practice people have came up with to cope with this. I would suspect putting a factor <1 into the feedback loop, or a [hip~ 3] or something similar? Is there a standard way? I guess not...
Karplus-Strong seems to get interesting if the phase of each sample is randomly reversed in the feedback path (the 'drum' algorithm). The probability of such a phase reversal should be controllable using a 'p' parameter, which is a float value between 0 and 1, and which describes the probability that a sample is phase-reversed (multiplied by one). How can this be implemented in vanilla Pd (using blocksize 1)?
Thank you for any ideas to the above questions. I checked the mailinglist-archive and have not found anything about these ones.
P
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Dear Orm,
Hi Peter,
BTW: The patch in the pd tutorial uses [z~ 1] which you can replace with [biquad~ 0 0 0 1 0] and your suggestion to do the averaging in the biquad~ should simplify that patch even more.
The probability based polarity change could be done using the attached patch.
Thank you! This is quite elegant, vanilla Pd and works with a blocksize of 1 as well! Did you come up with this or is there another source which can be credited?
I am wondering if someone implemented the Karplus' and Strong's 'decay stretching' in Pd as well.
best, Peter
Hi Peter,
Am Dienstag, den 14. Juni 2016 um 15:05:57 Uhr (+0200) schrieb Peter P.:
Thank you! This is quite elegant, vanilla Pd and works with a blocksize of 1 as well! Did you come up with this or is there another source which can be credited?
The polarity was done from scratch today. The Karplus Strong patch was done by Johannes Kreidler with my help when he was studying with me.
I am wondering if someone implemented the Karplus' and Strong's 'decay stretching' in Pd as well.
Don't know what that is.
-- Orm
I haven't heard of decay stretching in KS - I'm interested in this - where is info on that?
On Jun 14, 2016, at 6:38 AM, Orm Finnendahl orm.finnendahl@selma.hfmdk-frankfurt.de wrote:
Hi Peter,
Am Dienstag, den 14. Juni 2016 um 15:05:57 Uhr (+0200) schrieb Peter P.: Thank you! This is quite elegant, vanilla Pd and works with a blocksize of 1 as well! Did you come up with this or is there another source which can be credited?
The polarity was done from scratch today. The Karplus Strong patch was done by Johannes Kreidler with my help when he was studying with me.
I am wondering if someone implemented the Karplus' and Strong's 'decay stretching' in Pd as well.
Don't know what that is.
-- Orm
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hi Peter, I tried my best to do a faithful implementation of the Karplus Strong algorithm (with the probability function and all) as described in that paper. I have it in my didactic material that I use to teach my students - one thing though, I'm from Brazil and the thing is being developed in portuguese. You find the latest version in here: https://sites.google.com/site/porres/pd
more specifically Material de apoio do curso de Live Electronics da "EL Locus Solus" https://sites.google.com/site/porres/Live%20Electronics%20%28EL%20Locus%20Solus%29%20-%20Porres.zip?attredirects=0&d=1
Even more specifically, the karplus strong is the last folder, in "Parte 6
even more specifically, the algorithm is *2.Algoritmo.Karplus-Strong.pd*
This is an ever ongoing project of mine that I doubt I'll ever finish btw, and I keep rewriting it. Karplus Strong was one of the latest additions, and I'm sure I'll rewrite it. I'm actually sending another patch attached, as I think the way the output is connected now makes more sense, what do you think?
I think that using vline~ is more accurate and elegant than [del] as in kriedler's implementation. I also didn't like the way there was a delay/latency of one period because the envelope goes first to the delay line before going to the output. So I had done it differently in the current version in my didactic work, but I'm now considering this new idea.
I use fexpr~ for the mean filter, but I had also used sometimes biquad~ in the same way as you suggested. I think biquad~ should work with a block of 1, if not it is buggy! You can easily test it though.
Note you can use other filters instead of the mean average filter. That was chosen back in the day for convenience, we have more options now, lop~ would be a nice one by the way.
cheers
2016-06-14 12:35 GMT-03:00 Jesse Mejia jmejia@anestheticaudio.com:
I haven't heard of decay stretching in KS - I'm interested in this - where is info on that?
On Jun 14, 2016, at 6:38 AM, Orm Finnendahl <
orm.finnendahl@selma.hfmdk-frankfurt.de> wrote:
Hi Peter,
Am Dienstag, den 14. Juni 2016 um 15:05:57 Uhr (+0200) schrieb Peter P.: Thank you! This is quite elegant, vanilla Pd and works with a blocksize of 1 as well! Did you come up with this or is there another source which can be credited?
The polarity was done from scratch today. The Karplus Strong patch was done by Johannes Kreidler with my help when he was studying with me.
I am wondering if someone implemented the Karplus' and Strong's 'decay stretching' in Pd as well.
Don't know what that is.
-- Orm
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hey, I didn't send the new version in the attachment, that's the same as in my didactic material, here's the new version
2016-06-14 15:29 GMT-03:00 Alexandre Torres Porres porres@gmail.com:
Hi Peter, I tried my best to do a faithful implementation of the Karplus Strong algorithm (with the probability function and all) as described in that paper. I have it in my didactic material that I use to teach my students - one thing though, I'm from Brazil and the thing is being developed in portuguese. You find the latest version in here: https://sites.google.com/site/porres/pd
more specifically Material de apoio do curso de Live Electronics da "EL Locus Solus" https://sites.google.com/site/porres/Live%20Electronics%20%28EL%20Locus%20Solus%29%20-%20Porres.zip?attredirects=0&d=1
Even more specifically, the karplus strong is the last folder, in "Parte 6
- Filtros e Reverb", there you finder folder "*32.Karplus-Strong*". Even
even more specifically, the algorithm is *2.Algoritmo.Karplus-Strong.pd*
This is an ever ongoing project of mine that I doubt I'll ever finish btw, and I keep rewriting it. Karplus Strong was one of the latest additions, and I'm sure I'll rewrite it. I'm actually sending another patch attached, as I think the way the output is connected now makes more sense, what do you think?
I think that using vline~ is more accurate and elegant than [del] as in kriedler's implementation. I also didn't like the way there was a delay/latency of one period because the envelope goes first to the delay line before going to the output. So I had done it differently in the current version in my didactic work, but I'm now considering this new idea.
I use fexpr~ for the mean filter, but I had also used sometimes biquad~ in the same way as you suggested. I think biquad~ should work with a block of 1, if not it is buggy! You can easily test it though.
Note you can use other filters instead of the mean average filter. That was chosen back in the day for convenience, we have more options now, lop~ would be a nice one by the way.
cheers
2016-06-14 12:35 GMT-03:00 Jesse Mejia jmejia@anestheticaudio.com:
I haven't heard of decay stretching in KS - I'm interested in this - where is info on that?
On Jun 14, 2016, at 6:38 AM, Orm Finnendahl <
orm.finnendahl@selma.hfmdk-frankfurt.de> wrote:
Hi Peter,
Am Dienstag, den 14. Juni 2016 um 15:05:57 Uhr (+0200) schrieb Peter
P.:
Thank you! This is quite elegant, vanilla Pd and works with a blocksize of 1 as well! Did you come up with this or is there another source
which
can be credited?
The polarity was done from scratch today. The Karplus Strong patch was done by Johannes Kreidler with my help when he was studying with me.
I am wondering if someone implemented the Karplus' and Strong's 'decay stretching' in Pd as well.
Don't know what that is.
-- Orm
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hi Alexandre,
[...] I see you use fexpr~ to derive binary noise from a [noise~]. I might not be correct but I suppose that binary noise has a similar, if not the same, spectrum as re [noise~], so it could be left out to save some CPU cycles. Otherwise just multiplying [noise~] by a high factor [*~ 1e+36] and clipping it at [clip~ -1 1] might be a cheaper way to do it.
Orm's implementation of the random phase might also be cheaper than your two fexpr~ for that part. You might not have to be conservative with CPU usage in your case at all however.
I use fexpr~ for the mean filter, but I had also used sometimes biquad~ in the same way as you suggested. I think biquad~ should work with a block of 1, if not it is buggy! You can easily test it though.
It does work and might save cpu compared to fexpr~.
Note you can use other filters instead of the mean average filter. That was chosen back in the day for convenience, we have more options now, lop~ would be a nice one by the way.
Thank you! Indeed one can throw all sorts of filters in there. In my case I am trying a textbook implementation for now.
Thank you for your kind reply! Peter
2016-06-15 5:09 GMT-03:00 Peter P. peterparker@fastmail.com:
Orm's implementation of the random phase might also be cheaper than your two fexpr~ for that part.
it's just "expr~" not "fexpr~" ;)
You might not have to be conservative with CPU usage in your case at all however.
nope, and I need to be more intuitive (as this is a didactic material) and I consider this to be "simpler" - subjective
It does work and might save cpu compared to fexpr~.
biquad~ is surely cheaper than fexpr~ !!!
In my case I am trying a textbook implementation for now.
yep, that's what I was going for in that example, what you think? If you have more remarks other than efficiency, I'd like to know.
cheers
Hey Alexandre,
I got sound that I liked really quickly out of your patch. Surely a good didactic test.
Regards,
Julian
On 16 June 2016 at 07:26, Alexandre Torres Porres porres@gmail.com wrote:
2016-06-15 5:09 GMT-03:00 Peter P. peterparker@fastmail.com:
Orm's implementation of the random phase might also be cheaper than your two fexpr~ for that part.
it's just "expr~" not "fexpr~" ;)
You might not have to be conservative with CPU usage in your case at all however.
nope, and I need to be more intuitive (as this is a didactic material) and I consider this to be "simpler" - subjective
It does work and might save cpu compared to fexpr~.
biquad~ is surely cheaper than fexpr~ !!!
In my case I am trying a textbook implementation for now.
yep, that's what I was going for in that example, what you think? If you have more remarks other than efficiency, I'd like to know.
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I haven't heard of decay stretching in KS - I'm interested in this - where is info on that?
You have guessed it, on the web! https://www.google.com/#q=karplus+strong+decay+stretching
hello,
i've just read the original article from 1983 describing KS algo, including decay stretching. as far as i understand, averaging the last 2 sample is a very optimized low pass iir filter at fixed frequency. the decay stretching allow to change the filter cutoff. now that processing power allow to easily compute filter at different frequency, I would suggest to replace the averaging algo with a simple lop~ filter and experiment with the cutoff frequency.
cheers c
Le 14/06/2016 15:05, Peter P. a écrit :
Dear Orm,
- Orm Finnendahl orm.finnendahl@selma.hfmdk-frankfurt.de [2016-06-14 12:24]:
Hi Peter,
BTW: The patch in the pd tutorial uses [z~ 1] which you can replace with [biquad~ 0 0 0 1 0] and your suggestion to do the averaging in the biquad~ should simplify that patch even more.
The probability based polarity change could be done using the attached patch.
Thank you! This is quite elegant, vanilla Pd and works with a blocksize of 1 as well! Did you come up with this or is there another source which can be credited?
I am wondering if someone implemented the Karplus' and Strong's 'decay stretching' in Pd as well.
best, Peter
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
2016-06-14 17:40 GMT-03:00 cyrille henry ch@chnry.net:
now that processing power allow to easily compute filter at different frequency, I would suggest to replace the averaging algo with a simple lop~ filter and experiment with the cutoff frequency.
yep, that's what I was trying to say ;)
cheers
Le 14/06/2016 23:27, Alexandre Torres Porres a écrit :
2016-06-14 17:40 GMT-03:00 cyrille henry <ch@chnry.net mailto:ch@chnry.net>:
now that processing power allow to easily compute filter at different frequency, I would suggest to replace the averaging algo with a simple lop~ filter and experiment with the cutoff frequency.
yep, that's what I was trying to say ;)
oups, sory, i missed that c
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
you said it better anyhow, haha
2016-06-14 18:35 GMT-03:00 cyrille henry ch@chnry.net:
Le 14/06/2016 23:27, Alexandre Torres Porres a écrit :
2016-06-14 17:40 GMT-03:00 cyrille henry <ch@chnry.net mailto: ch@chnry.net>:
now that processing power allow to easily compute filter at different
frequency, I would suggest to replace the averaging algo with a simple lop~ filter and experiment with the cutoff frequency.
yep, that's what I was trying to say ;)
oups, sory, i missed that
c
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
At the beginning of this year I was listening to Eduardo Falu, he started doing some tremolo with his fingers on the Spanish guitar, automatically I though of trying that with Kreidler`s example of KS. I attach the patch as an pdvst~ instrument I already used in an album I'm working this year. Sounds wonderful. Salutti,Lucarda. Mensaje telepatico asistido por maquinas.
From: porres@gmail.com Date: Tue, 14 Jun 2016 20:38:00 -0300 To: ch@chnry.net CC: pd-list@lists.iem.at Subject: Re: [PD] biquad and karplus-strong
you said it better anyhow, haha 2016-06-14 18:35 GMT-03:00 cyrille henry ch@chnry.net:
Le 14/06/2016 23:27, Alexandre Torres Porres a écrit :
2016-06-14 17:40 GMT-03:00 cyrille henry <ch@chnry.net mailto:ch@chnry.net>:
now that processing power allow to easily compute filter at different frequency, I would suggest to replace the averaging algo with a simple lop~ filter and experiment with the cutoff frequency.
yep, that's what I was trying to say ;)
oups, sory, i missed that
c
cheers
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Salut Cyrille,
hello,
i've just read the original article from 1983 describing KS algo, including decay stretching. as far as i understand, averaging the last 2 sample is a very optimized low pass iir filter at fixed frequency. the decay stretching allow to change the filter cutoff. now that processing power allow to easily compute filter at different frequency, I would suggest to replace the averaging algo with a simple lop~ filter and experiment with the cutoff frequency.
I am looking into this because the paper seems to give a relation of that filter to the period length (pitch) that allows for constant decay amongst low and hight pitches. I understand that they switch randomly between a 2-sample-average filter, and the unmodified version of the delay on a sample-per sample basis. Perhaps this is a crude 1983 way of moving the filter cutoff frequency upwards and should indeed be done in a different way today.
cheers, P