Re: [PD] biquad and karplus-strong

2016-06-16 Thread Julian Brooks
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  wrote:

>
>
> 2016-06-15 5:09 GMT-03:00 Peter P. :
>
>> 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
>
>
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] biquad and karplus-strong

2016-06-16 Thread Alexandre Torres Porres
2016-06-15 5:09 GMT-03:00 Peter P. :

> 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


Re: [PD] biquad and karplus-strong

2016-06-15 Thread Peter P.
* Jesse Mejia  [2016-06-14 17:35]:
> 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

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] biquad and karplus-strong

2016-06-15 Thread Peter P.
Hi Alexandre,

* Alexandre Torres Porres  [2016-06-14 20:29]:
[...] 
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

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] biquad and karplus-strong

2016-06-14 Thread Alexandre Torres Porres
you said it better anyhow, haha

2016-06-14 18:35 GMT-03:00 cyrille henry :

>
>
> Le 14/06/2016 23:27, Alexandre Torres Porres a écrit :
>
>> 2016-06-14 17:40 GMT-03:00 cyrille henry  c...@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


Re: [PD] biquad and karplus-strong

2016-06-14 Thread Alexandre Torres Porres
2016-06-14 17:40 GMT-03:00 cyrille henry :

> 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
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] biquad and karplus-strong

2016-06-14 Thread cyrille henry

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  [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



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] biquad and karplus-strong

2016-06-14 Thread Alexandre Torres Porres
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 :

> 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"
> 
>
> 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 :
>
>> 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.finnend...@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
>>
>
>


Karplus-Strong-2.pd
Description: Binary data
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] biquad and karplus-strong

2016-06-14 Thread Orm Finnendahl
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
#N canvas 765 130 450 570 10;
#X obj 105 178 noise~;
#X obj 118 423 print~;
#X obj 190 219 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 69 273 abs~;
#X obj 122 218 sig~ 0.5;
#X obj 105 239 -~;
#X obj 210 54 vsl 15 128 -1 1 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 7000 1;
#X floatatom 210 190 5 0 0 0 - - -, f 5;
#X obj 86 300 -~;
#X obj 88 349 clip~ 0 2;
#X obj 88 371 -~ 1;
#X obj 87 328 *~ 1e+36;
#X connect 0 0 5 0;
#X connect 2 0 1 0;
#X connect 3 0 8 0;
#X connect 4 0 5 1;
#X connect 5 0 8 1;
#X connect 5 0 3 0;
#X connect 6 0 7 0;
#X connect 6 0 2 0;
#X connect 7 0 4 0;
#X connect 8 0 11 0;
#X connect 9 0 10 0;
#X connect 10 0 1 0;
#X connect 11 0 9 0;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


[PD] biquad and karplus-strong

2016-06-14 Thread 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