Gui controls for (LTI-)Filters anyone?

View: New views
20 Messages — Rating Filter:   Alert me  

Gui controls for (LTI-)Filters anyone?

by LFSaw :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Folks,

just thought of something like this:

{
        var in = WhiteNoise.ar;
        8ChFilter.ar(in).gui;
}.play;

->






for often used filters that would be awesome (dude!)

thoughts/implementations, anyone :-)

regards
Till

pastedGraphic.png (31K) Download Attachment

Re: Gui controls for (LTI-)Filters anyone?

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You might be able to get some mileage out of my MultiEQ class, which
implements multiband parametric EQ with filter types high and low
shelving, high and low pass, and boost/cut. The high/low shelving
filters are adapted from a Joe Anderson Regalia-Mitra implementation;
the others are standard UGens (HPF, LPF, MidEQ).

What's missing is the computation of the frequency response and
graphic display -- while there is a graphic editor currently, it's
parametric and doesn't show a frequency response curve. I would love
to have that but I'm not going to have time to work on it for quite
awhile. I would gratefully incorporate someone else's frequency curve
GUI (and of course give full credit).

hjh

On Mon, Jun 30, 2008 at 11:23 AM, LFSaw <lfsaw@...> wrote:

> Hey Folks,
>
> just thought of something like this:
>
> {
>        var in = WhiteNoise.ar;
>        8ChFilter.ar(in).gui;
> }.play;
>
> ->



--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman

_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by Sciss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

well, you will need to be able to retrieve the filter coefficients  
for each ugen... i tried to do that for MidEQ by looking into  
FilterUGens.cpp, but i must have done something wrong, as the plot is  
obviously wrong...

so if you would add the correct coeffs-methods for each ugen, it  
should work:

~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0, -12 ).collect(_.ampdb).plot
HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot





Am 30.06.2008 um 17:23 schrieb LFSaw:

> Hey Folks,
>
> just thought of something like this:
>
> {
> var in = WhiteNoise.ar;
> 8ChFilter.ar(in).gui;
> }.play;
>
> ->
>
> <pastedGraphic.png>
>
>
> for often used filters that would be awesome (dude!)
>
> thoughts/implementations, anyone :-)
>
> regards
> Till


plusFilter.sc (1K) Download Attachment

Re: Gui controls for (LTI-)Filters anyone?

by Sciss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i'm not sure, seems you need to invert the sign of the feedback  
coefficients, e.g.

+ OnePole {
        *coeffs { arg sr, coef = 0.5; ^[[ 1 - abs( coef )], [ coef.neg ]]}
}

maybe that should be done in *magResponse (i.e. assuming b0 = -1)


Am 30.06.2008 um 20:10 schrieb Sciss:

> well, you will need to be able to retrieve the filter coefficients  
> for each ugen... i tried to do that for MidEQ by looking into  
> FilterUGens.cpp, but i must have done something wrong, as the plot  
> is obviously wrong...
>
> so if you would add the correct coeffs-methods for each ugen, it  
> should work:
>
> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0, -12 ).collect(_.ampdb).plot
> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>
> <plusFilter.sc>
>
> Am 30.06.2008 um 17:23 schrieb LFSaw:
>
>> Hey Folks,
>>
>> just thought of something like this:
>>
>> {
>> var in = WhiteNoise.ar;
>> 8ChFilter.ar(in).gui;
>> }.play;
>>
>> ->
>>
>> <pastedGraphic.png>
>>
>>
>> for often used filters that would be awesome (dude!)
>>
>> thoughts/implementations, anyone :-)
>>
>> regards
>> Till
>


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by scztt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can also make a buffer with a single sample impulse, filter it, and do
an fft analysis on it to get the response. I've got code for it at home, I
can fwd it to the list when I get off work.

- Scott

