examples: folder iteration and 2 passes now working fine

nix
Pierre Alexandre Tremblay 7 years ago
parent ab6103d984
commit 050c80286f

@ -2,7 +2,7 @@
(
var fileNames;
c = [0];
c = [];
FileDialog.new({|selection|
var total, totaldur = 0, maxchans = 0;
@ -16,14 +16,11 @@ FileDialog.new({|selection|
SoundFile.use(fp.asAbsolutePath , {
arg file;
var dur = file.numFrames;
c = c.add(dur);
c = c.add(totaldur);
totaldur = totaldur + dur;
maxchans = maxchans.max(file.numChannels);
});
});
c.postln;
totaldur.postln;
maxchans.postln;
Routine{
b = Buffer.alloc(s,totaldur,maxchans);
s.sync;
@ -42,4 +39,7 @@ b.plot
c.postln
b.play
{PlayBuf.ar(1,b.bufnum,startPos:c[740])}.play
Buffer.freeAll

@ -36,3 +36,5 @@ FileDialog.new({|selection|
b.plot
c.postln
b.play
{PlayBuf.ar(1,b.bufnum,startPos:c[740])}.play

Loading…
Cancel
Save