From 7277a5e41d26a7633d898f1208d449d25329389a Mon Sep 17 00:00:00 2001 From: Owen Green Date: Thu, 25 Jul 2019 17:53:30 +0100 Subject: [PATCH] Changes to the other objects to make them thready * .cpp stub references threaded template, changes name to full name of SC class * SC class gets kr method, process wraps this --- release-packaging/Classes/FluidBufAmpSlice.sc | 42 +++++++++++-- release-packaging/Classes/FluidBufCompose.sc | 44 +++++++++++-- release-packaging/Classes/FluidBufHPSS.sc | 45 ++++++++++++-- release-packaging/Classes/FluidBufLoudness.sc | 60 +++++++++++++----- release-packaging/Classes/FluidBufMFCC.sc | 62 +++++++++++++------ release-packaging/Classes/FluidBufMelBands.sc | 39 ++++++++++-- release-packaging/Classes/FluidBufNMF.sc | 6 +- .../Classes/FluidBufNoveltySlice.sc | 39 +++++++++++- .../Classes/FluidBufOnsetSlice.sc | 41 ++++++++++-- release-packaging/Classes/FluidBufPitch.sc | 39 ++++++++++-- release-packaging/Classes/FluidBufSines.sc | 38 ++++++++++-- .../Classes/FluidBufSpectralShape.sc | 39 ++++++++++-- release-packaging/Classes/FluidBufStats.sc | 33 +++++++++- .../Classes/FluidBufTransientSlice.sc | 34 +++++++++- .../Classes/FluidBufTransients.sc | 41 ++++++++++-- src/FluidBufAmpSlice/FluidBufAmpSlice.cpp | 2 +- src/FluidBufCompose/FluidBufCompose.cpp | 2 +- src/FluidBufHPSS/FluidBufHPSS.cpp | 2 +- src/FluidBufLoudness/FluidBufLoudness.cpp | 2 +- src/FluidBufMFCC/FluidBufMFCC.cpp | 2 +- src/FluidBufMelBands/FluidBufMelBands.cpp | 2 +- .../FluidBufNoveltySlice.cpp | 2 +- src/FluidBufOnsetSlice/FluidBufOnsetSlice.cpp | 2 +- src/FluidBufPitch/FluidBufPitch.cpp | 2 +- src/FluidBufSines/FluidBufSines.cpp | 3 +- .../FluidBufSpectralShape.cpp | 2 +- src/FluidBufStats/FluidBufStats.cpp | 2 +- .../FluidBufTransientSlice.cpp | 2 +- src/FluidBufTransients/FluidBufTransients.cpp | 2 +- 29 files changed, 532 insertions(+), 99 deletions(-) diff --git a/release-packaging/Classes/FluidBufAmpSlice.sc b/release-packaging/Classes/FluidBufAmpSlice.sc index 88edabb..6c8f901 100644 --- a/release-packaging/Classes/FluidBufAmpSlice.sc +++ b/release-packaging/Classes/FluidBufAmpSlice.sc @@ -1,5 +1,8 @@ -FluidBufAmpSlice{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, absRampUp = 10, absRampDown = 10, absThreshOn = -90, absThreshOff = -90, minSliceLength = 1, minSilenceLength = 1, minLengthAbove = 1, minLengthBelow = 1, lookBack = 0, lookAhead = 0, relRampUp = 1, relRampDown = 1, relThreshOn = 144, relThreshOff = -144, highPassFreq = 85, action; +FluidBufAmpSlice : UGen { + + var <>server, <>synth; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, absRampUp = 10, absRampDown = 10, absThreshOn = -90, absThreshOff = -90, minSliceLength = 1, minSilenceLength = 1, minLengthAbove = 1, minLengthBelow = 1, lookBack = 0, lookAhead = 0, relRampUp = 1, relRampDown = 1, relThreshOn = 144, relThreshOff = -144, highPassFreq = 85, doneAction = 0| var maxSize = max(minLengthAbove + lookBack, max(minLengthBelow,lookAhead)); @@ -9,13 +12,42 @@ FluidBufAmpSlice{ source.isNil.if {"FluidBufAmpSlice: Invalid source buffer".throw}; indices.isNil.if {"FluidBufAmpSlice: Invalid features buffer".throw}; + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, indices, absRampUp, absRampDown, absThreshOn, absThreshOff, minSliceLength, minSilenceLength, minLengthAbove, minLengthBelow, lookBack, lookAhead, relRampUp, relRampDown, relThreshOn, relThreshOff, highPassFreq, maxSize, 0, doneAction); + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, absRampUp = 10, absRampDown = 10, absThreshOn = -90, absThreshOff = -90, minSliceLength = 1, minSilenceLength = 1, minLengthAbove = 1, minLengthBelow = 1, lookBack = 0, lookAhead = 0, relRampUp = 1, relRampDown = 1, relThreshOn = 144, relThreshOff = -144, highPassFreq = 85, action| + + var instance,synth; + + source = source.asUGenInput; + indices = indices.asUGenInput; + + source.isNil.if {"FluidBufAmpSlice: Invalid source buffer".throw}; + indices.isNil.if {"FluidBufAmpSlice: Invalid features buffer".throw}; + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = {instance = FluidBufAmpSlice.kr(source, startFrame, numFrames, startChan, numChans, indices, absRampUp, absRampDown, absThreshOn, absThreshOff, minSliceLength, minSilenceLength, minLengthAbove, minLengthBelow, lookBack, lookAhead, relRampUp, relRampDown, relThreshOn, relThreshOff, highPassFreq, doneAction: Done.freeSelf)}.play(server); - forkIfNeeded{ - server.sendMsg(\cmd, \BufAmpSlice, source, startFrame, numFrames, startChan, numChans, indices, absRampUp, absRampDown, absThreshOn, absThreshOff, minSliceLength, minSilenceLength, minLengthAbove, minLengthBelow, lookBack, lookAhead, relRampUp, relRampDown, relThreshOn, relThreshOff, highPassFreq, maxSize, 0); + forkIfNeeded{ + synth.waitForFree; server.sync; - indices = server.cachedBufferAt(indices); indices.updateInfo; server.sync; + indices = server.cachedBufferAt(indices); + indices.updateInfo; + server.sync; action.value(indices); }; + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } + } diff --git a/release-packaging/Classes/FluidBufCompose.sc b/release-packaging/Classes/FluidBufCompose.sc index 1e4a569..0ae3502 100644 --- a/release-packaging/Classes/FluidBufCompose.sc +++ b/release-packaging/Classes/FluidBufCompose.sc @@ -1,6 +1,24 @@ -FluidBufCompose{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, gain = 1, destination, destStartFrame = 0, destStartChan = 0, destGain = 0, action; +FluidBufCompose : UGen { + var <>server, <>synth; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, gain = 1, destination, destStartFrame = 0, destStartChan = 0, destGain = 0, doneAction = 0| + + source = source.asUGenInput; + destination = destination.asUGenInput; + + source.isNil.if {"FluidBufCompose: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufCompose: Invalid destination buffer".throw}; + + + ^this.multiNew('control', source, startFrame, numFrames, startChan, numChans, gain, destination, destStartFrame, destStartChan, destGain, doneAction); + + } + + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, gain = 1, destination, destStartFrame = 0, destStartChan = 0, destGain = 0, action| + + var synth, instance; source = source.asUGenInput; destination = destination.asUGenInput; @@ -8,12 +26,30 @@ FluidBufCompose{ destination.isNil.if {"FluidBufCompose: Invalid destination buffer".throw}; server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = {instance = FluidBufCompose.kr(source, startFrame, numFrames, startChan, numChans, gain, destination, destStartFrame, destStartChan, destGain, doneAction: Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufCompose, source, startFrame, numFrames, startChan, numChans, gain, destination, destStartFrame, destStartChan, destGain); + synth.waitForFree; server.sync; - destination = server.cachedBufferAt(destination); destination.updateInfo; server.sync; + destination = server.cachedBufferAt(destination); + destination.updateInfo; + server.sync; action.value(destination); }; + + instance.server = server; + instance.synth = synth; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } + + } diff --git a/release-packaging/Classes/FluidBufHPSS.sc b/release-packaging/Classes/FluidBufHPSS.sc index 77b5b8b..c5804e6 100644 --- a/release-packaging/Classes/FluidBufHPSS.sc +++ b/release-packaging/Classes/FluidBufHPSS.sc @@ -1,5 +1,8 @@ -FluidBufHPSS{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, harmonic, percussive, residual, harmFilterSize = 17, percFilterSize = 31, maskingMode, harmThreshFreq1 = 0.1, harmThreshAmp1 = 0, harmThreshFreq2 = 0.5, harmThreshAmp2 = 0, percThreshFreq1 = 0.1, percThreshAmp1 = 0, percThreshFreq2 = 0.5, percThreshAmp2 = 0, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufHPSS : UGen { + + var <>server, <>synth; + + *kr {|source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, harmonic, percussive, residual, harmFilterSize = 17, percFilterSize = 31, maskingMode = 0, harmThreshFreq1 = 0.1, harmThreshAmp1 = 0, harmThreshFreq2 = 0.5, harmThreshAmp2 = 0, percThreshFreq1 = 0.1, percThreshAmp1 = 0, percThreshFreq2 = 0.5, percThreshAmp2 = 0, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -8,23 +11,55 @@ FluidBufHPSS{ percussive = percussive.asUGenInput; residual = residual.asUGenInput; + harmonic = harmonic ? -1; + percussive = percussive ? -1; + residual = residual ? -1; + + //NB For wrapped versions of NRT classes, we set the params for maxima to + //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + + ^this.multiNew('control', source, startFrame, numFrames, startChan, numChans, harmonic, percussive, residual, harmFilterSize, percFilterSize, maskingMode, harmThreshFreq1, harmThreshAmp1, harmThreshFreq2, harmThreshAmp2, percThreshFreq1, percThreshAmp1, percThreshFreq2, percThreshAmp2, windowSize, hopSize, fftSize, maxFFTSize, harmFilterSize, percFilterSize, doneAction); + } + + *process {|server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, harmonic, percussive, residual, harmFilterSize = 17, percFilterSize = 31, maskingMode = 0, harmThreshFreq1 = 0.1, harmThreshAmp1 = 0, harmThreshFreq2 = 0.5, harmThreshAmp2 = 0, percThreshFreq1 = 0.1, percThreshAmp1 = 0, percThreshFreq2 = 0.5, percThreshAmp2 = 0, windowSize = 1024, hopSize = -1, fftSize = -1, action| + + var synth, instance; + + source = source.asUGenInput; + harmonic = harmonic.asUGenInput; + percussive = percussive.asUGenInput; + residual = residual.asUGenInput; + source.isNil.if {"FluidBufHPSS: Invalid source buffer".throw}; server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); harmonic = harmonic ? -1; percussive = percussive ? -1; residual = residual ? -1; - //NB For wrapped versions of NRT classes, we set the params for maxima to - //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + synth = { instance = FluidBufHPSS.kr(source, startFrame, numFrames, startChan, numChans, harmonic, percussive, residual, harmFilterSize, percFilterSize, maskingMode, harmThreshFreq1, harmThreshAmp1, harmThreshFreq2, harmThreshAmp2, percThreshFreq1, percThreshAmp1, percThreshFreq2, percThreshAmp2, windowSize, hopSize, fftSize, doneAction:Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufHPSS, source, startFrame, numFrames, startChan, numChans, harmonic, percussive, residual, harmFilterSize, percFilterSize, maskingMode, harmThreshFreq1, harmThreshAmp1, harmThreshFreq2, harmThreshAmp2, percThreshFreq1, percThreshAmp1, percThreshFreq2, percThreshAmp2, windowSize, hopSize, fftSize, maxFFTSize, harmFilterSize, percFilterSize); + synth.waitForFree; server.sync; if (harmonic != -1) {harmonic = server.cachedBufferAt(harmonic); harmonic.updateInfo; server.sync;} {harmonic = nil}; if (percussive != -1) {percussive = server.cachedBufferAt(percussive); percussive.updateInfo; server.sync;} {percussive = nil}; if (residual != -1) {residual = server.cachedBufferAt(residual); residual.updateInfo; server.sync;} {residual = nil}; action.value(harmonic, percussive, residual); }; + + instance.server = server; + instance.synth = synth; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } + } diff --git a/release-packaging/Classes/FluidBufLoudness.sc b/release-packaging/Classes/FluidBufLoudness.sc index 58f3f8e..e46ee09 100644 --- a/release-packaging/Classes/FluidBufLoudness.sc +++ b/release-packaging/Classes/FluidBufLoudness.sc @@ -1,21 +1,51 @@ -FluidBufLoudness{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, kWeighting = 1, truePeak = 1, windowSize = 1024, hopSize = 512, action; +FluidBufLoudness : UGen{ - var maxwindowSize = windowSize.nextPowerOfTwo; + var <>server, <>synth; - source = source.asUGenInput; - features = features.asUGenInput; + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, kWeighting = 1, truePeak = 1, windowSize = 1024, hopSize = 512, doneAction = 0| - source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; - features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; + var maxwindowSize = windowSize.nextPowerOfTwo; - server = server ? Server.default; + source = source.asUGenInput; + features = features.asUGenInput; - forkIfNeeded{ - server.sendMsg(\cmd, \BufLoudness, source, startFrame, numFrames, startChan, numChans, features, kWeighting, truePeak, windowSize, hopSize, maxwindowSize); - server.sync; - features = server.cachedBufferAt(features); features.updateInfo; server.sync; - action.value(features); - }; - } + source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; + features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; + + ^this.multiNew('control', source, startFrame, numFrames, startChan, numChans, features, kWeighting, truePeak, windowSize, hopSize, maxwindowSize, doneAction); + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, kWeighting = 1, truePeak = 1, windowSize = 1024, hopSize = 512, action| + + var synth, instance; + source = source.asUGenInput; + features = features.asUGenInput; + + source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; + features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; + + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = {instance = FluidBufLoudness.kr(source, startFrame, numFrames, startChan, numChans, features, kWeighting, truePeak, windowSize, hopSize, doneAction:Done.freeSelf)}.play(server); + + forkIfNeeded{ + synth.waitForFree; + server.sync; + features = server.cachedBufferAt(features); features.updateInfo; server.sync; + action.value(features); + }; + + instance.server = server; + instance.synth = synth; + ^instance; + } + + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufMFCC.sc b/release-packaging/Classes/FluidBufMFCC.sc index 131ae3c..4132af2 100644 --- a/release-packaging/Classes/FluidBufMFCC.sc +++ b/release-packaging/Classes/FluidBufMFCC.sc @@ -1,25 +1,51 @@ -FluidBufMFCC{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufMFCC : UGen{ + var <>server, <>synth; + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0| - var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; + source = source.asUGenInput; + features = features.asUGenInput; - source = source.asUGenInput; - features = features.asUGenInput; + source.isNil.if {"FluidBufMFCC: Invalid source buffer".throw}; + features.isNil.if {"FluidBufMFCC: Invalid features buffer".throw}; - source.isNil.if {"FluidBufMFCC: Invalid source buffer".throw}; - features.isNil.if {"FluidBufMFCC: Invalid features buffer".throw}; + //NB For wrapped versions of NRT classes, we set the params for maxima to + //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + // same goes to maxNumCoeffs, which is passed numCoeffs in this case - server = server ? Server.default; + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, features, numCoeffs, numBands, minFreq, maxFreq, numCoeffs, windowSize, hopSize, fftSize, maxFFTSize, doneAction); + } - //NB For wrapped versions of NRT classes, we set the params for maxima to - //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) - // same goes to maxNumCoeffs, which is passed numCoeffs in this case + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numCoeffs = 13, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, action| + var synth, instance; - forkIfNeeded{ - server.sendMsg(\cmd, \BufMFCC, source, startFrame, numFrames, startChan, numChans, features, numCoeffs, numBands, minFreq, maxFreq, numCoeffs, windowSize, hopSize, fftSize, maxFFTSize); - server.sync; - features = server.cachedBufferAt(features); features.updateInfo; server.sync; - action.value(features); - }; - } + source = source.asUGenInput; + features = features.asUGenInput; + + source.isNil.if {"FluidBufMFCC: Invalid source buffer".throw}; + features.isNil.if {"FluidBufMFCC: Invalid features buffer".throw}; + + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = { instance = FluidBufMFCC.kr(source, startFrame, numFrames, startChan, numChans, features, numCoeffs, numBands, minFreq, maxFreq, windowSize, hopSize, fftSize, doneAction:Done.freeSelf)}.play(server); + + forkIfNeeded{ + synth.waitForFree; + server.sync; + features = server.cachedBufferAt(features); features.updateInfo; server.sync; + action.value(features); + }; + + instance.synth = synth; + instance.server = server; + ^instance; + } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufMelBands.sc b/release-packaging/Classes/FluidBufMelBands.sc index 5583ab1..282130c 100644 --- a/release-packaging/Classes/FluidBufMelBands.sc +++ b/release-packaging/Classes/FluidBufMelBands.sc @@ -1,5 +1,7 @@ -FluidBufMelBands{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufMelBands : UGen { + var <>server, <>synth; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0 | var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -9,17 +11,44 @@ FluidBufMelBands{ source.isNil.if {"FluidBufMelBands: Invalid source buffer".throw}; features.isNil.if {"FluidBufMelBands: Invalid features buffer".throw}; - server = server ? Server.default; - //NB For wrapped versions of NRT classes, we set the params for maxima to //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) // same for maxNumBands which is passed numBands + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, features, numBands, minFreq, maxFreq, numBands, windowSize, hopSize, fftSize, maxFFTSize, doneAction); + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, numBands = 40, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, action| + + var synth, instance; + source = source.asUGenInput; + features = features.asUGenInput; + + source.isNil.if {"FluidBufMelBands: Invalid source buffer".throw}; + features.isNil.if {"FluidBufMelBands: Invalid features buffer".throw}; + + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = { instance = FluidBufMelBands.kr(source, startFrame, numFrames, startChan, numChans, features, numBands, minFreq, maxFreq, windowSize, hopSize, fftSize, doneAction: Done.freeSelf)}.play(server); + forkIfNeeded{ - server.sendMsg(\cmd, \BufMelBands, source, startFrame, numFrames, startChan, numChans, features, numBands, minFreq, maxFreq, numBands, windowSize, hopSize, fftSize, maxFFTSize); + synth.waitForFree; server.sync; features = server.cachedBufferAt(features); features.updateInfo; server.sync; action.value(features); }; + + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } + } diff --git a/release-packaging/Classes/FluidBufNMF.sc b/release-packaging/Classes/FluidBufNMF.sc index 0eb979f..97adaee 100644 --- a/release-packaging/Classes/FluidBufNMF.sc +++ b/release-packaging/Classes/FluidBufNMF.sc @@ -35,8 +35,12 @@ FluidBufNMF : UGen { destination = destination ? -1; bases = bases ? -1; activations = activations ? -1; - // this.server = server; + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); synth = {instance = FluidBufNMF.kr(source, startFrame, numFrames, startChan, numChans, destination, bases, basesMode, activations, actMode, components,iterations, windowSize, hopSize, fftSize, doneAction: Done.freeSelf)}.play(server); forkIfNeeded{ diff --git a/release-packaging/Classes/FluidBufNoveltySlice.sc b/release-packaging/Classes/FluidBufNoveltySlice.sc index 2abf929..f86d9b2 100644 --- a/release-packaging/Classes/FluidBufNoveltySlice.sc +++ b/release-packaging/Classes/FluidBufNoveltySlice.sc @@ -1,5 +1,8 @@ -FluidBufNoveltySlice{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufNoveltySlice : UGen { + + var <>synth, <>server; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0 | var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -9,13 +12,43 @@ FluidBufNoveltySlice{ source.isNil.if {"FluidBufNoveltySlice: Invalid source buffer".throw}; indices.isNil.if {"FluidBufNoveltySlice: Invalid features buffer".throw}; + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, indices, feature, kernelSize, threshold, filterSize, windowSize, hopSize, fftSize, maxFFTSize, kernelSize, filterSize, doneAction); + + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, feature = 0, kernelSize = 3, threshold = 0.5, filterSize = 1, windowSize = 1024, hopSize = -1, fftSize = -1, action| + + var synth, instance; + var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; + + source = source.asUGenInput; + indices = indices.asUGenInput; + + source.isNil.if {"FluidBufNoveltySlice: Invalid source buffer".throw}; + indices.isNil.if {"FluidBufNoveltySlice: Invalid features buffer".throw}; + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + + synth = { instance = FluidBufNoveltySlice.kr(source, startFrame, numFrames, startChan, numChans, indices, feature, kernelSize, threshold, filterSize, windowSize, hopSize, fftSize, maxFFTSize, kernelSize, filterSize, doneAction: Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufNoveltySlice, source, startFrame, numFrames, startChan, numChans, indices, feature, kernelSize, threshold, filterSize, windowSize, hopSize, fftSize, maxFFTSize, kernelSize, filterSize); + synth.waitForFree; server.sync; indices = server.cachedBufferAt(indices); indices.updateInfo; server.sync; action.value(indices); }; + + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufOnsetSlice.sc b/release-packaging/Classes/FluidBufOnsetSlice.sc index 4e3304c..4579cb7 100644 --- a/release-packaging/Classes/FluidBufOnsetSlice.sc +++ b/release-packaging/Classes/FluidBufOnsetSlice.sc @@ -1,5 +1,8 @@ -FluidBufOnsetSlice{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, metric = 0, threshold = 0.5, minSliceLength = 2, filterSize = 5, frameDelta = 0, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufOnsetSlice : UGen { + + var <>synth, <>server; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, metric = 0, threshold = 0.5, minSliceLength = 2, filterSize = 5, frameDelta = 0, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -9,16 +12,44 @@ FluidBufOnsetSlice{ source.isNil.if {"FluidBufOnsetSlice: Invalid source buffer".throw}; indices.isNil.if {"FluidBufOnsetSlice: Invalid features buffer".throw}; - server = server ? Server.default; - //NB For wrapped versions of NRT classes, we set the params for maxima to //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, indices, metric, threshold, minSliceLength, filterSize, frameDelta, windowSize, hopSize, fftSize, maxFFTSize, doneAction); + + } + + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, metric = 0, threshold = 0.5, minSliceLength = 2, filterSize = 5, frameDelta = 0, windowSize = 1024, hopSize = -1, fftSize = -1, action| + var synth, instance; + source = source.asUGenInput; + indices = indices.asUGenInput; + + source.isNil.if {"FluidBufOnsetSlice: Invalid source buffer".throw}; + indices.isNil.if {"FluidBufOnsetSlice: Invalid features buffer".throw}; + + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + //NB For wrapped versions of NRT classes, we set the params for maxima to + //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + synth = { instance = FluidBufOnsetSlice.kr(source, startFrame, numFrames, startChan, numChans, indices, metric, threshold, minSliceLength, filterSize, frameDelta, windowSize, hopSize, fftSize, doneAction: Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufOnsetSlice, source, startFrame, numFrames, startChan, numChans, indices, metric, threshold, minSliceLength, filterSize, frameDelta, windowSize, hopSize, fftSize, maxFFTSize); + synth.waitForFree; server.sync; indices = server.cachedBufferAt(indices); indices.updateInfo; server.sync; action.value(indices); }; + instance.server = server; + instance.synth = synth; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufPitch.sc b/release-packaging/Classes/FluidBufPitch.sc index 9bff1f8..fc97710 100644 --- a/release-packaging/Classes/FluidBufPitch.sc +++ b/release-packaging/Classes/FluidBufPitch.sc @@ -1,5 +1,7 @@ -FluidBufPitch{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufPitch : UGen{ + var <>synth, <>server; + + *kr {|source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -9,16 +11,43 @@ FluidBufPitch{ source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; - server = server ? Server.default; - //NB For wrapped versions of NRT classes, we set the params for maxima to //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, features, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize, doneAction); + + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, algorithm = 2, minFreq = 20, maxFreq = 10000, unit = 0, windowSize = 1024, hopSize = -1, fftSize = -1, action| + + var synth,instance; + + source = source.asUGenInput; + features = features.asUGenInput; + + source.isNil.if {"FluidBufPitch: Invalid source buffer".throw}; + features.isNil.if {"FluidBufPitch: Invalid features buffer".throw}; + + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + + synth = { instance = FluidBufPitch.kr(source, startFrame, numFrames, startChan, numChans, features, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, doneAction:Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufPitch, source, startFrame, numFrames, startChan, numChans, features, algorithm, minFreq, maxFreq, unit, windowSize, hopSize, fftSize, maxFFTSize); + synth.waitForFree; server.sync; features = server.cachedBufferAt(features); features.updateInfo; server.sync; action.value(features); }; + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufSines.sc b/release-packaging/Classes/FluidBufSines.sc index 0da582b..70985d2 100644 --- a/release-packaging/Classes/FluidBufSines.sc +++ b/release-packaging/Classes/FluidBufSines.sc @@ -1,5 +1,8 @@ -FluidBufSines{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines, residual, bandwidth = 76, threshold = 0.7, minTrackLen = 15, magWeight = 0.1, freqWeight = 1, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufSines : UGen{ + + var <>synth, <>server; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines, residual, bandwidth = 76, threshold = 0.7, minTrackLen = 15, magWeight = 0.1, freqWeight = 1, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -9,19 +12,46 @@ FluidBufSines{ source.isNil.if {"FluidBufSines: Invalid source buffer".throw}; - server = server ? Server.default; sines = sines ? -1; residual = residual ? -1; //NB For wrapped versions of NRT classes, we set the params for maxima to //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, threshold, minTrackLen, magWeight, freqWeight, windowSize, hopSize, fftSize, maxFFTSize, doneAction); + } + + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines, residual, bandwidth = 76, threshold = 0.7, minTrackLen = 15, magWeight = 0.1, freqWeight = 1, windowSize = 1024, hopSize = -1, fftSize = -1, action| + var synth, instance; + source = source.asUGenInput; + sines = sines.asUGenInput; + residual = residual.asUGenInput; + + source.isNil.if {"FluidBufSines: Invalid source buffer".throw}; + + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + sines = sines ? -1; + residual = residual ? -1; + synth = { instance = FluidBufSines.kr(source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, threshold, minTrackLen, magWeight, freqWeight, windowSize, hopSize, fftSize, doneAction:Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufSines, source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, threshold, minTrackLen, magWeight, freqWeight, windowSize, hopSize, fftSize, maxFFTSize); + synth.waitForFree; server.sync; if (sines != -1) {sines = server.cachedBufferAt(sines); sines.updateInfo; server.sync;} {sines = nil}; if (residual != -1) {residual = server.cachedBufferAt(residual); residual.updateInfo; server.sync;} {residual = nil}; action.value(sines, residual); }; + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufSpectralShape.sc b/release-packaging/Classes/FluidBufSpectralShape.sc index 72b8b61..342d912 100644 --- a/release-packaging/Classes/FluidBufSpectralShape.sc +++ b/release-packaging/Classes/FluidBufSpectralShape.sc @@ -1,5 +1,8 @@ -FluidBufSpectralShape{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, action; +FluidBufSpectralShape : UGen { + + var <>synth, <>server; + + *kr{ |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, doneAction = 0| var maxFFTSize = if (fftSize == -1) {windowSize.nextPowerOfTwo} {fftSize}; @@ -9,16 +12,44 @@ FluidBufSpectralShape{ source.isNil.if {"FluidBufSpectralShape: Invalid source buffer".throw}; features.isNil.if {"FluidBufSpectralShape: Invalid features buffer".throw}; + //NB For wrapped versions of NRT classes, we set the params for maxima to + //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) + + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, features, windowSize, hopSize, fftSize, maxFFTSize, doneAction); + + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, features, windowSize = 1024, hopSize = -1, fftSize = -1, action| + + var synth, instance; + source = source.asUGenInput; + features = features.asUGenInput; + + source.isNil.if {"FluidBufSpectralShape: Invalid source buffer".throw}; + features.isNil.if {"FluidBufSpectralShape: Invalid features buffer".throw}; + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = { instance = FluidBufSpectralShape.kr(source, startFrame, numFrames, startChan, numChans, features, windowSize, hopSize, fftSize, doneAction:Done.freeSelf)}.play(server); //NB For wrapped versions of NRT classes, we set the params for maxima to //whatever has been passed in language-side (e.g maxFFTSize still exists as a parameter for the server plugin, but makes less sense here: it just needs to be set to a legal value) - forkIfNeeded{ - server.sendMsg(\cmd, \BufSpectralShape, source, startFrame, numFrames, startChan, numChans, features, windowSize, hopSize, fftSize, maxFFTSize); + synth.waitForFree; server.sync; features = server.cachedBufferAt(features); features.updateInfo; server.sync; action.value(features); }; + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufStats.sc b/release-packaging/Classes/FluidBufStats.sc index 8a838c3..409507b 100644 --- a/release-packaging/Classes/FluidBufStats.sc +++ b/release-packaging/Classes/FluidBufStats.sc @@ -1,5 +1,7 @@ -FluidBufStats{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, stats, numDerivs = 0, low = 0, middle = 50, high = 100, action; +FluidBufStats : UGen{ + var <>synth, <>server; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, stats, numDerivs = 0, low = 0, middle = 50, high = 100, doneAction=0| source = source.asUGenInput; stats = stats.asUGenInput; @@ -7,13 +9,38 @@ FluidBufStats{ source.isNil.if {"FluidBufStats: Invalid source buffer".throw}; stats.isNil.if {"FluidBufStats: Invalid stats buffer".throw}; + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, stats, numDerivs, low, middle, high,doneAction); + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, stats, numDerivs = 0, low = 0, middle = 50, high = 100, action| + + var synth, instance; + source = source.asUGenInput; + stats = stats.asUGenInput; + + source.isNil.if {"FluidBufStats: Invalid source buffer".throw}; + stats.isNil.if {"FluidBufStats: Invalid stats buffer".throw}; + server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = { instance = FluidBufStats.kr(source, startFrame, numFrames, startChan, numChans, stats, numDerivs, low, middle, high, doneAction:Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufStats, source, startFrame, numFrames, startChan, numChans, stats, numDerivs, low, middle, high); + synth.waitForFree; server.sync; stats = server.cachedBufferAt(stats); stats.updateInfo; server.sync; action.value(stats); }; + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufTransientSlice.sc b/release-packaging/Classes/FluidBufTransientSlice.sc index 25fb83a..bdafdd5 100644 --- a/release-packaging/Classes/FluidBufTransientSlice.sc +++ b/release-packaging/Classes/FluidBufTransientSlice.sc @@ -1,6 +1,21 @@ -FluidBufTransientSlice{ - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, windowSize = 14, clumpLength = 25, minSliceLength = 1000, action; +FluidBufTransientSlice : UGen{ + var <>synth, <>server; + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, windowSize = 14, clumpLength = 25, minSliceLength = 1000, doneAction = 0| + + source = source.asUGenInput; + indices = indices.asUGenInput; + + source.isNil.if {"FluidBufNoveltySlice: Invalid source buffer".throw}; + indices.isNil.if {"FluidBufNoveltySlice: Invalid features buffer".throw}; + + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, indices, order, blockSize, padSize, skew, threshFwd, threshBack, windowSize, clumpLength, minSliceLength, doneAction); + + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, indices, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, windowSize = 14, clumpLength = 25, minSliceLength = 1000, action| + + var synth, instance; source = source.asUGenInput; indices = indices.asUGenInput; @@ -8,12 +23,25 @@ FluidBufTransientSlice{ indices.isNil.if {"FluidBufNoveltySlice: Invalid features buffer".throw}; server = server ? Server.default; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + synth = {instance = FluidBufTransientSlice.kr(source, startFrame, numFrames, startChan, numChans, indices, order, blockSize, padSize, skew, threshFwd, threshBack, windowSize, clumpLength, minSliceLength, doneAction: Done.freeSelf)}.play(server); forkIfNeeded{ - server.sendMsg(\cmd, \BufTransientSlice, source, startFrame, numFrames, startChan, numChans, indices, order, blockSize, padSize, skew, threshFwd, threshBack, windowSize, clumpLength, minSliceLength); + synth.waitForFree; server.sync; indices = server.cachedBufferAt(indices); indices.updateInfo; server.sync; action.value(indices); }; + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/release-packaging/Classes/FluidBufTransients.sc b/release-packaging/Classes/FluidBufTransients.sc index 521ef50..2d1c63b 100644 --- a/release-packaging/Classes/FluidBufTransients.sc +++ b/release-packaging/Classes/FluidBufTransients.sc @@ -1,6 +1,25 @@ -FluidBufTransients { - *process { arg server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, transients, residual, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, windowSize = 14, clumpLength = 25, action; +FluidBufTransients : UGen { + var <>synth, <>server; + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, transients, residual, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, windowSize = 14, clumpLength = 25, doneAction = 0 | + + source = source.asUGenInput; + transients = transients.asUGenInput; + residual = residual.asUGenInput; + + source.isNil.if {"FluidBufTransients: Invalid source buffer".throw}; + + transients = transients ? -1; + residual = residual ? -1; + + ^this.multiNew(\control, source, startFrame, numFrames, startChan, numChans, transients, residual, order, blockSize, padSize, skew, threshFwd, threshBack, windowSize, clumpLength, doneAction); + + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, transients, residual, order = 20, blockSize = 256, padSize = 128, skew = 0, threshFwd = 2, threshBack = 1.1, windowSize = 14, clumpLength = 25, action| + + var synth, instance; source = source.asUGenInput; transients = transients.asUGenInput; residual = residual.asUGenInput; @@ -8,15 +27,29 @@ FluidBufTransients { source.isNil.if {"FluidBufTransients: Invalid source buffer".throw}; server = server ? Server.default; - transients = transients ? -1; + server.ifNotRunning({ + "WARNING: Server not running".postln; + ^nil; + }); + transients = transients ? -1; residual = residual ? -1; + synth = {instance = FluidBufTransients.kr(source, startFrame, numFrames, startChan, numChans, transients, residual, order, blockSize, padSize, skew, threshFwd, threshBack, windowSize, clumpLength, doneAction:Done.freeSelf)}.play(server); + forkIfNeeded{ - server.sendMsg(\cmd, \BufTransients, source, startFrame, numFrames, startChan, numChans, transients, residual, order, blockSize, padSize, skew, threshFwd, threshBack, windowSize, clumpLength); + synth.waitForFree; server.sync; if (transients != -1) {transients = server.cachedBufferAt(transients); transients.updateInfo; server.sync;} {transients = nil}; if (residual != -1) {residual = server.cachedBufferAt(residual); residual.updateInfo; server.sync;} {residual = nil}; action.value(transients, residual); }; + instance.synth = synth; + instance.server = server; + ^instance; } + + cancel{ + if(this.server.notNil) + {this.server.sendMsg("/u_cmd", this.synth.nodeID, this.synthIndex, "cancel")}; + } } diff --git a/src/FluidBufAmpSlice/FluidBufAmpSlice.cpp b/src/FluidBufAmpSlice/FluidBufAmpSlice.cpp index a861cfd..ce9116d 100644 --- a/src/FluidBufAmpSlice/FluidBufAmpSlice.cpp +++ b/src/FluidBufAmpSlice/FluidBufAmpSlice.cpp @@ -11,5 +11,5 @@ PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufAmpSlice", ft); + makeSCWrapper("FluidBufAmpSlice", ft); } diff --git a/src/FluidBufCompose/FluidBufCompose.cpp b/src/FluidBufCompose/FluidBufCompose.cpp index 256009f..ea5f763 100644 --- a/src/FluidBufCompose/FluidBufCompose.cpp +++ b/src/FluidBufCompose/FluidBufCompose.cpp @@ -10,5 +10,5 @@ PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufCompose", ft); + makeSCWrapper("FluidBufCompose", ft); } diff --git a/src/FluidBufHPSS/FluidBufHPSS.cpp b/src/FluidBufHPSS/FluidBufHPSS.cpp index d4f7114..e87633e 100644 --- a/src/FluidBufHPSS/FluidBufHPSS.cpp +++ b/src/FluidBufHPSS/FluidBufHPSS.cpp @@ -11,5 +11,5 @@ PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufHPSS", ft); + makeSCWrapper("FluidBufHPSS", ft); } diff --git a/src/FluidBufLoudness/FluidBufLoudness.cpp b/src/FluidBufLoudness/FluidBufLoudness.cpp index e0b90b1..3a47459 100644 --- a/src/FluidBufLoudness/FluidBufLoudness.cpp +++ b/src/FluidBufLoudness/FluidBufLoudness.cpp @@ -9,5 +9,5 @@ static InterfaceTable *ft; PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufLoudness", ft); + makeSCWrapper("FluidBufLoudness", ft); } diff --git a/src/FluidBufMFCC/FluidBufMFCC.cpp b/src/FluidBufMFCC/FluidBufMFCC.cpp index d4a9912..64a78c3 100644 --- a/src/FluidBufMFCC/FluidBufMFCC.cpp +++ b/src/FluidBufMFCC/FluidBufMFCC.cpp @@ -9,5 +9,5 @@ static InterfaceTable *ft; PluginLoad(FluidSTFTUGen) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufMFCC", ft); + makeSCWrapper("FluidBufMFCC", ft); } diff --git a/src/FluidBufMelBands/FluidBufMelBands.cpp b/src/FluidBufMelBands/FluidBufMelBands.cpp index 9e4a6cb..e91ead2 100644 --- a/src/FluidBufMelBands/FluidBufMelBands.cpp +++ b/src/FluidBufMelBands/FluidBufMelBands.cpp @@ -9,5 +9,5 @@ static InterfaceTable *ft; PluginLoad(FluidSTFTUGen) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufMelBands", ft); + makeSCWrapper("FluidBufMelBands", ft); } diff --git a/src/FluidBufNoveltySlice/FluidBufNoveltySlice.cpp b/src/FluidBufNoveltySlice/FluidBufNoveltySlice.cpp index 52a4054..8880e1c 100644 --- a/src/FluidBufNoveltySlice/FluidBufNoveltySlice.cpp +++ b/src/FluidBufNoveltySlice/FluidBufNoveltySlice.cpp @@ -10,5 +10,5 @@ static InterfaceTable *ft; PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufNoveltySlice", ft); + makeSCWrapper("FluidBufNoveltySlice", ft); } diff --git a/src/FluidBufOnsetSlice/FluidBufOnsetSlice.cpp b/src/FluidBufOnsetSlice/FluidBufOnsetSlice.cpp index aa2b3d3..bbcb4fb 100644 --- a/src/FluidBufOnsetSlice/FluidBufOnsetSlice.cpp +++ b/src/FluidBufOnsetSlice/FluidBufOnsetSlice.cpp @@ -10,5 +10,5 @@ static InterfaceTable *ft; PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufOnsetSlice", ft); + makeSCWrapper("FluidBufOnsetSlice", ft); } diff --git a/src/FluidBufPitch/FluidBufPitch.cpp b/src/FluidBufPitch/FluidBufPitch.cpp index b4e5f8b..c988b8c 100644 --- a/src/FluidBufPitch/FluidBufPitch.cpp +++ b/src/FluidBufPitch/FluidBufPitch.cpp @@ -9,5 +9,5 @@ static InterfaceTable *ft; PluginLoad(FluidSTFTUGen) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufPitch", ft); + makeSCWrapper("FluidBufPitch", ft); } diff --git a/src/FluidBufSines/FluidBufSines.cpp b/src/FluidBufSines/FluidBufSines.cpp index b1d135e..2fbf8e9 100644 --- a/src/FluidBufSines/FluidBufSines.cpp +++ b/src/FluidBufSines/FluidBufSines.cpp @@ -11,6 +11,5 @@ PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufSines", ft); - + makeSCWrapper("FluidBufSines", ft); } diff --git a/src/FluidBufSpectralShape/FluidBufSpectralShape.cpp b/src/FluidBufSpectralShape/FluidBufSpectralShape.cpp index e256c06..fba5c3e 100644 --- a/src/FluidBufSpectralShape/FluidBufSpectralShape.cpp +++ b/src/FluidBufSpectralShape/FluidBufSpectralShape.cpp @@ -10,5 +10,5 @@ static InterfaceTable *ft; PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufSpectralShape", ft); + makeSCWrapper("FluidBufSpectralShape", ft); } diff --git a/src/FluidBufStats/FluidBufStats.cpp b/src/FluidBufStats/FluidBufStats.cpp index fddfaf3..8d33ad2 100644 --- a/src/FluidBufStats/FluidBufStats.cpp +++ b/src/FluidBufStats/FluidBufStats.cpp @@ -10,5 +10,5 @@ PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufStats", ft); + makeSCWrapper("FluidBufStats", ft); } diff --git a/src/FluidBufTransientSlice/FluidBufTransientSlice.cpp b/src/FluidBufTransientSlice/FluidBufTransientSlice.cpp index b7a6536..ec539dd 100644 --- a/src/FluidBufTransientSlice/FluidBufTransientSlice.cpp +++ b/src/FluidBufTransientSlice/FluidBufTransientSlice.cpp @@ -10,5 +10,5 @@ static InterfaceTable* ft; PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufTransientSlice", ft); + makeSCWrapper("FluidBufTransientSlice", ft); } diff --git a/src/FluidBufTransients/FluidBufTransients.cpp b/src/FluidBufTransients/FluidBufTransients.cpp index b6758e5..55c2da9 100644 --- a/src/FluidBufTransients/FluidBufTransients.cpp +++ b/src/FluidBufTransients/FluidBufTransients.cpp @@ -9,5 +9,5 @@ PluginLoad(OfflineFluidDecompositionUGens) { ft = inTable; using namespace fluid::client; - makeSCWrapper("BufTransients", ft); + makeSCWrapper("FluidBufTransients", ft); }