> i'm not sure, seems you need to invert the sign of the feedback
> coefficients, e.g.
>
> + OnePole {
> *coeffs { arg sr, coef = 0.5; ^[[ 1 - abs( coef )], [ coef.neg ]]}
> }
>
> maybe that should be done in *magResponse (i.e. assuming b0 = -1)
>
>
> Am 30.06.2008 um 20:10 schrieb Sciss:
>
>> well, you will need to be able to retrieve the filter coefficients
>> for each ugen... i tried to do that for MidEQ by looking into
>> FilterUGens.cpp, but i must have done something wrong, as the plot
>> is obviously wrong...
>>
>> so if you would add the correct coeffs-methods for each ugen, it
>> should work:
>>
>> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
>> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0, -12 ).collect(_.ampdb).plot
>> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>
>> <plusFilter.sc>
>>
>> Am 30.06.2008 um 17:23 schrieb LFSaw:
>>
>>> Hey Folks,
>>>
>>> just thought of something like this:
>>>
>>> {
>>> var in = WhiteNoise.ar;
>>> 8ChFilter.ar(in).gui;
>>> }.play;
>>>
>>> ->
>>>
>>> <pastedGraphic.png>
>>>
>>>
>>> for often used filters that would be awesome (dude!)
>>>
>>> thoughts/implementations, anyone :-)
>>>
>>> regards
>>> Till
>>
>
>
> _______________________________________________
> sc-users mailing list
>
>
> info (subscribe and unsubscribe):
> http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>



_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by Wouter Snoei-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Sciss,

that's great, I've been looking for something like this for quite  
some time. I'll try and modify it a bit to also get graphics for the  
BEQ suite (should be possible right?).

now, if I want to combine curves in one for serially connected  
filters, would I just need to multiply them with each-other? Or is  
there other math involved for that?

btw the impulse response method I already know and tried, but I think  
this one is much more convenient and faster (since it doesn't require  
server<->lang communication). In the end I want to make an EQ  
interface where one can drag around points, so speed is an issue.

cheers & thanks,
Wouter

Op 30-jun-2008, om 20:10 heeft Sciss het volgende geschreven:

> well, you will need to be able to retrieve the filter coefficients  
> for each ugen... i tried to do that for MidEQ by looking into  
> FilterUGens.cpp, but i must have done something wrong, as the plot  
> is obviously wrong...
>
> so if you would add the correct coeffs-methods for each ugen, it  
> should work:
>
> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0, -12 ).collect(_.ampdb).plot
> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>
> <plusFilter.sc>
>
> Am 30.06.2008 um 17:23 schrieb LFSaw:
>
>> Hey Folks,
>>
>> just thought of something like this:
>>
>> {
>> var in = WhiteNoise.ar;
>> 8ChFilter.ar(in).gui;
>> }.play;
>>
>> ->
>>
>> <pastedGraphic.png>
>>
>>
>> for often used filters that would be awesome (dude!)
>>
>> thoughts/implementations, anyone :-)
>>
>> regards
>> Till
>

Wouter Snoei

info@...
http://www.woutersnoei.nl


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by Josh Parmenter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 30, 2008, at 3:05 PM, Wouter Snoei wrote:

> Hi Sciss,
>
> that's great, I've been looking for something like this for quite  
> some time. I'll try and modify it a bit to also get graphics for the  
> BEQ suite (should be possible right?).
>
should be! good idea. I've actually been thinking about updating the  
BEQSuite filters to use all doubles as well.

Josh
>

>
> cheers & thanks,
> Wouter
>
> Op 30-jun-2008, om 20:10 heeft Sciss het volgende geschreven:
>
>> well, you will need to be able to retrieve the filter coefficients  
>> for each ugen... i tried to do that for MidEQ by looking into  
>> FilterUGens.cpp, but i must have done something wrong, as the plot  
>> is obviously wrong...
>>
>> so if you would add the correct coeffs-methods for each ugen, it  
>> should work:
>>
>> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
>> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0,  
>> -12 ).collect(_.ampdb).plot
>> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>
>> <plusFilter.sc>
>>
>> Am 30.06.2008 um 17:23 schrieb LFSaw:
>>
>>> Hey Folks,
>>>
>>> just thought of something like this:
>>>
>>> {
>>> var in = WhiteNoise.ar;
>>> 8ChFilter.ar(in).gui;
>>> }.play;
>>>
>>> ->
>>>
>>> <pastedGraphic.png>
>>>
>>>
>>> for often used filters that would be awesome (dude!)
>>>
>>> thoughts/implementations, anyone :-)
>>>
>>> regards
>>> Till
>>
>
> Wouter Snoei
>
> info@...
> http://www.woutersnoei.nl
>
>
> _______________________________________________
> sc-users mailing list
>
>
> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own  
interpretation of how modern society is structured: whether actively  
or passively, consciously or unconsciously, he makes choices in this  
regard. He may be conservative or he may subject himself to continual  
renewal; or he may strive for a revolutionary, historical or social  
palingenesis." - Luigi Nono
*/


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by Josh Parmenter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I forgot the second part of that thought-
Wouter... if you do it for the BEQSuite, how do you feel about  
including it with the package at sc3-plugins?

