Quantcast

array of delays

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

array of delays

Jeroen
Hello list,

I have a little problem that I don't see thru. It is part of an
alternating circuit having a delay synth builtin, which will change
pattern times and output every N seconds. That part is working, but I
cannot explain myself why the bit of code below is not working although
in Tree View all parameters are changed, and seem to be sane.

It is probably very trivial, but I would be terribly happy if somebody
could give me a direction here, after spending a couple of hours on it
(btw I get the same result when filling the array with .fill, or when
using .put)

thanks in advance, Jeroen


<code>

o = s.options;
o.memSize = 2.pow(16);
o.outDevice = "Built-in Output";
s.reboot;

o.memSize;
// simple delay circuit
(
SynthDef(\circuitA, {
    |in = 0, out = 0, del = 1, mul = 1, amp = 0.1|
    var snd;
    snd = DelayN.ar( SoundIn.ar(in, 1), del/1000, del/1000, 1, 0);
    Out.ar(out, snd * amp);
}).add;
)
// data for the delay feed, to be altered every N seconds
(
~data = Dictionary.new;
    ~data.add(\output -> [[0],[1]]);
    ~data.add(\N -> 4150);
    ~data.add(\d -> [     [    [130, 0.6],
                                [260, 0.4],
                                [390, 0.4],
                                [520, 0.5],
                                [650, 0.3],
                                [910, 0.4],
                                [1170, 0.2],
                                [1300, 0.2],
                                [1560, 0.2],
                                [1690, 0.3],
                                [1820, 0.1],
                                [1950, 0.1],
                                [2080, 0.1] ],
                               
                            [    [130, 0.6],
                                [260, 0.4],
                                [520, 0.5],
                                [780, 0.3],
                                [910, 0.3],
                                [1170, 0.3],
                                [1300, 0.4],
                                [1430, 0.2],
                                [1560, 0.2],
                                [1690, 0.2],
                                [2460, 0.3],
                                [2590, 0.1],
                                [2720, 0.1]    ],
                               
                            [    [130, 0.6],
                                [390, 0.4],
                                [520, 0.4],
                                [780, 0.4],
                                [910, 0.5],
                                [1040, 0.3],
                                [1170, 0.3],
                                [1300, 0.3],
                                [2070, 0.4],
                                [2200, 0.2],
                                [2330, 0.2],
                                [3100, 0.3],
                                [3230, 0.1]    ],
                               
                            [    [130, 0.6],
                                [260, 0.4],
                                [390, 0.4],
                                [520, 0.4],
                                [1290, 0.5],
                                [1420, 0.3],
                                [1550, 0.3],
                                [2320, 0.4],
                                [2450, 0.2],
                                [3480, 0.3],
                                [3740, 0.1],
                                [3870, 0.1],
                                [4000, 0.1]    ]
                                ]);

)
~synthA = Array.newClear(~data.at(\d)[0].size);
// this approach does not work
~synthA = {Synth(\circuitA, addAction:
\addToTail);}.dup(~data.at(\d)[0].size);
// del times are set, as well as output (in Tree View visible), audio
comes thru, but no delays
~synthA.do{ |i, index|
    postf("i = % index = %\n", i , index);
    ~synthA[index].set(\del, ~data.at(\d)[1][index][0], \amp,
~data.at(\d)[1][index][1], \out, 1, \in, 0 );
}

// Trying to set a single synth doesn't work either (although times and
output can be seen set in Tree View)
~synthA[0] = Synth(\circuitA, addAction: \addToTail);


// delay doesn't work although output is set
~synthA[0].set(\del, 800, \out, 1, \in, 0);

<\code>



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: array of delays

daniel-mayer

Hi,

you are initializing the maximum delaytime with 1 millisecond.
You have to give an appropriate max at synth init time.

With a lot of delay ugens this will become memory-consuming.
So rather rewrite your synthdef with multichannel delaytimes and amps.

Regards

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: array of delays

Jeroen

Ah, sh... I see, didn't realize that once initialized, that apparently cannot be altered anymore..

Thanks!!

Yes, I will look into one multichannel delay time...

Best, Jeroen



On 13.02.2017 02:08, Daniel Mayer wrote:
you are initializing the maximum delaytime with 1 millisecond.
You have to give an appropriate max at synth init time.


signature.asc (836 bytes) Download Attachment
Loading...