working source extraction
parent
d9cf021745
commit
9c2c5a7479
@ -1,7 +1,7 @@
|
|||||||
// adds an instance method to the Buffer class
|
// adds an instance method to the Buffer class
|
||||||
+ Buffer {
|
+ Buffer {
|
||||||
fdNMF { arg dstBuf, rank = 1, fftSize = 2048, windowSize = 2048, hopSize = 512;
|
fdNMF { arg dstBuf, rank = 1, iterations = 100, fftSize = 2048, windowSize = 2048, hopSize = 512;
|
||||||
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
|
if(bufnum.isNil) { Error("Cannot call % on a % that has been freed".format(thisMethod.name, this.class.name)).throw };
|
||||||
server.listSendMsg([\b_gen, dstBuf.bufnum, "BufNMF", bufnum, rank, fftSize, windowSize, hopSize])
|
server.listSendMsg([\b_gen, dstBuf.bufnum, "BufNMF", bufnum, rank, iterations, fftSize, windowSize, hopSize])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,26 @@
|
|||||||
s.quit
|
s.quit
|
||||||
s.boot
|
s.boot
|
||||||
// allocates a 16-sample buffer and fills it with ascending values
|
// allocates a 16-sample buffer and fills it with ascending values
|
||||||
b = Buffer.alloc(s,50000);
|
b = Buffer.read(s,"/Applications/Max.app/Contents/Resources/C74/media/msp/jongly.aif");
|
||||||
b.sine1([0,0,0,0,0,0,0,0,0,1],true,false);
|
b.play;
|
||||||
b.plot;
|
b.plot;
|
||||||
c = Buffer.alloc(s,50000);
|
c = Buffer.alloc(s,b.numFrames,2);
|
||||||
|
|
||||||
// run the code
|
// run the code
|
||||||
b.fdNMF(c, 5, 2048, 1024, 256);
|
b.fdNMF(c,2)
|
||||||
|
|
||||||
// read to check
|
// read to check
|
||||||
c.plot
|
c.plot;
|
||||||
|
{PlayBuf.ar(2,c.bufnum,doneAction:2)}.play
|
||||||
|
|
||||||
|
|
||||||
|
// play a sinewave in the background to see if the server freaks out
|
||||||
|
d = {SinOsc.ar(100,0,0.1)}.play
|
||||||
|
e = Buffer.alloc(s,b.numFrames,5);
|
||||||
|
|
||||||
|
// run the code
|
||||||
|
b.fdNMF(e,5, 150, 2048,1024,256)
|
||||||
|
|
||||||
|
// read to check
|
||||||
|
e.plot;
|
||||||
|
{Splay.ar(PlayBuf.ar(5,e.bufnum,doneAction:2))}.play
|
||||||
Loading…
Reference in New Issue