Josh

On Jun 30, 2008, at 3:05 PM, Wouter Snoei wrote:

> Hi Sciss,
>
> that's great, I've been looking for something like this for quite  
> some time. I'll try and modify it a bit to also get graphics for the  
> BEQ suite (should be possible right?).
>
> now, if I want to combine curves in one for serially connected  
> filters, would I just need to multiply them with each-other? Or is  
> there other math involved for that?
>
> btw the impulse response method I already know and tried, but I  
> think this one is much more convenient and faster (since it doesn't  
> require server<->lang communication). In the end I want to make an  
> EQ interface where one can drag around points, so speed is an issue.
>
> cheers & thanks,
> Wouter
>
> Op 30-jun-2008, om 20:10 heeft Sciss het volgende geschreven:
>
>> well, you will need to be able to retrieve the filter coefficients  
>> for each ugen... i tried to do that for MidEQ by looking into  
>> FilterUGens.cpp, but i must have done something wrong, as the plot  
>> is obviously wrong...
>>
>> so if you would add the correct coeffs-methods for each ugen, it  
>> should work:
>>
>> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
>> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0,  
>> -12 ).collect(_.ampdb).plot
>> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>
>> <plusFilter.sc>
>>
>> Am 30.06.2008 um 17:23 schrieb LFSaw:
>>
>>> Hey Folks,
>>>
>>> just thought of something like this:
>>>
>>> {
>>> var in = WhiteNoise.ar;
>>> 8ChFilter.ar(in).gui;
>>> }.play;
>>>
>>> ->
>>>
>>> <pastedGraphic.png>
>>>
>>>
>>> for often used filters that would be awesome (dude!)
>>>
>>> thoughts/implementations, anyone :-)
>>>
>>> regards
>>> Till
>>
>
> Wouter Snoei
>
> info@...
> http://www.woutersnoei.nl
>
>
> _______________________________________________
> sc-users mailing list
>
>
> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own  
interpretation of how modern society is structured: whether actively  
or passively, consciously or unconsciously, he makes choices in this  
regard. He may be conservative or he may subject himself to continual  
renewal; or he may strive for a revolutionary, historical or social  
palingenesis." - Luigi Nono
*/


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by scztt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> btw the impulse response method I already know and tried, but I think
> this one is much more convenient and faster (since it doesn't require
> server<->lang communication). In the end I want to make an EQ
> interface where one can drag around points, so speed is an issue.

There is a little bit of downtime because of lang-server communication -
calculation is minor, a 256 bin fft is more than enough, and only takes a
1/100 of a second or so. But transferring the data back is annoying,
because you can't share buffers across the server<->client boundary... I
was able to make a realtime-ish ui just fine, but it required enough
hoop-jumping that it hurt performance - enough that I wouldn't want to use
it at performance time. The benefit was, it could be applied to arbitrary
ugen chains, not just chains of filters - no coeffs needed.

Shared buffer memory and/or the ability to execute ugens client-side would
be more general solutions to this sort of problem - but those things are
not easy.

- Scott


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by LFSaw :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey,

wonderful that there is so much response to my suggestion :-)
Does this mean that there is something like what I've suggested in the  
BEQSuite?

kind regards
Till

On 01.07.2008, at 00:12, Josh Parmenter wrote:

