Improve (well, fix) the SC process-wait-query-action code for NMF

nix
Owen Green 7 years ago
parent 021fc1d917
commit 8c0099565f

@ -20,7 +20,6 @@ FluidBufNMF : UGen {
*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, bases, basesMode = 0, activations, actMode = 0, components = 1, iterations = 100, windowSize = 1024, hopSize = -1, fftSize = -1, windowType = 0, randomSeed = -1, action|
var synth;
source = source.asUGenInput;
destination = destination.asUGenInput;
bases = bases.asUGenInput;
@ -32,9 +31,8 @@ FluidBufNMF : UGen {
bases = bases ? -1;
activations = activations ? -1;
synth = {FluidBufNMF.kr(source, startFrame, numFrames, startChan, numChans, destination, bases, basesMode, activations, actMode, components, iterations, windowSize, hopSize, fftSize, doneAction: Done.freeSelf)}.play(server);
synth.waitForFree({ forkIfNeeded{
forkIfNeeded{
{FluidBufNMF.kr(source, startFrame, numFrames, startChan, numChans, destination, bases, basesMode, activations, actMode, components,iterations, windowSize, hopSize, fftSize, doneAction: Done.freeSelf)}.play(server).waitForFree;
server.sync;
if (destination != -1) {
destination = server.cachedBufferAt(destination);
@ -52,6 +50,6 @@ FluidBufNMF : UGen {
server.sync;
} {activations = nil};
action.value(destination, bases, activations);
}});
};
}
}

Loading…
Cancel
Save