Skip to content

Commit

Permalink
[release] 1.0.5 (#150)
Browse files Browse the repository at this point in the history
* Readme: Correct C++ version

* WIP: RT-alloc in RT clients (#129)

* Update Realtime to pass RT allocator to clients

* added link to examples folder in the guide

* Wrapper: Allocatorize Part 1

* (Buf)MFCC.sc: Handle maxNumBands

* (Buf)MFCC.sc: Handle maxNumBands (#130)

* typo

* Remove CondVar (#132)

* removed from FluidWaveform

* typo

* Wrapper: allocatorize

* Remove redundant old help files

* Wrapper: Use `fmt` insetad of `std::to_chars`

(STL function needs macOS >= 10.15)

* CMake: Set PIC globally

* ensure PIC for all libs

* Readme: Correct C++ version

Co-authored-by: Ted Moore <[email protected]>

* correction in example code of the new NN interface

* fixed example: 'Neural Network Predicts FM Params from Audio Analysis'

* Feature/peaks (#143)

* working frankenstein freq only

* removed all the unused arguments

* now with mag out

* now with the buffer version

* change the interface to singular like other bufSTFT

* added logFreq and linMag

* change of interface (sortBy to order)

* last SC commit - object overview added

* method definition for bruteforce knearest (#144)

* feature/kdtree-distance-with-optional-k

* (buf)sines: consistent naming of interface

* Fix/params maxima (#148)

* Readme: Correct C++ version

* Wrapper: constrain runtime param maxima

* Update nightly.yaml

Stay on ubuntu 20.04

* Update release.yml

* Update release.yml

Co-authored-by: weefuzzy <[email protected]>
Co-authored-by: Ted Moore <[email protected]>
  • Loading branch information
3 people authored Dec 15, 2022
1 parent b8c057f commit 5bb4245
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 38 deletions.
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

0 comments on commit 5bb4245

Please sign in to comment.