FreeVerb Explosion?

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

FreeVerb Explosion?

by stwbass :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi list,

I'm having a strange problem with a portion of a piece and I'm having a hard time finding out where the bug is because it isn't consistent at all. At some point in the middle of a movement there is an extremely loud pop and all of the output of SC from then on is silent. Sometimes opening a terminal and running top displays no scsynth although the SC application itself still shows the server running with new synths created, etc. This, unfortunately, happened during a performance today. Since my piece uses FreeVerb, with rather reverberant settings, I'm wondering if its possible that FreeVerb blew up because it didn't have enough memory for its delay lines. When I came home I increased the .memSize option and have run the movement a few times without any problems. To further complicate, I tried resetting the memSize back to its default, and (of course) everything ran fine. I'll paste the code below if anyone cares to look.

Has anyone else experienced this type of thing with FreeVerb? I'm also wondering, extremely naively, if there is a way to make FreeVerb fail differently (if FreeVerb is in fact the problem).

In case you can't reproduce the problem, just play it at a concert and I assure you it will fail.

Thanks very much,
sw





//Oddly Problematic Code

s.boot;

(
~roomsize = 0.8;

//waveshapes and synths
~buf1 = Buffer.alloc(s, 1024, bufnum: 20);
~shape1 = Signal.chebyFill(512, [0.1, 0.6, 0.4, 0.3, 0.7, 0.1, 0.4, 0.2, 0.9]).normalizeTransfer;
~buf1.sendCollection(~shape1.asWavetable);

~buf2 = Buffer.alloc(s, 1024, bufnum: 21);
~shape2 = Signal.chebyFill(512, [0.1, 0.8, 0.4, 0.3, 0.1, 0.6, 0.7, 0.5, 0.2, 0.9]).normalizeTransfer;
~buf2.sendCollection(~shape2.asWavetable);

~buf3 = Buffer.alloc(s, 1024, bufnum: 22);
~shape3 = Signal.chebyFill(512, [0.1, 0.7, 0.4, 0.3, 0.1, 0.7, 0.5, 0.6, 0.9]).normalizeTransfer;
~buf3.sendCollection(~shape3.asWavetable);

SynthDef.new(\shape2, {

    arg pitch = 400, bufnum = 20;
   
    var attack, decay, vol, vol2, phase, env, inputSig, shaper, filter, out;
   
    attack = Rand(2, 4);
   
    decay = Rand(2, 3);
   
    vol = Rand(0.1, 0.5);
   
    vol2 = Rand(0.2, 0.6);
   
    phase = Rand(0, 1.9pi);
   
    env = EnvGen.ar(Env.perc(attack, decay, vol2, \sin), levelScale: 0.9,
        doneAction: 2).exprand(0.0001, 1);
       
    inputSig = SinOsc.ar(pitch, phase, vol);
   
    shaper = Shaper.ar(bufnum, inputSig, env);
   
    filter = RLPF.ar(shaper,
        Line.kr(pitch*Rand(8.5, 9), pitch*Rand(0.1, 1), attack+decay*(1/vol)),
        0.5);
       
    #w,x,y = PanB2.ar(filter, Rand(1, -1));
   
    out = DecodeB2.ar(4, w, x, y, 0.5);
   
    Out.ar(30, LeakDC.ar(out) * 1.2)
   
}).send(s);

SynthDef.new(\verb0, {

    var in, verb;
   
    in = In.ar(30, 1);   
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);   

    Out.ar(0, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb1, {

    var in, verb;
   
    in = In.ar(31, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
   
    Out.ar(1, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb2, {

    var in, verb;
   
    in = In.ar(32, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

    Out.ar(3, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb3, {

    var in, verb;

    in = In.ar(33, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

    Out.ar(2, LeakDC.ar(verb))

}).send(s);

)


(
~verb0 = Synth(\verb0); ~verb1 = Synth(\verb1); ~verb2 = Synth(\verb2); ~verb3 = Synth(\verb3);
//problem event
~ev19 = Task{

    ///First Group of pitches
    ~pitches = [50, 52, 54, 55, 56, 57, 59, 61, 62, 64, 66, 67, 68, 69, 71, 73, 74, 76, 78, 79, 80,
    81, 83, 85];
   
    Routine{
   
    32.74.wait;
   
    //Second Group
    ~pitches = [51, 51, 52, 53, 54, 56, 56, 58, 58, 59, 61, 61, 63, 63, 64, 65, 66, 68, 68, 70, 70,
    71, 73, 73, 75, 75, 76, 77, 78, 80, 80, 82, 82, 83, 85, 85];
   
    49.11.wait;
   
    //Third Group
    ~pitches = [51, 51, 53, 54, 56, 58, 60, 61, 63, 63, 65, 66, 68, 70, 72, 73, 75, 75, 77, 78, 80,
    82, 84, 85];
   
    16.37.wait;
   
    //Fourth Group
    ~pitches = [50, 50, 52, 52, 53, 54, 55, 55, 57, 57, 57, 58, 59, 59, 60, 60, 62, 62, 64, 64, 65,
    66, 67, 67, 69, 69, 69, 70, 71, 71, 72, 72, 74, 74, 76, 76, 77, 78, 79, 79, 81, 81, 81, 82, 83,
    83, 84, 84];
   
    49.11.wait;
   
    //Fifth Group
    ~pitches = [50, 53, 55, 60, 62, 65, 67, 72, 74, 77, 79, 84];
   
    32.74.wait;
   
    ~ev19.stop;
   
    10.wait;
   
    nil.alwaysYield;

    }.play;

    loop{
   
        ~adjust = rrand(1, 15);
       
        if( ~adjust<14,
            {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum, 20])},
            {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum, [21, 22].choose])}
        );
       
        if( ~adjust<12,
            {rrand(0.8, 1.8).wait},
            {rrand(0.1, 0.79).wait}
        );
       
    };

    }.play;
)


~verb0.free; ~verb1.free; ~verb2.free; ~verb3.free;








--
Scott Worthington
stwbass@...
www.scottworthington.com

Re: FreeVerb Explosion?

by Josh Parmenter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

sounds to me more like a divide by zero problem somewhere. I haven't heard this myself in FreeVerb, but I imagine part of the problem with debugging has to do with the non-seeded Rand UGens in your code. 

At one time there was something in Shaper that caused some strangeness (if the input hit 1 exactly), but I think that was fixed. How recent is your build?

Best,

Josh

On Apr 19, 2009, at 6:34 PM, Scott Worthington wrote:

Hi list,

I'm having a strange problem with a portion of a piece and I'm having a hard time finding out where the bug is because it isn't consistent at all. At some point in the middle of a movement there is an extremely loud pop and all of the output of SC from then on is silent. Sometimes opening a terminal and running top displays no scsynth although the SC application itself still shows the server running with new synths created, etc. This, unfortunately, happened during a performance today. Since my piece uses FreeVerb, with rather reverberant settings, I'm wondering if its possible that FreeVerb blew up because it didn't have enough memory for its delay lines. When I came home I increased the .memSize option and have run the movement a few times without any problems. To further complicate, I tried resetting the memSize back to its default, and (of course) everything ran fine. I'll paste the code below if anyone cares to look.

Has anyone else experienced this type of thing with FreeVerb? I'm also wondering, extremely naively, if there is a way to make FreeVerb fail differently (if FreeVerb is in fact the problem).

In case you can't reproduce the problem, just play it at a concert and I assure you it will fail.

Thanks very much,
sw





//Oddly Problematic Code

s.boot;

(
~roomsize = 0.8;

//waveshapes and synths
~buf1 = Buffer.alloc(s, 1024, bufnum: 20);
~shape1 = Signal.chebyFill(512, [0.1, 0.6, 0.4, 0.3, 0.7, 0.1, 0.4, 0.2, 0.9]).normalizeTransfer;
~buf1.sendCollection(~shape1.asWavetable);

~buf2 = Buffer.alloc(s, 1024, bufnum: 21);
~shape2 = Signal.chebyFill(512, [0.1, 0.8, 0.4, 0.3, 0.1, 0.6, 0.7, 0.5, 0.2, 0.9]).normalizeTransfer;
~buf2.sendCollection(~shape2.asWavetable);

~buf3 = Buffer.alloc(s, 1024, bufnum: 22);
~shape3 = Signal.chebyFill(512, [0.1, 0.7, 0.4, 0.3, 0.1, 0.7, 0.5, 0.6, 0.9]).normalizeTransfer;
~buf3.sendCollection(~shape3.asWavetable);

SynthDef.new(\shape2, {

    arg pitch = 400, bufnum = 20;
   
    var attack, decay, vol, vol2, phase, env, inputSig, shaper, filter, out;
   
    attack = Rand(2, 4);
   
    decay = Rand(2, 3);
   
    vol = Rand(0.1, 0.5);
   
    vol2 = Rand(0.2, 0.6);
   
    phase = Rand(0, 1.9pi);
   
    env = EnvGen.ar(Env.perc(attack, decay, vol2, \sin), levelScale: 0.9,
        doneAction: 2).exprand(0.0001, 1);
       
    inputSig = SinOsc.ar(pitch, phase, vol);
   
    shaper = Shaper.ar(bufnum, inputSig, env);
   
    filter = RLPF.ar(shaper,
        Line.kr(pitch*Rand(8.5, 9), pitch*Rand(0.1, 1), attack+decay*(1/vol)),
        0.5);
       
    #w,x,y = PanB2.ar(filter, Rand(1, -1));
   
    out = DecodeB2.ar(4, w, x, y, 0.5);
   
    Out.ar(30, LeakDC.ar(out) * 1.2)
   
}).send(s);

SynthDef.new(\verb0, {

    var in, verb;
   
    in = In.ar(30, 1);   
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);   

    Out.ar(0, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb1, {

    var in, verb;
   
    in = In.ar(31, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
   
    Out.ar(1, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb2, {

    var in, verb;
   
    in = In.ar(32, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

    Out.ar(3, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb3, {

    var in, verb;

    in = In.ar(33, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

    Out.ar(2, LeakDC.ar(verb))

}).send(s);

)


(
~verb0 = Synth(\verb0); ~verb1 = Synth(\verb1); ~verb2 = Synth(\verb2); ~verb3 = Synth(\verb3);
//problem event
~ev19 = Task{

    ///First Group of pitches
    ~pitches = [50, 52, 54, 55, 56, 57, 59, 61, 62, 64, 66, 67, 68, 69, 71, 73, 74, 76, 78, 79, 80,
    81, 83, 85];
   
    Routine{
   
    32.74.wait;
   
    //Second Group
    ~pitches = [51, 51, 52, 53, 54, 56, 56, 58, 58, 59, 61, 61, 63, 63, 64, 65, 66, 68, 68, 70, 70,
    71, 73, 73, 75, 75, 76, 77, 78, 80, 80, 82, 82, 83, 85, 85];
   
    49.11.wait;
   
    //Third Group
    ~pitches = [51, 51, 53, 54, 56, 58, 60, 61, 63, 63, 65, 66, 68, 70, 72, 73, 75, 75, 77, 78, 80,
    82, 84, 85];
   
    16.37.wait;
   
    //Fourth Group
    ~pitches = [50, 50, 52, 52, 53, 54, 55, 55, 57, 57, 57, 58, 59, 59, 60, 60, 62, 62, 64, 64, 65,
    66, 67, 67, 69, 69, 69, 70, 71, 71, 72, 72, 74, 74, 76, 76, 77, 78, 79, 79, 81, 81, 81, 82, 83,
    83, 84, 84];
   
    49.11.wait;
   
    //Fifth Group
    ~pitches = [50, 53, 55, 60, 62, 65, 67, 72, 74, 77, 79, 84];
   
    32.74.wait;
   
    ~ev19.stop;
   
    10.wait;
   
    nil.alwaysYield;

    }.play;

    loop{
   
        ~adjust = rrand(1, 15);
       
        if( ~adjust<14,
            {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum, 20])},
            {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum, [21, 22].choose])}
        );
       
        if( ~adjust<12,
            {rrand(0.8, 1.8).wait},
            {rrand(0.1, 0.79).wait}
        );
       
    };

    }.play;
)


~verb0.free; ~verb1.free; ~verb2.free; ~verb3.free;








--
Scott Worthington
stwbass@...
www.scottworthington.com

******************************************

/* 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

*/


Re: FreeVerb Explosion?

by stwbass :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Today 3.3rc ... Since it was happening, I tried using the stable 3.2 release on the sourceforge and had the same problem. Since I had read about the Shaper bug, I used the 3.3rc in the performance. I'm not sure where a divide by zero could occur because the only Rand with a 0 in it is the one for phase, but I'm not sure if you think the divide by zero might be internal.

Thanks again,
sw

On Sun, Apr 19, 2009 at 9:53 PM, Josh Parmenter <josh@...> wrote:
sounds to me more like a divide by zero problem somewhere. I haven't heard this myself in FreeVerb, but I imagine part of the problem with debugging has to do with the non-seeded Rand UGens in your code. 

At one time there was something in Shaper that caused some strangeness (if the input hit 1 exactly), but I think that was fixed. How recent is your build?

Best,

Josh

On Apr 19, 2009, at 6:34 PM, Scott Worthington wrote:

Hi list,

I'm having a strange problem with a portion of a piece and I'm having a hard time finding out where the bug is because it isn't consistent at all. At some point in the middle of a movement there is an extremely loud pop and all of the output of SC from then on is silent. Sometimes opening a terminal and running top displays no scsynth although the SC application itself still shows the server running with new synths created, etc. This, unfortunately, happened during a performance today. Since my piece uses FreeVerb, with rather reverberant settings, I'm wondering if its possible that FreeVerb blew up because it didn't have enough memory for its delay lines. When I came home I increased the .memSize option and have run the movement a few times without any problems. To further complicate, I tried resetting the memSize back to its default, and (of course) everything ran fine. I'll paste the code below if anyone cares to look.

Has anyone else experienced this type of thing with FreeVerb? I'm also wondering, extremely naively, if there is a way to make FreeVerb fail differently (if FreeVerb is in fact the problem).

In case you can't reproduce the problem, just play it at a concert and I assure you it will fail.

Thanks very much,
sw





//Oddly Problematic Code

s.boot;

(
~roomsize = 0.8;

//waveshapes and synths
~buf1 = Buffer.alloc(s, 1024, bufnum: 20);
~shape1 = Signal.chebyFill(512, [0.1, 0.6, 0.4, 0.3, 0.7, 0.1, 0.4, 0.2, 0.9]).normalizeTransfer;
~buf1.sendCollection(~shape1.asWavetable);

~buf2 = Buffer.alloc(s, 1024, bufnum: 21);
~shape2 = Signal.chebyFill(512, [0.1, 0.8, 0.4, 0.3, 0.1, 0.6, 0.7, 0.5, 0.2, 0.9]).normalizeTransfer;
~buf2.sendCollection(~shape2.asWavetable);

~buf3 = Buffer.alloc(s, 1024, bufnum: 22);
~shape3 = Signal.chebyFill(512, [0.1, 0.7, 0.4, 0.3, 0.1, 0.7, 0.5, 0.6, 0.9]).normalizeTransfer;
~buf3.sendCollection(~shape3.asWavetable);

SynthDef.new(\shape2, {

    arg pitch = 400, bufnum = 20;
   
    var attack, decay, vol, vol2, phase, env, inputSig, shaper, filter, out;
   
    attack = Rand(2, 4);
   
    decay = Rand(2, 3);
   
    vol = Rand(0.1, 0.5);
   
    vol2 = Rand(0.2, 0.6);
   
    phase = Rand(0, 1.9pi);
   
    env = EnvGen.ar(Env.perc(attack, decay, vol2, \sin), levelScale: 0.9,
        doneAction: 2).exprand(0.0001, 1);
       
    inputSig = SinOsc.ar(pitch, phase, vol);
   
    shaper = Shaper.ar(bufnum, inputSig, env);
   
    filter = RLPF.ar(shaper,
        Line.kr(pitch*Rand(8.5, 9), pitch*Rand(0.1, 1), attack+decay*(1/vol)),
        0.5);
       
    #w,x,y = PanB2.ar(filter, Rand(1, -1));
   
    out = DecodeB2.ar(4, w, x, y, 0.5);
   
    Out.ar(30, LeakDC.ar(out) * 1.2)
   
}).send(s);

SynthDef.new(\verb0, {

    var in, verb;
   
    in = In.ar(30, 1);   
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);   

    Out.ar(0, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb1, {

    var in, verb;
   
    in = In.ar(31, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
   
    Out.ar(1, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb2, {

    var in, verb;
   
    in = In.ar(32, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

    Out.ar(3, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb3, {

    var in, verb;

    in = In.ar(33, 1);
   
    verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

    Out.ar(2, LeakDC.ar(verb))

}).send(s);

)


(
~verb0 = Synth(\verb0); ~verb1 = Synth(\verb1); ~verb2 = Synth(\verb2); ~verb3 = Synth(\verb3);
//problem event
~ev19 = Task{

    ///First Group of pitches
    ~pitches = [50, 52, 54, 55, 56, 57, 59, 61, 62, 64, 66, 67, 68, 69, 71, 73, 74, 76, 78, 79, 80,
    81, 83, 85];
   
    Routine{
   
    32.74.wait;
   
    //Second Group
    ~pitches = [51, 51, 52, 53, 54, 56, 56, 58, 58, 59, 61, 61, 63, 63, 64, 65, 66, 68, 68, 70, 70,
    71, 73, 73, 75, 75, 76, 77, 78, 80, 80, 82, 82, 83, 85, 85];
   
    49.11.wait;
   
    //Third Group
    ~pitches = [51, 51, 53, 54, 56, 58, 60, 61, 63, 63, 65, 66, 68, 70, 72, 73, 75, 75, 77, 78, 80,
    82, 84, 85];
   
    16.37.wait;
   
    //Fourth Group
    ~pitches = [50, 50, 52, 52, 53, 54, 55, 55, 57, 57, 57, 58, 59, 59, 60, 60, 62, 62, 64, 64, 65,
    66, 67, 67, 69, 69, 69, 70, 71, 71, 72, 72, 74, 74, 76, 76, 77, 78, 79, 79, 81, 81, 81, 82, 83,
    83, 84, 84];
   
    49.11.wait;
   
    //Fifth Group
    ~pitches = [50, 53, 55, 60, 62, 65, 67, 72, 74, 77, 79, 84];
   
    32.74.wait;
   
    ~ev19.stop;
   
    10.wait;
   
    nil.alwaysYield;

    }.play;

    loop{
   
        ~adjust = rrand(1, 15);
       
        if( ~adjust<14,
            {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum, 20])},
            {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum, [21, 22].choose])}
        );
       
        if( ~adjust<12,
            {rrand(0.8, 1.8).wait},
            {rrand(0.1, 0.79).wait}
        );
       
    };

    }.play;
)


~verb0.free; ~verb1.free; ~verb2.free; ~verb3.free;








--
Scott Worthington
stwbass@...
www.scottworthington.com

******************************************

/* 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

*/




--
Scott Worthington
stwbass@...
www.scottworthington.com

Re: FreeVerb Explosion?

by Andrzej Kopeć :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Wiadomość napisana w dniu 2009-04-20, o godz. 03:34, przez Scott  
Worthington:

>  env = EnvGen.ar(Env.perc(attack, decay, vol2, \sin), levelScale: 0.9,
>         doneAction: 2).exprand(0.0001, 1);

What is the purpose od exprand on EnvGen?

ak
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: FreeVerb Explosion?

by Nathaniel Virgo-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I sometimes get a problem that sounds like this when setting the
cutoff of filters (either high pass or low pass) too low.  SC's
filters have strange problems at cutoffs below about 30-40Hz (it's a
shame because I quite often want to sweep a filter so low that it can
no longer be heard).  I notice you have an RLPF with randomised
parameters, which could be the cause of the inconsistency in the error
- what happens if you remove it, or better, change the parameters so
that it's more likely to drop to a low value - does that make the
error happen more often?

Nathaniel



2009/4/20 Scott Worthington <stwbass@...>:

> Hi list,
>
> I'm having a strange problem with a portion of a piece and I'm having a hard
> time finding out where the bug is because it isn't consistent at all. At
> some point in the middle of a movement there is an extremely loud pop and
> all of the output of SC from then on is silent. Sometimes opening a terminal
> and running top displays no scsynth although the SC application itself still
> shows the server running with new synths created, etc. This, unfortunately,
> happened during a performance today. Since my piece uses FreeVerb, with
> rather reverberant settings, I'm wondering if its possible that FreeVerb
> blew up because it didn't have enough memory for its delay lines. When I
> came home I increased the .memSize option and have run the movement a few
> times without any problems. To further complicate, I tried resetting the
> memSize back to its default, and (of course) everything ran fine. I'll paste
> the code below if anyone cares to look.
>
> Has anyone else experienced this type of thing with FreeVerb? I'm also
> wondering, extremely naively, if there is a way to make FreeVerb fail
> differently (if FreeVerb is in fact the problem).
>
> In case you can't reproduce the problem, just play it at a concert and I
> assure you it will fail.
>
> Thanks very much,
> sw
>
>
>
>
>
> //Oddly Problematic Code
>
> s.boot;
>
> (
> ~roomsize = 0.8;
>
> //waveshapes and synths
> ~buf1 = Buffer.alloc(s, 1024, bufnum: 20);
> ~shape1 = Signal.chebyFill(512, [0.1, 0.6, 0.4, 0.3, 0.7, 0.1, 0.4, 0.2,
> 0.9]).normalizeTransfer;
> ~buf1.sendCollection(~shape1.asWavetable);
>
> ~buf2 = Buffer.alloc(s, 1024, bufnum: 21);
> ~shape2 = Signal.chebyFill(512, [0.1, 0.8, 0.4, 0.3, 0.1, 0.6, 0.7, 0.5,
> 0.2, 0.9]).normalizeTransfer;
> ~buf2.sendCollection(~shape2.asWavetable);
>
> ~buf3 = Buffer.alloc(s, 1024, bufnum: 22);
> ~shape3 = Signal.chebyFill(512, [0.1, 0.7, 0.4, 0.3, 0.1, 0.7, 0.5, 0.6,
> 0.9]).normalizeTransfer;
> ~buf3.sendCollection(~shape3.asWavetable);
>
> SynthDef.new(\shape2, {
>
>     arg pitch = 400, bufnum = 20;
>
>     var attack, decay, vol, vol2, phase, env, inputSig, shaper, filter, out;
>
>     attack = Rand(2, 4);
>
>     decay = Rand(2, 3);
>
>     vol = Rand(0.1, 0.5);
>
>     vol2 = Rand(0.2, 0.6);
>
>     phase = Rand(0, 1.9pi);
>
>     env = EnvGen.ar(Env.perc(attack, decay, vol2, \sin), levelScale: 0.9,
>         doneAction: 2).exprand(0.0001, 1);
>
>     inputSig = SinOsc.ar(pitch, phase, vol);
>
>     shaper = Shaper.ar(bufnum, inputSig, env);
>
>     filter = RLPF.ar(shaper,
>         Line.kr(pitch*Rand(8.5, 9), pitch*Rand(0.1, 1),
> attack+decay*(1/vol)),
>         0.5);
>
>     #w,x,y = PanB2.ar(filter, Rand(1, -1));
>
>     out = DecodeB2.ar(4, w, x, y, 0.5);
>
>     Out.ar(30, LeakDC.ar(out) * 1.2)
>
> }).send(s);
>
> SynthDef.new(\verb0, {
>
>     var in, verb;
>
>     in = In.ar(30, 1);
>
>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>
>     Out.ar(0, LeakDC.ar(verb))
>
> }).send(s);
>
> SynthDef.new(\verb1, {
>
>     var in, verb;
>
>     in = In.ar(31, 1);
>
>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>
>     Out.ar(1, LeakDC.ar(verb))
>
> }).send(s);
>
> SynthDef.new(\verb2, {
>
>     var in, verb;
>
>     in = In.ar(32, 1);
>
>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>
>     Out.ar(3, LeakDC.ar(verb))
>
> }).send(s);
>
> SynthDef.new(\verb3, {
>
>     var in, verb;
>
>     in = In.ar(33, 1);
>
>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>
>     Out.ar(2, LeakDC.ar(verb))
>
> }).send(s);
>
> )
>
>
> (
> ~verb0 = Synth(\verb0); ~verb1 = Synth(\verb1); ~verb2 = Synth(\verb2);
> ~verb3 = Synth(\verb3);
> //problem event
> ~ev19 = Task{
>
>     ///First Group of pitches
>     ~pitches = [50, 52, 54, 55, 56, 57, 59, 61, 62, 64, 66, 67, 68, 69, 71,
> 73, 74, 76, 78, 79, 80,
>     81, 83, 85];
>
>     Routine{
>
>     32.74.wait;
>
>     //Second Group
>     ~pitches = [51, 51, 52, 53, 54, 56, 56, 58, 58, 59, 61, 61, 63, 63, 64,
> 65, 66, 68, 68, 70, 70,
>     71, 73, 73, 75, 75, 76, 77, 78, 80, 80, 82, 82, 83, 85, 85];
>
>     49.11.wait;
>
>     //Third Group
>     ~pitches = [51, 51, 53, 54, 56, 58, 60, 61, 63, 63, 65, 66, 68, 70, 72,
> 73, 75, 75, 77, 78, 80,
>     82, 84, 85];
>
>     16.37.wait;
>
>     //Fourth Group
>     ~pitches = [50, 50, 52, 52, 53, 54, 55, 55, 57, 57, 57, 58, 59, 59, 60,
> 60, 62, 62, 64, 64, 65,
>     66, 67, 67, 69, 69, 69, 70, 71, 71, 72, 72, 74, 74, 76, 76, 77, 78, 79,
> 79, 81, 81, 81, 82, 83,
>     83, 84, 84];
>
>     49.11.wait;
>
>     //Fifth Group
>     ~pitches = [50, 53, 55, 60, 62, 65, 67, 72, 74, 77, 79, 84];
>
>     32.74.wait;
>
>     ~ev19.stop;
>
>     10.wait;
>
>     nil.alwaysYield;
>
>     }.play;
>
>     loop{
>
>         ~adjust = rrand(1, 15);
>
>         if( ~adjust<14,
>             {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum,
> 20])},
>             {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum,
> [21, 22].choose])}
>         );
>
>         if( ~adjust<12,
>             {rrand(0.8, 1.8).wait},
>             {rrand(0.1, 0.79).wait}
>         );
>
>     };
>
>     }.play;
> )
>
>
> ~verb0.free; ~verb1.free; ~verb2.free; ~verb3.free;
>
>
>
>
>
>
>
>
> --
> Scott Worthington
> stwbass@...
> www.scottworthington.com
>

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: FreeVerb Explosion?

by Wouter Snoei-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Scott,

my bet is also on the RLPF. You use pitch*Rand(0.1, 1) for the  
destination of the Line.ar, which in some cases (i.e. when pitch <  
56.midicps) can render a value below 20Hz. Most filters will blow up  
if you feed them that. I would advice to put a .max(20) or even better  
a .clip(20,20000) on the Line.kr(..), to guarantee it never goes out  
of range. And I also would suggest using BLowPass instead of RLPF, as  
it is more stable. And if it is still unstable try heightening the  
lower limit.

cheers,
Wouter

Op 20 apr 2009, om 14:04 heeft Nathaniel Virgo het volgende geschreven:

> I sometimes get a problem that sounds like this when setting the
> cutoff of filters (either high pass or low pass) too low.  SC's
> filters have strange problems at cutoffs below about 30-40Hz (it's a
> shame because I quite often want to sweep a filter so low that it can
> no longer be heard).  I notice you have an RLPF with randomised
> parameters, which could be the cause of the inconsistency in the error
> - what happens if you remove it, or better, change the parameters so
> that it's more likely to drop to a low value - does that make the
> error happen more often?
>
> Nathaniel
>
>
>
> 2009/4/20 Scott Worthington <stwbass@...>:
>> Hi list,
>>
>> I'm having a strange problem with a portion of a piece and I'm  
>> having a hard
>> time finding out where the bug is because it isn't consistent at  
>> all. At
>> some point in the middle of a movement there is an extremely loud  
>> pop and
>> all of the output of SC from then on is silent. Sometimes opening a  
>> terminal
>> and running top displays no scsynth although the SC application  
>> itself still
>> shows the server running with new synths created, etc. This,  
>> unfortunately,
>> happened during a performance today. Since my piece uses FreeVerb,  
>> with
>> rather reverberant settings, I'm wondering if its possible that  
>> FreeVerb
>> blew up because it didn't have enough memory for its delay lines.  
>> When I
>> came home I increased the .memSize option and have run the movement  
>> a few
>> times without any problems. To further complicate, I tried  
>> resetting the
>> memSize back to its default, and (of course) everything ran fine.  
>> I'll paste
>> the code below if anyone cares to look.
>>
>> Has anyone else experienced this type of thing with FreeVerb? I'm  
>> also
>> wondering, extremely naively, if there is a way to make FreeVerb fail
>> differently (if FreeVerb is in fact the problem).
>>
>> In case you can't reproduce the problem, just play it at a concert  
>> and I
>> assure you it will fail.
>>
>> Thanks very much,
>> sw
>>
>>
>>
>>
>>
>> //Oddly Problematic Code
>>
>> s.boot;
>>
>> (
>> ~roomsize = 0.8;
>>
>> //waveshapes and synths
>> ~buf1 = Buffer.alloc(s, 1024, bufnum: 20);
>> ~shape1 = Signal.chebyFill(512, [0.1, 0.6, 0.4, 0.3, 0.7, 0.1, 0.4,  
>> 0.2,
>> 0.9]).normalizeTransfer;
>> ~buf1.sendCollection(~shape1.asWavetable);
>>
>> ~buf2 = Buffer.alloc(s, 1024, bufnum: 21);
>> ~shape2 = Signal.chebyFill(512, [0.1, 0.8, 0.4, 0.3, 0.1, 0.6, 0.7,  
>> 0.5,
>> 0.2, 0.9]).normalizeTransfer;
>> ~buf2.sendCollection(~shape2.asWavetable);
>>
>> ~buf3 = Buffer.alloc(s, 1024, bufnum: 22);
>> ~shape3 = Signal.chebyFill(512, [0.1, 0.7, 0.4, 0.3, 0.1, 0.7, 0.5,  
>> 0.6,
>> 0.9]).normalizeTransfer;
>> ~buf3.sendCollection(~shape3.asWavetable);
>>
>> SynthDef.new(\shape2, {
>>
>>     arg pitch = 400, bufnum = 20;
>>
>>     var attack, decay, vol, vol2, phase, env, inputSig, shaper,  
>> filter, out;
>>
>>     attack = Rand(2, 4);
>>
>>     decay = Rand(2, 3);
>>
>>     vol = Rand(0.1, 0.5);
>>
>>     vol2 = Rand(0.2, 0.6);
>>
>>     phase = Rand(0, 1.9pi);
>>
>>     env = EnvGen.ar(Env.perc(attack, decay, vol2, \sin),  
>> levelScale: 0.9,
>>         doneAction: 2).exprand(0.0001, 1);
>>
>>     inputSig = SinOsc.ar(pitch, phase, vol);
>>
>>     shaper = Shaper.ar(bufnum, inputSig, env);
>>
>>     filter = RLPF.ar(shaper,
>>         Line.kr(pitch*Rand(8.5, 9), pitch*Rand(0.1, 1),
>> attack+decay*(1/vol)),
>>         0.5);
>>
>>     #w,x,y = PanB2.ar(filter, Rand(1, -1));
>>
>>     out = DecodeB2.ar(4, w, x, y, 0.5);
>>
>>     Out.ar(30, LeakDC.ar(out) * 1.2)
>>
>> }).send(s);
>>
>> SynthDef.new(\verb0, {
>>
>>     var in, verb;
>>
>>     in = In.ar(30, 1);
>>
>>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>>
>>     Out.ar(0, LeakDC.ar(verb))
>>
>> }).send(s);
>>
>> SynthDef.new(\verb1, {
>>
>>     var in, verb;
>>
>>     in = In.ar(31, 1);
>>
>>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>>
>>     Out.ar(1, LeakDC.ar(verb))
>>
>> }).send(s);
>>
>> SynthDef.new(\verb2, {
>>
>>     var in, verb;
>>
>>     in = In.ar(32, 1);
>>
>>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>>
>>     Out.ar(3, LeakDC.ar(verb))
>>
>> }).send(s);
>>
>> SynthDef.new(\verb3, {
>>
>>     var in, verb;
>>
>>     in = In.ar(33, 1);
>>
>>     verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);
>>
>>     Out.ar(2, LeakDC.ar(verb))
>>
>> }).send(s);
>>
>> )
>>
>>
>> (
>> ~verb0 = Synth(\verb0); ~verb1 = Synth(\verb1); ~verb2 =  
>> Synth(\verb2);
>> ~verb3 = Synth(\verb3);
>> //problem event
>> ~ev19 = Task{
>>
>>     ///First Group of pitches
>>     ~pitches = [50, 52, 54, 55, 56, 57, 59, 61, 62, 64, 66, 67, 68,  
>> 69, 71,
>> 73, 74, 76, 78, 79, 80,
>>     81, 83, 85];
>>
>>     Routine{
>>
>>     32.74.wait;
>>
>>     //Second Group
>>     ~pitches = [51, 51, 52, 53, 54, 56, 56, 58, 58, 59, 61, 61, 63,  
>> 63, 64,
>> 65, 66, 68, 68, 70, 70,
>>     71, 73, 73, 75, 75, 76, 77, 78, 80, 80, 82, 82, 83, 85, 85];
>>
>>     49.11.wait;
>>
>>     //Third Group
>>     ~pitches = [51, 51, 53, 54, 56, 58, 60, 61, 63, 63, 65, 66, 68,  
>> 70, 72,
>> 73, 75, 75, 77, 78, 80,
>>     82, 84, 85];
>>
>>     16.37.wait;
>>
>>     //Fourth Group
>>     ~pitches = [50, 50, 52, 52, 53, 54, 55, 55, 57, 57, 57, 58, 59,  
>> 59, 60,
>> 60, 62, 62, 64, 64, 65,
>>     66, 67, 67, 69, 69, 69, 70, 71, 71, 72, 72, 74, 74, 76, 76, 77,  
>> 78, 79,
>> 79, 81, 81, 81, 82, 83,
>>     83, 84, 84];
>>
>>     49.11.wait;
>>
>>     //Fifth Group
>>     ~pitches = [50, 53, 55, 60, 62, 65, 67, 72, 74, 77, 79, 84];
>>
>>     32.74.wait;
>>
>>     ~ev19.stop;
>>
>>     10.wait;
>>
>>     nil.alwaysYield;
>>
>>     }.play;
>>
>>     loop{
>>
>>         ~adjust = rrand(1, 15);
>>
>>         if( ~adjust<14,
>>             {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps,  
>> \bufnum,
>> 20])},
>>             {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps,  
>> \bufnum,
>> [21, 22].choose])}
>>         );
>>
>>         if( ~adjust<12,
>>             {rrand(0.8, 1.8).wait},
>>             {rrand(0.1, 0.79).wait}
>>         );
>>
>>     };
>>
>>     }.play;
>> )
>>
>>
>> ~verb0.free; ~verb1.free; ~verb2.free; ~verb3.free;
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> Scott Worthington
>> stwbass@...
>> www.scottworthington.com
>>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> 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 (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: FreeVerb Explosion?

by stwbass :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Thanks so much for the tips.

The .exprand was a mistake and was supposed to be .exprange -- strange that this didn't cause immediate failure. I took it out completely now. Although, considering the next paragraph, maybe this was the problem...

The filter problem is odd. I changed the low value for the Line in the RLFP to pitch*Rand(0.01, 0.001) which should be consistently far below the values you both mentioned, and it still runs fine.

Thanks again everyone,
sw


On Mon, Apr 20, 2009 at 9:44 AM, Wouter Snoei <mailinglists@...> wrote:
Hi Scott,

my bet is also on the RLPF. You use pitch*Rand(0.1, 1) for the destination of the Line.ar, which in some cases (i.e. when pitch < 56.midicps) can render a value below 20Hz. Most filters will blow up if you feed them that. I would advice to put a .max(20) or even better a .clip(20,20000) on the Line.kr(..), to guarantee it never goes out of range. And I also would suggest using BLowPass instead of RLPF, as it is more stable. And if it is still unstable try heightening the lower limit.

cheers,
Wouter

Op 20 apr 2009, om 14:04 heeft Nathaniel Virgo het volgende geschreven:


I sometimes get a problem that sounds like this when setting the
cutoff of filters (either high pass or low pass) too low.  SC's
filters have strange problems at cutoffs below about 30-40Hz (it's a
shame because I quite often want to sweep a filter so low that it can
no longer be heard).  I notice you have an RLPF with randomised
parameters, which could be the cause of the inconsistency in the error
- what happens if you remove it, or better, change the parameters so
that it's more likely to drop to a low value - does that make the
error happen more often?

Nathaniel



2009/4/20 Scott Worthington <stwbass@...>:
Hi list,

I'm having a strange problem with a portion of a piece and I'm having a hard
time finding out where the bug is because it isn't consistent at all. At
some point in the middle of a movement there is an extremely loud pop and
all of the output of SC from then on is silent. Sometimes opening a terminal
and running top displays no scsynth although the SC application itself still
shows the server running with new synths created, etc. This, unfortunately,
happened during a performance today. Since my piece uses FreeVerb, with
rather reverberant settings, I'm wondering if its possible that FreeVerb
blew up because it didn't have enough memory for its delay lines. When I
came home I increased the .memSize option and have run the movement a few
times without any problems. To further complicate, I tried resetting the
memSize back to its default, and (of course) everything ran fine. I'll paste
the code below if anyone cares to look.

Has anyone else experienced this type of thing with FreeVerb? I'm also
wondering, extremely naively, if there is a way to make FreeVerb fail
differently (if FreeVerb is in fact the problem).

In case you can't reproduce the problem, just play it at a concert and I
assure you it will fail.

Thanks very much,
sw





//Oddly Problematic Code

s.boot;

(
~roomsize = 0.8;

//waveshapes and synths
~buf1 = Buffer.alloc(s, 1024, bufnum: 20);
~shape1 = Signal.chebyFill(512, [0.1, 0.6, 0.4, 0.3, 0.7, 0.1, 0.4, 0.2,
0.9]).normalizeTransfer;
~buf1.sendCollection(~shape1.asWavetable);

~buf2 = Buffer.alloc(s, 1024, bufnum: 21);
~shape2 = Signal.chebyFill(512, [0.1, 0.8, 0.4, 0.3, 0.1, 0.6, 0.7, 0.5,
0.2, 0.9]).normalizeTransfer;
~buf2.sendCollection(~shape2.asWavetable);

~buf3 = Buffer.alloc(s, 1024, bufnum: 22);
~shape3 = Signal.chebyFill(512, [0.1, 0.7, 0.4, 0.3, 0.1, 0.7, 0.5, 0.6,
0.9]).normalizeTransfer;
~buf3.sendCollection(~shape3.asWavetable);

SynthDef.new(\shape2, {

   arg pitch = 400, bufnum = 20;

   var attack, decay, vol, vol2, phase, env, inputSig, shaper, filter, out;

   attack = Rand(2, 4);

   decay = Rand(2, 3);

   vol = Rand(0.1, 0.5);

   vol2 = Rand(0.2, 0.6);

   phase = Rand(0, 1.9pi);

   env = EnvGen.ar(Env.perc(attack, decay, vol2, \sin), levelScale: 0.9,
       doneAction: 2).exprand(0.0001, 1);

   inputSig = SinOsc.ar(pitch, phase, vol);

   shaper = Shaper.ar(bufnum, inputSig, env);

   filter = RLPF.ar(shaper,
       Line.kr(pitch*Rand(8.5, 9), pitch*Rand(0.1, 1),
attack+decay*(1/vol)),
       0.5);

   #w,x,y = PanB2.ar(filter, Rand(1, -1));

   out = DecodeB2.ar(4, w, x, y, 0.5);

   Out.ar(30, LeakDC.ar(out) * 1.2)

}).send(s);

SynthDef.new(\verb0, {

   var in, verb;

   in = In.ar(30, 1);

   verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

   Out.ar(0, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb1, {

   var in, verb;

   in = In.ar(31, 1);

   verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

   Out.ar(1, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb2, {

   var in, verb;

   in = In.ar(32, 1);

   verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

   Out.ar(3, LeakDC.ar(verb))

}).send(s);

SynthDef.new(\verb3, {

   var in, verb;

   in = In.ar(33, 1);

   verb = FreeVerb.ar(in, 0.4, ~roomSize, 0.3);

   Out.ar(2, LeakDC.ar(verb))

}).send(s);

)


(
~verb0 = Synth(\verb0); ~verb1 = Synth(\verb1); ~verb2 = Synth(\verb2);
~verb3 = Synth(\verb3);
//problem event
~ev19 = Task{

   ///First Group of pitches
   ~pitches = [50, 52, 54, 55, 56, 57, 59, 61, 62, 64, 66, 67, 68, 69, 71,
73, 74, 76, 78, 79, 80,
   81, 83, 85];

   Routine{

   32.74.wait;

   //Second Group
   ~pitches = [51, 51, 52, 53, 54, 56, 56, 58, 58, 59, 61, 61, 63, 63, 64,
65, 66, 68, 68, 70, 70,
   71, 73, 73, 75, 75, 76, 77, 78, 80, 80, 82, 82, 83, 85, 85];

   49.11.wait;

   //Third Group
   ~pitches = [51, 51, 53, 54, 56, 58, 60, 61, 63, 63, 65, 66, 68, 70, 72,
73, 75, 75, 77, 78, 80,
   82, 84, 85];

   16.37.wait;

   //Fourth Group
   ~pitches = [50, 50, 52, 52, 53, 54, 55, 55, 57, 57, 57, 58, 59, 59, 60,
60, 62, 62, 64, 64, 65,
   66, 67, 67, 69, 69, 69, 70, 71, 71, 72, 72, 74, 74, 76, 76, 77, 78, 79,
79, 81, 81, 81, 82, 83,
   83, 84, 84];

   49.11.wait;

   //Fifth Group
   ~pitches = [50, 53, 55, 60, 62, 65, 67, 72, 74, 77, 79, 84];

   32.74.wait;

   ~ev19.stop;

   10.wait;

   nil.alwaysYield;

   }.play;

   loop{

       ~adjust = rrand(1, 15);

       if( ~adjust<14,
           {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum,
20])},
           {Synth.new(\shape2, [\pitch, ~pitches.choose.midicps, \bufnum,
[21, 22].choose])}
       );

       if( ~adjust<12,
           {rrand(0.8, 1.8).wait},
           {rrand(0.1, 0.79).wait}
       );

   };

   }.play;
)


~verb0.free; ~verb1.free; ~verb2.free; ~verb3.free;








--
Scott Worthington
stwbass@...
www.scottworthington.com


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
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 (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/



--
Scott Worthington
stwbass@...
www.scottworthington.com