Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions release-packaging/Classes/FluidBufAmpFeature.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@ FluidBufAmpFeature : FluidBufProcessor {

*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, fastRampUp = 1, fastRampDown = 1, slowRampUp = 100, slowRampDown = 100, floor = -144, highPassFreq = 85, trig = 1, blocking = 0|

source = source.asUGenInput;
features = features.asUGenInput;

source.isNil.if {"FluidBufAmpFeature: Invalid source buffer".throw};
features.isNil.if {"FluidBufAmpFeature: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^FluidProxyUgen.kr(\FluidBufAmpFeatureTrigger, -1, source, startFrame, numFrames, startChan, numChans, features, fastRampUp, fastRampDown, slowRampUp, slowRampDown, floor, highPassFreq, trig, blocking);
}

*process { |server,source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, fastRampUp = 1, fastRampDown = 1, slowRampUp = 100, slowRampDown = 100, floor = -144, highPassFreq = 85, freeWhenDone = true, action |

source = source.asUGenInput;
features = features.asUGenInput;

source.isNil.if {"FluidBufAmpFeature: Invalid source buffer".throw};
features.isNil.if {"FluidBufAmpFeature: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^this.new(server, nil, [features]).processList(
[source, startFrame, numFrames, startChan, numChans, features, fastRampUp, fastRampDown, slowRampUp, slowRampDown, floor, highPassFreq,0],freeWhenDone, action
Expand All @@ -26,11 +20,8 @@ FluidBufAmpFeature : FluidBufProcessor {

*processBlocking { |server,source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, fastRampUp = 1, fastRampDown = 1, slowRampUp = 100, slowRampDown = 100, floor = -144, highPassFreq = 85, freeWhenDone = true, action |

source = source.asUGenInput;
features = features.asUGenInput;

source.isNil.if {"FluidBufAmpFeature: Invalid source buffer".throw};
features.isNil.if {"FluidBufAmpFeature: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^this.new(server, nil, [features]).processList(
[source, startFrame, numFrames, startChan, numChans, features, fastRampUp, fastRampDown, slowRampUp, slowRampDown, floor, highPassFreq,1],freeWhenDone, action
Expand Down
12 changes: 6 additions & 6 deletions release-packaging/Classes/FluidBufAmpGate.sc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FluidBufAmpGate : FluidBufProcessor {

var maxSize = max(minLengthAbove + lookBack, max(minLengthBelow,lookAhead));

source = source.asUGenInput;
indices = indices.asUGenInput;
source = this.validateBuffer(source, "source");
indices = this.validateBuffer(indices, "indices");

^FluidProxyUgen.kr(\FluidBufAmpGateTrigger,-1, source, startFrame, numFrames, startChan, numChans, indices, rampUp, rampDown, onThreshold, offThreshold, minSliceLength, minSilenceLength, minLengthAbove, minLengthBelow, lookBack, lookAhead, highPassFreq,maxSize, trig, blocking);
}
Expand All @@ -15,8 +15,8 @@ FluidBufAmpGate : FluidBufProcessor {

var maxSize = max(minLengthAbove + lookBack, max(minLengthBelow,lookAhead));

source = source ? -1;
indices = indices ? -1;
source = this.validateBuffer(source, "source");
indices = this.validateBuffer(indices, "indices");

^this.new(
server, nil, [indices]
Expand All @@ -30,8 +30,8 @@ FluidBufAmpGate : FluidBufProcessor {

var maxSize = max(minLengthAbove + lookBack, max(minLengthBelow,lookAhead));

source = source ? -1;
indices = indices ? -1;
source = this.validateBuffer(source, "source");
indices = this.validateBuffer(indices, "indices");

^this.new(
server, nil, [indices]
Expand Down
21 changes: 6 additions & 15 deletions release-packaging/Classes/FluidBufAmpSlice.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@ FluidBufAmpSlice : FluidBufProcessor {

*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, fastRampUp = 1, fastRampDown = 1, slowRampUp = 100, slowRampDown = 100, onThreshold = -144, offThreshold = -144, floor = -144, minSliceLength = 2, highPassFreq = 85, trig = 1, blocking = 0|

source = source.asUGenInput;
indices = indices.asUGenInput;

source.isNil.if {"FluidBufAmpSlice: Invalid source buffer".throw};
indices.isNil.if {"FluidBufAmpSlice: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
indices = this.validateBuffer(indices, "indices");

^FluidProxyUgen.kr(\FluidBufAmpSliceTrigger, -1, source, startFrame, numFrames, startChan, numChans, indices, fastRampUp, fastRampDown, slowRampUp, slowRampDown, onThreshold, offThreshold, floor, minSliceLength, highPassFreq, trig, blocking);
}

*process { |server,source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, fastRampUp = 1, fastRampDown = 1, slowRampUp = 100, slowRampDown = 100, onThreshold = -144, offThreshold = -144, floor = -144, minSliceLength = 2, highPassFreq = 85, freeWhenDone = true, action |

source = source.asUGenInput;
indices = indices.asUGenInput;

source.isNil.if {"FluidBufAmpSlice: Invalid source buffer".throw};
indices.isNil.if {"FluidBufAmpSlice: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
indices = this.validateBuffer(indices, "indices");

^this.new(server, nil, [indices]).processList(
[source, startFrame, numFrames, startChan, numChans, indices, fastRampUp, fastRampDown, slowRampUp, slowRampDown, onThreshold, offThreshold, floor, minSliceLength, highPassFreq,0],freeWhenDone, action
Expand All @@ -26,11 +20,8 @@ FluidBufAmpSlice : FluidBufProcessor {

*processBlocking { |server,source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, fastRampUp = 1, fastRampDown = 1, slowRampUp = 100, slowRampDown = 100, onThreshold = -144, offThreshold = -144, floor = -144, minSliceLength = 2, highPassFreq = 85, freeWhenDone = true, action |

source = source.asUGenInput;
indices = indices.asUGenInput;

source.isNil.if {"FluidBufAmpSlice: Invalid source buffer".throw};
indices.isNil.if {"FluidBufAmpSlice: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
indices = this.validateBuffer(indices, "indices");

^this.new(server, nil, [indices]).processList(
[source, startFrame, numFrames, startChan, numChans, indices, fastRampUp, fastRampDown, slowRampUp, slowRampDown, onThreshold, offThreshold, floor, minSliceLength, highPassFreq,1],freeWhenDone, action
Expand Down
30 changes: 9 additions & 21 deletions release-packaging/Classes/FluidBufAudioTransport.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ FluidBufAudioTransport : FluidBufProcessor {
*kr { |sourceA, startFrameA = 0, numFramesA = -1, startChanA = 0, numChansA = -1, sourceB, startFrameB = 0, numFramesB = -1, startChanB = 0, numChansB = -1, destination, interpolation = 0.0, windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 0|

var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};
sourceA.isNil.if {"FluidAudioTransport: Invalid source 1 buffer".throw};
sourceB.isNil.if {"FluidAudioTransport: Invalid source 2 buffer".throw};
sourceA = sourceA.asUGenInput;
sourceB = sourceB.asUGenInput;

destination.isNil.if {"FluidAudioTransport: Invalid destination buffer".throw};
destination = destination.asUGenInput;
sourceA = this.validateBuffer(sourceA, "source 1");
sourceB = this.validateBuffer(sourceB, "source 2");
destination = this.validateBuffer(destination, "destination");


^FluidProxyUgen.kr(this.objectClassName++\Trigger,-1, sourceA, startFrameA, numFramesA, startChanA, numChansA, sourceB, startFrameA, numFramesA, startChanB, numChansB, destination, interpolation, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking);
Expand All @@ -19,13 +15,9 @@ FluidBufAudioTransport : FluidBufProcessor {
*process { |server, sourceA, startFrameA = 0, numFramesA = -1, startChanA = 0, numChansA = -1, sourceB, startFrameB = 0, numFramesB = -1, startChanB = 0, numChansB = -1, destination, interpolation=0.0, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action|

var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};
sourceA.isNil.if {"FluidAudioTransport: Invalid source 1 buffer".throw};
sourceB.isNil.if {"FluidAudioTransport: Invalid source 2 buffer".throw};
sourceA = sourceA.asUGenInput;
sourceB = sourceB.asUGenInput;

destination.isNil.if {"FluidAudioTransport: Invalid destination buffer".throw};
destination = destination.asUGenInput;
sourceA = this.validateBuffer(sourceA, "source 1");
sourceB = this.validateBuffer(sourceB, "source 2");
destination = this.validateBuffer(destination, "destination");

^this.new(
server, nil, [destination]
Expand All @@ -37,13 +29,9 @@ FluidBufAudioTransport : FluidBufProcessor {
*processBlocking { |server, sourceA, startFrameA = 0, numFramesA = -1, startChanA = 0, numChansA = -1, sourceB, startFrameB = 0, numFramesB = -1, startChanB = 0, numChansB = -1, destination, interpolation=0.0, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action|

var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};
sourceA.isNil.if {"FluidAudioTransport: Invalid source 1 buffer".throw};
sourceB.isNil.if {"FluidAudioTransport: Invalid source 2 buffer".throw};
sourceA = sourceA.asUGenInput;
sourceB = sourceB.asUGenInput;

destination.isNil.if {"FluidAudioTransport: Invalid destination buffer".throw};
destination = destination.asUGenInput;
sourceA = this.validateBuffer(sourceA, "source 1");
sourceB = this.validateBuffer(sourceB, "source 2");
destination = this.validateBuffer(destination, "destination");

^this.new(
server, nil, [destination]
Expand Down
21 changes: 6 additions & 15 deletions release-packaging/Classes/FluidBufChroma.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ FluidBufChroma : FluidBufProcessor {

var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};

source = source.asUGenInput;
features = features.asUGenInput;

source.isNil.if {"FluidBufChroma: Invalid source buffer".throw};
features.isNil.if {"FluidBufChroma: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^FluidProxyUgen.kr(\FluidBufChromaTrigger,-1, source, startFrame, numFrames, startChan, numChans, features, padding, numChroma, numChroma, ref, normalize, minFreq, maxFreq, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking);
}
Expand All @@ -16,11 +13,8 @@ FluidBufChroma : FluidBufProcessor {

var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};

source = source.asUGenInput;
features = features.asUGenInput;

source.isNil.if {"FluidBufChroma: Invalid source buffer".throw};
features.isNil.if {"FluidBufChroma: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^this.new(
server, nil, [features]
Expand All @@ -33,11 +27,8 @@ FluidBufChroma : FluidBufProcessor {

var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize};

source = source.asUGenInput;
features = features.asUGenInput;

source.isNil.if {"FluidBufChroma: Invalid source buffer".throw};
features.isNil.if {"FluidBufChroma: Invalid features buffer".throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^this.new(
server, nil, [features]
Expand Down
21 changes: 6 additions & 15 deletions release-packaging/Classes/FluidBufCompose.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,25 @@ FluidBufCompose : FluidBufProcessor {

*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, gain = 1, destination, destStartFrame = 0, destStartChan = 0, destGain = 0, trig = 1, blocking = 1|

source = source.asUGenInput;
destination = destination.asUGenInput;

source.isNil.if {"FluidBufCompose: Invalid source buffer".throw};
destination.isNil.if {"FluidBufCompose: Invalid destination buffer".throw};
source = this.validateBuffer(source, "source");
destination = this.validateBuffer(destination, "destination");

^FluidProxyUgen.kr(\FluidBufComposeTrigger,-1, source, startFrame, numFrames, startChan, numChans, gain, destination, destStartFrame, destStartChan, destGain, trig, blocking);
}


*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, gain = 1, destination, destStartFrame = 0, destStartChan = 0, destGain = 0, freeWhenDone = true, action|

source = source.asUGenInput;
destination = destination.asUGenInput;

source.isNil.if {"FluidBufCompose: Invalid source buffer".throw};
destination.isNil.if {"FluidBufCompose: Invalid destination buffer".throw};
source = this.validateBuffer(source, "source");
destination = this.validateBuffer(destination, "destination");

^this.new( server, nil, [destination]).processList([source, startFrame, numFrames, startChan, numChans, gain, destination, destStartFrame, destStartChan, destGain, 1], freeWhenDone, action);//NB always blocking
}

*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, gain = 1, destination, destStartFrame = 0, destStartChan = 0, destGain = 0, freeWhenDone = true, action|

source = source.asUGenInput;
destination = destination.asUGenInput;

source.isNil.if {"FluidBufCompose: Invalid source buffer".throw};
destination.isNil.if {"FluidBufCompose: Invalid destination buffer".throw};
source = this.validateBuffer(source, "source");
destination = this.validateBuffer(destination, "destination");

^this.new(
server, nil, [destination]
Expand Down
21 changes: 6 additions & 15 deletions release-packaging/Classes/FluidBufFlatten.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@ FluidBufFlatten : FluidBufProcessor {

*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, axis = 1, trig = 1, blocking = 1|

source = source.asUGenInput;
destination = destination.asUGenInput;

source.isNil.if {"FluidBufFlatten: Invalid source buffer".throw};
destination.isNil.if {"FluidBufFlatten: Invalid destination buffer".throw};
source = this.validateBuffer(source, "source");
destination = this.validateBuffer(destination, "destination");

^FluidProxyUgen.kr(\FluidBufFlattenTrigger,-1, source, startFrame, numFrames, startChan, numChans, destination, axis, trig, blocking);
}

*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, axis = 1, freeWhenDone = true, action|

source = source.asUGenInput;
destination = destination.asUGenInput;

source.isNil.if {"FluidBufFlatten: Invalid source buffer".throw};
destination.isNil.if {"FluidBufFlatten: Invalid destination buffer".throw};
source = this.validateBuffer(source, "source");
destination = this.validateBuffer(destination, "destination");

^this.new(
server, nil, [destination],
Expand All @@ -30,11 +24,8 @@ FluidBufFlatten : FluidBufProcessor {

*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, axis = 1, freeWhenDone = true, action|

source = source.asUGenInput;
destination = destination.asUGenInput;

source.isNil.if {"FluidBufFlatten: Invalid source buffer".throw};
destination.isNil.if {"FluidBufFlatten: Invalid destination buffer".throw};
source = this.validateBuffer(source, "source");
destination = this.validateBuffer(destination, "destination");

^this.new(
server, nil, [destination],
Expand Down
8 changes: 3 additions & 5 deletions release-packaging/Classes/FluidBufHPSS.sc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FluidBufHPSS : FluidBufProcessor {
harmonic = harmonic ? -1;
percussive = percussive ? -1;
residual = residual ? -1;
source.isNil.if {"FluidBufHPSS: Invalid source buffer".throw};
source = this.validateBuffer(source, "source");

^FluidProxyUgen.kr(\FluidBufHPSSTrigger, -1, source, startFrame, numFrames, startChan, numChans, harmonic, percussive, residual, harmFilterSize, harmFilterSize, percFilterSize, percFilterSize, maskingMode, harmThreshFreq1, harmThreshAmp1, harmThreshFreq2, harmThreshAmp2, percThreshFreq1, percThreshAmp1, percThreshFreq2, percThreshAmp2, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking
);
Expand All @@ -20,8 +20,7 @@ FluidBufHPSS : FluidBufProcessor {
harmonic = harmonic ? -1;
percussive = percussive ? -1;
residual = residual ? -1;
source.isNil.if {"FluidBufHPSS: Invalid source buffer".throw};

source = this.validateBuffer(source, "source");

^this.new(
server, nil, [harmonic, percussive, residual].select{|x| x!= -1}
Expand All @@ -38,8 +37,7 @@ FluidBufHPSS : FluidBufProcessor {
harmonic = harmonic ? -1;
percussive = percussive ? -1;
residual = residual ? -1;
source.isNil.if {"FluidBufHPSS: Invalid source buffer".throw};

source = this.validateBuffer(source, "source");

^this.new(
server, nil, [harmonic, percussive, residual].select{|x| x!= -1}
Expand Down
49 changes: 10 additions & 39 deletions release-packaging/Classes/FluidBufLoudness.sc
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
FluidBufLoudness : FluidBufProcessor{

const <features=#[\loudness, \peak];
classvar featuresLookup;

*initClass {
featuresLookup = Dictionary.with(*this.features.collect{|x,i| x->(1<<i)});
}

*prWarnUnrecognised {|sym| ("WARNING: FluidLoudness -" + sym + "is not a recognised option").postln}

*prProcessSelect {|a|
var bits;
a.asBag.countsDo{|item,count,i|
if(count > 1) { ("Option '" ++ item ++ "' is repeated").warn};
};
bits = a.collect{ |sym|
(featuresLookup[sym.asSymbol] !? {|x| x} ?? {this.prWarnUnrecognised(sym); 0})
}.reduce{|x,y| x | y};
^bits
}

*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, select, kWeighting = 1, truePeak = 1, windowSize = 1024, hopSize = 512, padding = 1, trig = 1, blocking = 0|
*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, select, kWeighting = 1, truePeak = 1, windowSize = 1024, hopSize = 512, padding = 1, trig = 1, blocking = 0|

var maxwindowSize = windowSize.nextPowerOfTwo;

var selectbits = select !? {this.prProcessSelect(select)} ?? {this.prProcessSelect(this.features)};

source = source.asUGenInput;
features = features.asUGenInput;
var selectbits = FluidLoudness.featuresLookup.encode(select);

source.isNil.if {"%: Invalid source buffer".format(this.class.name).throw};
features.isNil.if {"%: Invalid features buffer".format(this.class.name).throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^FluidProxyUgen.kr(\FluidBufLoudnessTrigger, -1, source, startFrame, numFrames, startChan, numChans, features, padding, selectbits, kWeighting, truePeak, windowSize, hopSize, maxwindowSize, trig, blocking);
}
Expand All @@ -39,13 +16,10 @@ FluidBufLoudness : FluidBufProcessor{

var maxwindowSize = windowSize.nextPowerOfTwo;

var selectbits = select !? {this.prProcessSelect(select)} ?? {this.prProcessSelect(this.features)};
var selectbits = FluidLoudness.featuresLookup.encode(select);

source = source.asUGenInput;
features = features.asUGenInput;

source.isNil.if {"%: Invalid source buffer".format(this.class.name).throw};
features.isNil.if {"%: Invalid features buffer".format(this.class.name).throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^this.new(
server, nil, [features]
Expand All @@ -58,13 +32,10 @@ FluidBufLoudness : FluidBufProcessor{

var maxwindowSize = windowSize.nextPowerOfTwo;

var selectbits = select !? {this.prProcessSelect(select)} ?? {this.prProcessSelect(this.features)};

source = source.asUGenInput;
features = features.asUGenInput;
var selectbits = FluidLoudness.featuresLookup.encode(select);

source.isNil.if {"%: Invalid source buffer".format(this.class.name).throw};
features.isNil.if {"%: Invalid features buffer".format(this.class.name).throw};
source = this.validateBuffer(source, "source");
features = this.validateBuffer(features, "features");

^this.new(
server, nil, [features]
Expand Down
Loading