[sc-users] Disk in ...
Dan Stowell
danstowell at gmail.com
Fri Feb 1 09:17:20 PST 2008
Using "the same" DiskIn (actually the same Buffer, in your example)
multiple times is a bad idea, I think it can cause conflicts. Instead,
you create the DiskIn once, and send what it does to a Bus. Then you
can create as many synths as you like, all reading from the Bus.
s.boot
b = Buffer.cueSoundFile(s, "sounds/a11wlk01-44_1.aiff", 0, 1);
~sourcebus = Bus.audio(s, 1);
(
// Three synths: one reads from disk, two process it
c = { Out.ar(~sourcebus, DiskIn.ar(1, b.bufnum)) }.play;
x = {
var din;
din = In.ar(~sourcebus, 1);
[din*SinOsc.ar(100),din*SinOsc.ar(200)]
}.play(addAction:\addToTail);
y = { var din = In.ar(~sourcebus, 1);
[din*SinOsc.ar(300),din*SinOsc.ar(550)]
}.play(addAction:\addToTail);
)
The difference is that rather than trying to get multiple processes to
do the disk-reading, only one does it. This is more efficient and less
prone to go wrong!
Dan
2008/2/1, Miguel Negrao <x.miguel at catastropha.org>:
>
> Thanks for the advice. Actually my problem is that i wanted to to lots of
> different processing things to the same DiskIn, but it can be done by doing:
>
>
> b = Buffer.cueSoundFile(s, "sounds/a11wlk01-44_1.aiff", 0, 1);
> c = { DiskIn.ar(1, b.bufnum) };
>
>
> x = { var din = c.value;
> [din*sinOsc.ar(100),din*SinOsc.ar(200)]
>
> }.play;
>
> just as an example
>
> Miguel
>
> paul escreveu:
>
> Hi Miguel,
>
>
> I'm not sure if this is useful to you, but I often define a separate
> function first, and then use myFunction.value when I create the sythdef to
> be played.
>
>
> So, if I change your code to make c into a function, and put c.value in the
> synthdef, then it plays ok:
>
>
>
>
>
> b = Buffer.cueSoundFile(s, "sounds/a11wlk01-44_1.aiff", 0, 1);
> c = { DiskIn.ar(1, b.bufnum) };
>
>
> x = {c.value }.play;
>
>
>
>
> Cheers,
>
>
> Paul
>
>
>
>
> On 31 Jan 2008, at 13:51, James Harkins wrote:
>
>
>
> It doesn't work because the UGen object is not just a placeholder for the
> operation on the server. It also keeps track of its connections to other
> UGens in the same synthdef. That means the DiskIn object has to be created
> while building the synthdef -- that is, inside the synthdef function.
>
>
> If you create it outside the function, it doesn't really belong to the
> synthdef and it won't know how to talk to other UGens in the same def.
>
>
> The important point to take away from this is that a synthdef is really a
> small world by itself -- you can't smuggle things from outside that world
> into it freely.
>
>
> hjh
>
>
> On Jan 27, 2008, at 7:08 PM, Miguel Negrao wrote:
>
>
> also,
>
>
> why does this work:
>
>
> b = Buffer.cueSoundFile(s, "sounds/a11wlk01-44_1.aiff", 0, 1);
>
>
> x = { DiskIn.ar(1, b.bufnum) }.play;
>
>
> and this doesn't work :
>
>
> b = Buffer.cueSoundFile(s, "sounds/a11wlk01-44_1.aiff", 0, 1);
> c = DiskIn.ar(1, b.bufnum) ;
>
>
> x = {c }.play;
>
>
> ?
>
>
> Thanks
>
>
>
> : H. James Harkins
> : jamshark70 at dewdrop-world.net
> : 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
> sc-users at create.ucsb.edu
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>
> ________________________________
>
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>
>
>
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>
>
--
http://www.mcld.co.uk
More information about the sc-users
mailing list