Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:


linuxbuild:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: flucoma/actions/env@main
Expand All @@ -77,7 +77,7 @@ jobs:
path: install/FluCoMa-SC-Linux-nightly.tar.gz

release:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [macbuild, winbuild, linuxbuild]
steps:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
path: install/FluCoMa-SC-Windows.zip

linuxbuild:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
Expand All @@ -77,7 +77,7 @@ jobs:
working-directory: build/_deps/flucoma-core-src

release:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [macbuild, winbuild, linuxbuild]

steps:
Expand Down
5 changes: 3 additions & 2 deletions include/FluidSCWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
using Reportage = decltype(static_cast<FluidSCWrapper*>(x)->mReportage);

Reportage* reportage = initialized ? &(static_cast<FluidSCWrapper*>(x)->mReportage) : new Reportage();

p.template setParameterValuesRT<ControlSetter>(verbose ? reportage: nullptr , x, inputs, alloc);

p.template setParameterValuesRT<ControlSetter>(
verbose ? reportage : nullptr, x, inputs, p, alloc);
if (constrain) p.constrainParameterValuesRT(verbose ? reportage : nullptr);
if(verbose)
{
Expand Down
42 changes: 29 additions & 13 deletions include/wrapper/ArgsFromClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ struct ParamReader<impl::FloatControlsIter>
auto id = fromArgs(x, args, index{}, 0);
return {id >= 0 ? std::to_string(id).c_str() : "" };
}

static auto fromArgs(Unit*,Controls& args,typename LongRuntimeMaxT::type&, int)

static auto fromArgs(Unit*, Controls& args, typename LongRuntimeMaxT::type&,
int)
{
return typename LongRuntimeMaxT::type{static_cast<index>(args.next()), static_cast<index>(args.next())};
return typename LongRuntimeMaxT::type{static_cast<index>(args.next()),
static_cast<index>(args.next())};
}

};

// NRT case: we're decoding data from sc_msg_iter*, there will be a World*, we can't have LocalBufs
Expand Down Expand Up @@ -329,11 +330,13 @@ struct ClientParams{


/// Grizzly enable_if hackage coming up. Need to brute force an int from incoming data into a string param for FluidDataSet / FluidLabelSet.
/// This will go away one day
/// This will go away one day

template<typename Context, typename Client = typename Wrapper::Client, size_t Number = N>
std::enable_if_t<!impl::IsNamedShared_v<Client> || Number!=0, typename T::type>
operator()(Context* x, ArgType& args, Allocator& alloc)
template <typename Context, typename Params,
typename Client = typename Wrapper::Client, size_t Number = N>
std::enable_if_t<!impl::IsNamedShared_v<Client> || Number != 0,
typename T::type>
operator()(Context* x, ArgType& args, Params& p, Allocator& alloc)
{
// Just return default if there's nothing left to grab
if (args.remain() == 0)
Expand All @@ -351,12 +354,25 @@ struct ClientParams{
a[i] = static_cast<LiteralType>(
ParamReader<ArgType>::fromArgs(x, args, a[0], 0));

return a.value();
/// He said "I don't like it, but I have to go along with it"
/// Make sure that the maximum for LongRuntimeMax params is
/// properly constrained *as soon as possible*
if constexpr (std::is_same_v<T, LongRuntimeMaxT>)
{
auto param = a.value();
index maximum = param.maxRaw();
maximum = p.template applyConstraintToMax<N>(maximum);
return LongRuntimeMaxParam(param(), maximum);
}
else
return a.value();
}

template<typename Context, typename Client = typename Wrapper::Client, size_t Number = N>
std::enable_if_t<impl::IsNamedShared_v<Client> && Number==0, typename T::type>
operator()(Context* x, ArgType& args, Allocator& alloc)

template <typename Context, typename Params,
typename Client = typename Wrapper::Client, size_t Number = N>
std::enable_if_t<impl::IsNamedShared_v<Client> && Number == 0,
typename T::type>
operator()(Context* x, ArgType& args, Params&, Allocator& alloc)
{
// Just return default if there's nothing left to grab
if (args.remain() == 0)
Expand Down
14 changes: 7 additions & 7 deletions include/wrapper/NonRealtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,16 @@ class NonRealTime : public SCUnit
: NRTCommand{world, args, replyAddr, !IsNamedShared_v<Client>},
mParams{Client::getParameterDescriptors(), NRTCommand::allocator()}
{
mParams.template setParameterValuesRT<ParamsFromOSC>(nullptr, world,
*args, NRTCommand::allocator());
mParams.template setParameterValuesRT<ParamsFromOSC>(
nullptr, world, *args, mParams, NRTCommand::allocator());
}

CommandNew(index id, World* world, FloatControlsIter& args, Unit* x)
: NRTCommand{world, id}, mParams{Client::getParameterDescriptors(),
NRTCommand::allocator()}
{
mParams.template setParameterValuesRT<ParamsFromSynth>(
nullptr, x, args, NRTCommand::allocator());
nullptr, x, args, mParams, NRTCommand::allocator());
}

static const char* name()
Expand Down Expand Up @@ -364,8 +364,8 @@ class NonRealTime : public SCUnit
if (auto ptr = get(NRTCommand::mID).lock())
{
ptr->mDone.store(false, std::memory_order_release);
mParams.template setParameterValuesRT<ParamsFromOSC>(nullptr, world,
ar, NRTCommand::allocator());
mParams.template setParameterValuesRT<ParamsFromOSC>(
nullptr, world, ar, mParams, NRTCommand::allocator());
mSynchronous = static_cast<bool>(ar.geti());
} // if this fails, we'll hear about it in stage2 anyway
}
Expand Down Expand Up @@ -716,7 +716,7 @@ class NonRealTime : public SCUnit
if (auto ptr = get(NRTCommand::mID).lock())
{
ptr->mParams.template setParameterValuesRT<ParamsFromOSC>(
nullptr, world, ar, NRTCommand::allocator());
nullptr, world, ar, ptr->mParams, NRTCommand::allocator());
Result result = validateParameters(ptr->mParams);
ptr->mClient.setParams(ptr->mParams);
}
Expand Down Expand Up @@ -747,7 +747,7 @@ class NonRealTime : public SCUnit
if (auto ptr = get(NRTCommand::mID).lock())
{
ptr->mParams.template setParameterValues<ParamsFromOSC>(
true, world, mArgs, FluidDefaultAllocator());
true, world, mArgs, ptr->mParams, FluidDefaultAllocator());
Result result = validateParameters(ptr->mParams);
ptr->mClient.setParams(ptr->mParams);
}
Expand Down
12 changes: 6 additions & 6 deletions release-packaging/Classes/FluidBufSines.sc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FluidBufSines : FluidBufProcessor {

*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines = -1, residual = -1, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackingMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 0|
*kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines = -1, residual = -1, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize = 1024, hopSize = -1, fftSize = -1, trig = 1, blocking = 0|

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

Expand All @@ -10,10 +10,10 @@ FluidBufSines : FluidBufProcessor {

source.isNil.if {"FluidBufSines: Invalid source buffer".throw};

^FluidProxyUgen.multiNew(\FluidBufSinesTrigger, -1, source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackingMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking);
^FluidProxyUgen.multiNew(\FluidBufSinesTrigger, -1, source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize, maxFFTSize, trig, blocking);
}

*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines = -1, residual = -1, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackingMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action|
*process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines = -1, residual = -1, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action|

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

Expand All @@ -26,11 +26,11 @@ FluidBufSines : FluidBufProcessor {
^this.new(
server, nil, [sines, residual].select{|x| x!= -1}
).processList(
[source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackingMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize,maxFFTSize,0],freeWhenDone = true,action
[source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize,maxFFTSize,0],freeWhenDone = true,action
);
}

*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines = -1, residual = -1, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackingMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action|
*processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, sines = -1, residual = -1, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize = 1024, hopSize = -1, fftSize = -1, freeWhenDone = true, action|

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

Expand All @@ -43,7 +43,7 @@ FluidBufSines : FluidBufProcessor {
^this.new(
server, nil, [sines, residual].select{|x| x!= -1}
).processList(
[source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackingMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize,maxFFTSize,1],freeWhenDone,action
[source, startFrame, numFrames, startChan, numChans, sines, residual, bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize,maxFFTSize,1],freeWhenDone,action
);
}

Expand Down
9 changes: 9 additions & 0 deletions release-packaging/Classes/FluidDataSet.sc
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,13 @@ FluidDataSet : FluidDataObject
actions[\getIds] = [nil,action];
this.prSendMsg(this.getIdsMsg(labelSet));
}