> I forgot the second part of that thought-
> Wouter... if you do it for the BEQSuite, how do you feel about  
> including it with the package at sc3-plugins?
>
> Josh
>
> On Jun 30, 2008, at 3:05 PM, Wouter Snoei wrote:
>
>> Hi Sciss,
>>
>> that's great, I've been looking for something like this for quite  
>> some time. I'll try and modify it a bit to also get graphics for  
>> the BEQ suite (should be possible right?).
>>
>> now, if I want to combine curves in one for serially connected  
>> filters, would I just need to multiply them with each-other? Or is  
>> there other math involved for that?
>>
>> btw the impulse response method I already know and tried, but I  
>> think this one is much more convenient and faster (since it doesn't  
>> require server<->lang communication). In the end I want to make an  
>> EQ interface where one can drag around points, so speed is an issue.
>>
>> cheers & thanks,
>> Wouter
>>
>> Op 30-jun-2008, om 20:10 heeft Sciss het volgende geschreven:
>>
>>> well, you will need to be able to retrieve the filter coefficients  
>>> for each ugen... i tried to do that for MidEQ by looking into  
>>> FilterUGens.cpp, but i must have done something wrong, as the plot  
>>> is obviously wrong...
>>>
>>> so if you would add the correct coeffs-methods for each ugen, it  
>>> should work:
>>>
>>> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
>>> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0,  
>>> -12 ).collect(_.ampdb).plot
>>> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>
>>> <plusFilter.sc>
>>>
>>> Am 30.06.2008 um 17:23 schrieb LFSaw:
>>>
>>>> Hey Folks,
>>>>
>>>> just thought of something like this:
>>>>
>>>> {
>>>> var in = WhiteNoise.ar;
>>>> 8ChFilter.ar(in).gui;
>>>> }.play;
>>>>
>>>> ->
>>>>
>>>> <pastedGraphic.png>
>>>>
>>>>
>>>> for often used filters that would be awesome (dude!)
>>>>
>>>> thoughts/implementations, anyone :-)
>>>>
>>>> regards
>>>> Till
>>>
>>
>> Wouter Snoei
>>
>> info@...
>> http://www.woutersnoei.nl
>>
>>
>> _______________________________________________
>> sc-users mailing list
>>
>>
>> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>
> ******************************************
> /* Joshua D. Parmenter
> http://www.realizedsound.net/josh/
>
> “Every composer – at all times and in all cases – gives his own  
> interpretation of how modern society is structured: whether actively  
> or passively, consciously or unconsciously, he makes choices in this  
> regard. He may be conservative or he may subject himself to  
> continual renewal; or he may strive for a revolutionary, historical  
> or social palingenesis." - Luigi Nono
> */
>
>
> _______________________________________________
> sc-users mailing list
>
>
> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by Sciss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

also if you use like a five-band EQ for which you want each filter  
curve displayed separately (in different colours for example) along  
with the total transfer function, you would need to create five (six)  
buffers and return them. add the action of the user moving around the  
frequency knob and probably the analytical solution from the IIR  
coefficients is better suited.

the buffer solution would maybe be better for longer FIR filters. but  
also for delay based filters, like Combs, you would need a different  
method to calculate the transfer function (like operating on a  
"sparse" coefficients representation).

cheers, -sciss-


p.s. the problem with extracting the coefficients from  
FilterUGens.cpp is that there seem to be quite some optimized  
algorithms involved that make it hard to get the real coeffcients,  
e.g. loops like

                        zin = ZXP(in);
                        y0 = zin + b1 * y1 + b2 * y2;
                        ZXP(out) = zin + a0 * (y0 - y2);
                        y2 = y1;
                        y1 = y0;

... maybe James McCartney or whoever wrote the filter UGens can shed  
some light on how this calculation works and how to get the basic  
filter coefficients (since "b1" is not really the b1, "a0" not really  
the a0 etc. as far as i understand)




Am 01.07.2008 um 00:37 schrieb scott@...:

>> btw the impulse response method I already know and tried, but I think
>> this one is much more convenient and faster (since it doesn't require
>> server<->lang communication). In the end I want to make an EQ
>> interface where one can drag around points, so speed is an issue.
>
> There is a little bit of downtime because of lang-server  
> communication -
> calculation is minor, a 256 bin fft is more than enough, and only  
> takes a
> 1/100 of a second or so. But transferring the data back is annoying,
> because you can't share buffers across the server<->client  
> boundary... I
> was able to make a realtime-ish ui just fine, but it required enough
> hoop-jumping that it hurt performance - enough that I wouldn't want  
> to use
> it at performance time. The benefit was, it could be applied to  
> arbitrary
> ugen chains, not just chains of filters - no coeffs needed.
>
> Shared buffer memory and/or the ability to execute ugens client-
> side would
> be more general solutions to this sort of problem - but those  
> things are
> not easy.
>
> - Scott
>
>
> _______________________________________________
> sc-users mailing list
>
>
> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/ 
> MusicTechnology/880
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Gui controls for (LTI-)Filters anyone?

