Merge branch 'clients/inter_client_comms' into log-scaling
commit
0a721df271
@ -0,0 +1,47 @@
|
||||
FluidBufSTFT : FluidBufProcessor {
|
||||
|
||||
*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, magnitudeBuffer, phaseBuffer, resynthesisBuffer, inverse = 0,windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 1|
|
||||
|
||||
// source = source.asUGenInput;
|
||||
|
||||
// source.isNil.if {"FluidBufScale: Invalid source buffer".throw};
|
||||
source = source ? -1;
|
||||
magnitudeBuffer = magnitudeBuffer ? -1;
|
||||
phaseBuffer = phaseBuffer ? -1;
|
||||
resynthesisBuffer = resynthesisBuffer ? - 1;
|
||||
|
||||
^FluidProxyUgen.kr(\FluidBufSTFTTrigger, -1, source, startFrame, numFrames, startChan, magnitudeBuffer, phaseBuffer, resynthesisBuffer, inverse, windowSize, hopSize, fftSize,trig, blocking);
|
||||
}
|
||||
|
||||
*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, magnitudeBuffer, phaseBuffer, resynthesisBuffer, inverse = 0, windowSize = 1024, hopSize = -1, fftSize = -1,freeWhenDone = true, action|
|
||||
|
||||
// source = source.asUGenInput;
|
||||
|
||||
// source.isNil.if {"FluidBufSTFT: Invalid source buffer".throw};
|
||||
source = source ? -1;
|
||||
magnitudeBuffer = magnitudeBuffer ? -1;
|
||||
phaseBuffer = phaseBuffer ? -1;
|
||||
resynthesisBuffer = resynthesisBuffer ? - 1;
|
||||
|
||||
^this.new(
|
||||
server, nil, [magnitudeBuffer,phaseBuffer,resynthesisBuffer].select{|b| b != -1}
|
||||
).processList(
|
||||
[source, startFrame, numFrames, startChan, magnitudeBuffer, phaseBuffer, resynthesisBuffer, inverse, windowSize, hopSize, fftSize, 0], freeWhenDone, action
|
||||
);
|
||||
}
|
||||
|
||||
*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, magnitudeBuffer, phaseBuffer, resynthesisBuffer, inverse = 0, windowSize = 1024, hopSize = -1, fftSize = -1,freeWhenDone = true, action|
|
||||
|
||||
// source = source.asUGenInput;
|
||||
source = source ? -1;
|
||||
magnitudeBuffer = magnitudeBuffer ? -1;
|
||||
phaseBuffer = phaseBuffer ? -1;
|
||||
resynthesisBuffer = resynthesisBuffer ? - 1;
|
||||
|
||||
^this.new(
|
||||
server, nil, [magnitudeBuffer,phaseBuffer,resynthesisBuffer].select{|b| b != -1}
|
||||
).processList(
|
||||
[source, startFrame, numFrames, startChan, magnitudeBuffer, phaseBuffer, resynthesisBuffer, inverse, windowSize, hopSize, fftSize,1], freeWhenDone, action
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
FluidBufSelect : FluidBufProcessor {
|
||||
|
||||
*kr { |source, destination, indices=#[-1], channels=#[-1], trig = 1, blocking = 1|
|
||||
|
||||
var params;
|
||||
|
||||
source = source.asUGenInput;
|
||||
destination = destination.asUGenInput;
|
||||
|
||||
indices = indices.asArray;
|
||||
channels = channels.asArray;
|
||||
|
||||
indices = [indices.size] ++ indices;
|
||||
channels = [channels.size] ++ channels;
|
||||
|
||||
source.isNil.if {"FluidBufSelect: Invalid source buffer".throw};
|
||||
destination.isNil.if {"FluidBufSelect: Invalid destination buffer".throw};
|
||||
|
||||
params = indices ++ channels ++ [trig, blocking]
|
||||
|
||||
^FluidProxyUgen.kr(\FluidBufSelectTrigger,-1, source, destination, *params);
|
||||
}
|
||||
|
||||
|
||||
*process { |server, source, destination, indices=#[-1], channels=#[-1], freeWhenDone = true, action|
|
||||
|
||||
source = source.asUGenInput;
|
||||
destination = destination.asUGenInput;
|
||||
|
||||
source.isNil.if {"FluidBufSelect: Invalid source buffer".throw};
|
||||
destination.isNil.if {"FluidBufSelect: Invalid destination buffer".throw};
|
||||
|
||||
|
||||
indices = indices.asArray;
|
||||
channels = channels.asArray;
|
||||
|
||||
|
||||
|
||||
indices = [indices.size] ++ indices;
|
||||
channels = [channels.size] ++ channels;
|
||||
|
||||
indices.postln;
|
||||
|
||||
^this.new(server, nil, [destination]).processList([source, destination]++ indices ++ channels ++ [1], freeWhenDone, action);//NB always blocking
|
||||
}
|
||||
|
||||
*processBlocking { |server, source, destination, indices=#[-1], channels=#[-1], freeWhenDone = true, action|
|
||||
|
||||
source = source.asUGenInput;
|
||||
destination = destination.asUGenInput;
|
||||
|
||||
source.isNil.if {"FluidBufSelect: Invalid source buffer".throw};
|
||||
destination.isNil.if {"FluidBufSelect: Invalid destination buffer".throw};
|
||||
|
||||
indices = indices.asArray;
|
||||
channels = channels.asArray;
|
||||
|
||||
indices = [indices.size] ++ indices;
|
||||
channels = [channels.size] ++ channels;
|
||||
|
||||
|
||||
^this.new(
|
||||
server, nil, [destination]
|
||||
).processList([source, destination]++ indices ++ channels ++ [1], freeWhenDone, action);//NB always blocking
|
||||
}
|
||||
}
|
||||
FluidBufSelectTrigger : FluidProxyUgen {}
|
||||
@ -0,0 +1,44 @@
|
||||
FluidBufSelectEvery : FluidBufProcessor {
|
||||
|
||||
*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, frameHop = 1, channelHop = 1, trig = 1, blocking = 1|
|
||||
|
||||
source = source.asUGenInput;
|
||||
destination = destination.asUGenInput;
|
||||
|
||||
source.isNil.if {"FluidBufSelectEvery: Invalid source buffer".throw};
|
||||
destination.isNil.if {"FluidBufSelectEvery: Invalid destination buffer".throw};
|
||||
|
||||
^FluidProxyUgen.kr(\FluidBufSelectEveryTrigger, -1, source, startFrame, numFrames, startChan, numChans, destination, frameHop, channelHop, trig, blocking);
|
||||
}
|
||||
|
||||
*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, frameHop = 1, channelHop = 1, freeWhenDone = true, action|
|
||||
|
||||
source = source.asUGenInput;
|
||||
destination = destination.asUGenInput;
|
||||
|
||||
source.isNil.if {"FluidBufSelectEvery: Invalid source buffer".throw};
|
||||
destination.isNil.if {"FluidBufSelectEvery: Invalid destination buffer".throw};
|
||||
|
||||
^this.new(
|
||||
server, nil, [destination]
|
||||
).processList(
|
||||
[source, startFrame, numFrames, startChan, numChans, destination, frameHop, channelHop, 0], freeWhenDone, action
|
||||
);
|
||||
}
|
||||
|
||||
*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, frameHop = 1, channelHop = 1, freeWhenDone = true, action|
|
||||
|
||||
source = source.asUGenInput;
|
||||
destination = destination.asUGenInput;
|
||||
|
||||
source.isNil.if {"FluidBufSelectEvery: Invalid source buffer".throw};
|
||||
destination.isNil.if {"FluidBufSelectEvery: Invalid destination buffer".throw};
|
||||
|
||||
^this.new(
|
||||
server, nil, [destination]
|
||||
).processList(
|
||||
[source, startFrame, numFrames, startChan, numChans, destination, frameHop, channelHop, 1], freeWhenDone, action
|
||||
);
|
||||
}
|
||||
}
|
||||
FluidBufSelectEveryTrigger : FluidProxyUgen {}
|
||||
@ -0,0 +1,154 @@
|
||||
TITLE:: FluidBufSTFT
|
||||
summary:: (put short description here)
|
||||
categories:: Undocumented classes, UGens>Undocumented
|
||||
related:: Classes/SomeRelatedClass, Reference/SomeRelatedStuff, etc.
|
||||
|
||||
DESCRIPTION::
|
||||
(put long description here)
|
||||
|
||||
CLASSMETHODS::
|
||||
|
||||
METHOD:: processBlocking
|
||||
(describe method here)
|
||||
|
||||
ARGUMENT:: server
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: source
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: startFrame
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: numFrames
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: startChan
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: magnitudeBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: phaseBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: resynthesisBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: inverse
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: freeWhenDone
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: action
|
||||
(describe argument here)
|
||||
|
||||
returns:: (describe returnvalue here)
|
||||
|
||||
METHOD:: process
|
||||
(describe method here)
|
||||
|
||||
ARGUMENT:: server
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: source
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: startFrame
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: numFrames
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: startChan
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: magnitudeBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: phaseBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: resynthesisBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: inverse
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: freeWhenDone
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: action
|
||||
(describe argument here)
|
||||
|
||||
returns:: (describe returnvalue here)
|
||||
|
||||
METHOD:: kr
|
||||
(describe method here)
|
||||
|
||||
ARGUMENT:: source
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: startFrame
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: numFrames
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: startChan
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: magnitudeBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: phaseBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: resynthesisBuffer
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: inverse
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: trig
|
||||
(describe argument here)
|
||||
|
||||
ARGUMENT:: blocking
|
||||
(describe argument here)
|
||||
|
||||
returns:: (describe returnvalue here)
|
||||
|
||||
|
||||
INSTANCEMETHODS::
|
||||
|
||||
|
||||
EXAMPLES::
|
||||
|
||||
code::
|
||||
s.reboot
|
||||
(
|
||||
b = Buffer.read(s,File.realpath(FluidBufSTFT.class.filenameSymbol).dirname.withTrailingSlash ++ "../AudioFiles/Tremblay-AaS-AcousticStrums-M.wav");
|
||||
m = Buffer.new;
|
||||
p = Buffer.new;
|
||||
r = Buffer.new;
|
||||
)
|
||||
b
|
||||
(
|
||||
fork{
|
||||
FluidBufSTFT.process(s,source:b,magnitudeBuffer:m,phaseBuffer:p).wait;
|
||||
FluidBufSTFT.process(s,magnitudeBuffer:m,phaseBuffer:p,resynthesisBuffer:r,inverse:1).wait;
|
||||
"Done".postln;
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
{ PlayBuf.ar(1,r); }.play
|
||||
|
||||
//null?
|
||||
{ PlayBuf.ar(1,r) - PlayBuf(1,b); }.play
|
||||
|
||||
|
||||
|
||||
|
||||
::
|
||||
Loading…
Reference in New Issue