kNearestMsg{|buffer,k|
^this.prMakeMsg(\kNearest,id, this.prEncodeBuffer(buffer),k);
}

kNearest{ |buffer, k, action|
actions[\kNearest] = [strings(FluidMessageResponse,_,_),action];
this.prSendMsg(this.kNearestMsg(buffer,k));
}
}
11 changes: 7 additions & 4 deletions release-packaging/Classes/FluidKDTree.sc
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ FluidKDTree : FluidModelObject
this.prSendMsg(this.kNearestMsg(buffer,k));
}

kNearestDistMsg {|buffer|
^this.prMakeMsg(\kNearestDist,id,this.prEncodeBuffer(buffer));
kNearestDistMsg {|buffer, k|
k !?
{^this.prMakeMsg(\kNearestDist,id,this.prEncodeBuffer(buffer),k);}
??
{^this.prMakeMsg(\kNearestDist,id,this.prEncodeBuffer(buffer));}
}

kNearestDist { |buffer, action|
kNearestDist { |buffer, k, action|
actions[\kNearestDist] = [numbers(FluidMessageResponse,_,nil,_),action];
this.prSendMsg(this.kNearestDistMsg(buffer));
this.prSendMsg(this.kNearestDistMsg(buffer,k));
}

kr{|trig, inputBuffer,outputBuffer, numNeighbours = 1, lookupDataSet|
Expand Down
4 changes: 2 additions & 2 deletions release-packaging/Classes/FluidSines.sc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FluidSines : FluidRTMultiOutUGen {
*ar { arg in = 0, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackingMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize= 1024, hopSize= -1, fftSize= -1, maxFFTSize = -1;
^this.multiNew('audio', in.asAudioRateInput(this), bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackingMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize, maxFFTSize)
*ar { arg in = 0, bandwidth = 76, detectionThreshold = -96, birthLowThreshold = -24, birthHighThreshold = -60, minTrackLen = 15, trackMethod = 0, trackMagRange = 15, trackFreqRange = 50, trackProb = 0.5, windowSize= 1024, hopSize= -1, fftSize= -1, maxFFTSize = -1;
^this.multiNew('audio', in.asAudioRateInput(this), bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize, maxFFTSize)
}
init { arg ... theInputs;
inputs = theInputs;
Expand Down