by Josh Parmenter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No... but Wouter suggested that there should be. I've been wanting to  
update the BEQSuite for some time, so if Wouter (or others) want to  
add it, I can include it in the update.

Best,

Josh

On Jul 1, 2008, at 4:18 AM, LFSaw wrote:

> Hey,
>
> wonderful that there is so much response to my suggestion :-)
> Does this mean that there is something like what I've suggested in  
> the BEQSuite?
>
> kind regards
> Till
>
> On 01.07.2008, at 00:12, Josh Parmenter wrote:
>
>> I forgot the second part of that thought-
>> Wouter... if you do it for the BEQSuite, how do you feel about  
>> including it with the package at sc3-plugins?
>>
>> Josh
>>
>> On Jun 30, 2008, at 3:05 PM, Wouter Snoei wrote:
>>
>>> Hi Sciss,
>>>
>>> that's great, I've been looking for something like this for quite  
>>> some time. I'll try and modify it a bit to also get graphics for  
>>> the BEQ suite (should be possible right?).
>>>
>>> now, if I want to combine curves in one for serially connected  
>>> filters, would I just need to multiply them with each-other? Or is  
>>> there other math involved for that?
>>>
>>> btw the impulse response method I already know and tried, but I  
>>> think this one is much more convenient and faster (since it  
>>> doesn't require server<->lang communication). In the end I want to  
>>> make an EQ interface where one can drag around points, so speed is  
>>> an issue.
>>>
>>> cheers & thanks,
>>> Wouter
>>>
>>> Op 30-jun-2008, om 20:10 heeft Sciss het volgende geschreven:
>>>
>>>> well, you will need to be able to retrieve the filter  
>>>> coefficients for each ugen... i tried to do that for MidEQ by  
>>>> looking into FilterUGens.cpp, but i must have done something  
>>>> wrong, as the plot is obviously wrong...
>>>>
>>>> so if you would add the correct coeffs-methods for each ugen, it  
>>>> should work:
>>>>
>>>> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
>>>> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0,  
>>>> -12 ).collect(_.ampdb).plot
>>>> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>>
>>>> <plusFilter.sc>
>>>>
>>>> Am 30.06.2008 um 17:23 schrieb LFSaw:
>>>>
>>>>> Hey Folks,
>>>>>
>>>>> just thought of something like this:
>>>>>
>>>>> {
>>>>> var in = WhiteNoise.ar;
>>>>> 8ChFilter.ar(in).gui;
>>>>> }.play;
>>>>>
>>>>> ->
>>>>>
>>>>> <pastedGraphic.png>
>>>>>
>>>>>
>>>>> for often used filters that would be awesome (dude!)
>>>>>
>>>>> thoughts/implementations, anyone :-)
>>>>>
>>>>> regards
>>>>> Till
>>>>
>>>
>>> Wouter Snoei
>>>
>>> info@...
>>> http://www.woutersnoei.nl
>>>
>>>
>>> _______________________________________________
>>> sc-users mailing list
>>>
>>>
>>> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
>>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>>
>> ******************************************
>> /* Joshua D. Parmenter
>> http://www.realizedsound.net/josh/
>>
>> “Every composer – at all times and in all cases – gives his own  
>> interpretation of how modern society is structured: whether  
>> actively or passively, consciously or unconsciously, he makes  
>> choices in this regard. He may be conservative or he may subject  
>> himself to continual renewal; or he may strive for a revolutionary,  
>> historical or social palingenesis." - Luigi Nono
>> */
>>
>>
>> _______________________________________________
>> sc-users mailing list
>>
>>
>> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
>> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>
>
> _______________________________________________
> sc-users mailing list
>
>
> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own  
interpretation of how modern society is structured: whether actively  
or passively, consciously or unconsciously, he makes choices in this  
regard. He may be conservative or he may subject himself to continual  
renewal; or he may strive for a revolutionary, historical or social  
palingenesis." - Luigi Nono
*/


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Parent Message unknown Re: Gui controls for (LTI-)Filters anyone?

by Wouter Snoei-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

well here's my try. It requires sciss's addition to filter (posted  
earlier in this thread). Basically I copied your UGens and renamed  
them to B2LowPass etc. (just for the test version), made them all  
subclass to a B2Filter class, which is itself subclass of Filter. I  
did a few minor changes in the .sc versions of the BEQ's to support  
use outside the server. And the results are:





with these I made a little EQ gui with a fixed low and high shelf and  
a mouse-movable midsweep. Could be optimized, but works - very  
smoothly if I may say so myself :-)

screenshot:
http://www.woutersnoei.nl/eq-gui.jpg

code:

(
~fwin = GUI.window.new( "freqs" ).front;

~uvw = GUI.userView.new( ~fwin, ~fwin.view.bounds.insetBy
(10,10) ).resize_(5);
~uvw.relativeOrigin = false;

~frdb = [1500,-10, 1]; // [freq, db, rq] for midsweep

(
~uvw.mouseDownAction = { |vw,x,y|
        var bounds = vw.bounds;
        var pt;
        var min = 20, max = 22050, range = 24;
        pt = (x@y) - (10@10);
        ~frdb = [
                (10**( [0, bounds.width, pt.x].normalize( min.log10, max.log10 ) )
[2]).clip(40,17500),
                pt.y.linlin( 0, bounds.height, range, range.neg, \none ),
                1 // rq -- change with mod-key?
                ];
        vw.refresh;
        };
       
~uvw.mouseMoveAction = ~uvw.mouseDownAction;
);

(
~uvw.drawFunc = { |vw|
        var freqs, svals, values, bounds, zeroline;
        var freq = 1200, rq = 0.5, db = 12;
        var min = 20, max = 22050, range = 24;
        var vlines = [100,1000,10000];
        var dimvlines = [25,50,75, 250,500,750, 2500,5000,7500];
        var pt;
       
        bounds = vw.bounds;
       
        #freq,db,rq = ~frdb ? [ freq, db, rq ];
       
        freqs = ({|i| i } ! bounds.width);
        freqs = 10**( freqs.normalize( min.log10, max.log10 ) );
       
        values =
                [B2PeakEQ.magResponse( freqs, 44100, freq, rq, db).ampdb,
                 B2LowShelf.magResponse( freqs, 44100, 100, 1, -12).ampdb,
                 B2HiShelf.magResponse( freqs, 44100, 6000, 1, 6).ampdb];
       
        zeroline = 0.linlin(range.neg,range, bounds.height, 0, \none);
       
        svals = values.sum.linlin(range.neg,range, bounds.height, 0, \none);
        values = values.linlin(range.neg,range, bounds.height, 0, \none);
       
        vlines = ([min, max] ++ vlines).log10.normalize(0, bounds.width)[2..];
        dimvlines = ([min, max] ++ dimvlines).log10.normalize(0,  
bounds.width)[2..];
       
        pt = (([min, max] ++ [freq]).log10.normalize(0, bounds.width)[2])@
                        (db.linlin(range.neg,range,bounds.height,0,\none));
       
        GUI.pen.use({
                GUI.pen.translate( 10, 10 );
                GUI.pen.color = Color.red(0.125).alpha_(0.5);
       
                vlines.do({ |vline,i|
                        GUI.pen.line( vline@0, vline@... );
                        });
                GUI.pen.line( 0@zeroline, bounds.width@zeroline ).stroke;

                GUI.pen.color = Color.red(0.125).alpha_(0.125);
               
                dimvlines.do({ |vline,i|
                        GUI.pen.line( vline@0, vline@... );
                        });
               
                GUI.pen.stroke;
               
                GUI.pen.color = Color.blue(0.5);

                GUI.pen.moveTo( 0@(svals[0]) );
                svals[1..].do({ |val, i|
                        GUI.pen.lineTo( (i+1)@val );
                        });
                GUI.pen.stroke;
               
                values.do({ |svals,i|
                        GUI.pen.color = Color.hsv(i.linlin(0,values.size,0,1),
                                0.75, 0.5).alpha_(0.25);
                        GUI.pen.moveTo( 0@(svals[0]) );
                        svals[1..].do({ |val, i|
                                GUI.pen.lineTo( (i+1)@val );
                                });
                        GUI.pen.lineTo( bounds.width@(bounds.height/2) );
                        GUI.pen.lineTo( 0@(bounds.height/2) );
                        GUI.pen.lineTo( 0@(svals[0]) );
                        GUI.pen.fill;
                        });
               
                GUI.pen.color = Color.red(0.5).alpha_(0.5);
               
                GUI.pen.addArc( pt, 3, 0, 2pi ).stroke;
               
                });
       
        }; ~fwin.refresh;
);

)

-----

cheers,
Wouter







Op 1-jul-2008, om 18:06 heeft Josh Parmenter het volgende geschreven:

> No... but Wouter suggested that there should be. I've been wanting  
> to update the BEQSuite for some time, so if Wouter (or others) want  
> to add it, I can include it in the update.
>
> Best,
>
> Josh
>
> On Jul 1, 2008, at 4:18 AM, LFSaw wrote:
>
>> Hey,
>>
>> wonderful that there is so much response to my suggestion :-)
>> Does this mean that there is something like what I've suggested in  
>> the BEQSuite?
>>
>> kind regards
>> Till
>>
>> On 01.07.2008, at 00:12, Josh Parmenter wrote:
>>
>>> I forgot the second part of that thought-
>>> Wouter... if you do it for the BEQSuite, how do you feel about  
>>> including it with the package at sc3-plugins?
>>>
>>> Josh
>>>
>>> On Jun 30, 2008, at 3:05 PM, Wouter Snoei wrote:
>>>
>>>> Hi Sciss,
>>>>
>>>> that's great, I've been looking for something like this for  
>>>> quite some time. I'll try and modify it a bit to also get  
>>>> graphics for the BEQ suite (should be possible right?).
>>>>
>>>> now, if I want to combine curves in one for serially connected  
>>>> filters, would I just need to multiply them with each-other? Or  
>>>> is there other math involved for that?
>>>>
>>>> btw the impulse response method I already know and tried, but I  
>>>> think this one is much more convenient and faster (since it  
>>>> doesn't require server<->lang communication). In the end I want  
>>>> to make an EQ interface where one can drag around points, so  
>>>> speed is an issue.
>>>>
>>>> cheers & thanks,
>>>> Wouter
>>>>
>>>> Op 30-jun-2008, om 20:10 heeft Sciss het volgende geschreven:
>>>>
>>>>> well, you will need to be able to retrieve the filter  
>>>>> coefficients for each ugen... i tried to do that for MidEQ by  
>>>>> looking into FilterUGens.cpp, but i must have done something  
>>>>> wrong, as the plot is obviously wrong...
>>>>>
>>>>> so if you would add the correct coeffs-methods for each ugen,  
>>>>> it should work:
>>>>>
>>>>> ~freqs = Array.geom( 512, 16, 1.014 ); ~sr = 44100;
>>>>> MidEQ.magResponse( ~freqs, ~sr, 1000, 1.0, -12 ).collect
>>>>> (_.ampdb).plot
>>>>> HPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>>> HPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>>> LPZ1.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>>> LPZ2.magResponse( ~freqs, ~sr ).collect(_.ampdb).plot
>>>>>
>>>>> <plusFilter.sc>
>>>>>
>>>>> Am 30.06.2008 um 17:23 schrieb LFSaw:
>>>>>
>>>>>> Hey Folks,
>>>>>>
>>>>>> just thought of something like this:
>>>>>>
>>>>>> {
>>>>>> var in = WhiteNoise.ar;
>>>>>> 8ChFilter.ar(in).gui;
>>>>>> }.play;
>>>>>>
>>>>>> ->
>>>>>>
>>>>>> <pastedGraphic.png>
>>>>>>
>>>>>>
>>>>>> for often used filters that would be awesome (dude!)
>>>>>>
>>>>>> thoughts/implementations, anyone :-)
>>>>>>
>>>>>> regards
>>>>>> Till
>>>>>
>>>>
>>>> Wouter Snoei
>>>>
>>>> info@...
>>>> http://www.woutersnoei.nl
>>>>
>>>>
>>>> _______________________________________________
>>>> sc-users mailing list
>>>>
>>>>
>>>> info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de: 
>>>> 8888/MusicTechnology/880
>>>> archive: