Skip to content

Commit 5bb4245

Browse files
tremblapweefuzzytedmoore
authored
[release] 1.0.5 (#150)
* 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]>
1 parent b8c057f commit 5bb4245

File tree

9 files changed

+67
-38
lines changed

9 files changed

+67
-38
lines changed

.github/workflows/nightly.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161

6262
linuxbuild:
63-
runs-on: ubuntu-latest
63+
runs-on: ubuntu-20.04
6464
steps:
6565
- uses: actions/checkout@v3
6666
- uses: flucoma/actions/env@main
@@ -77,7 +77,7 @@ jobs:
7777
path: install/FluCoMa-SC-Linux-nightly.tar.gz
7878

7979
release:
80-
runs-on: ubuntu-latest
80+
runs-on: ubuntu-20.04
8181
needs: [macbuild, winbuild, linuxbuild]
8282
steps:
8383

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
path: install/FluCoMa-SC-Windows.zip
5454

5555
linuxbuild:
56-
runs-on: ubuntu-latest
56+
runs-on: ubuntu-20.04
5757
outputs:
5858
version: ${{ steps.get-version.outputs.version }}
5959
steps:
@@ -77,7 +77,7 @@ jobs:
7777
working-directory: build/_deps/flucoma-core-src
7878

7979
release:
80-
runs-on: ubuntu-latest
80+
runs-on: ubuntu-20.04
8181
needs: [macbuild, winbuild, linuxbuild]
8282

8383
steps:

include/FluidSCWrapper.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
8585
using Reportage = decltype(static_cast<FluidSCWrapper*>(x)->mReportage);
8686

8787
Reportage* reportage = initialized ? &(static_cast<FluidSCWrapper*>(x)->mReportage) : new Reportage();
88-
89-
p.template setParameterValuesRT<ControlSetter>(verbose ? reportage: nullptr , x, inputs, alloc);
88+
89+
p.template setParameterValuesRT<ControlSetter>(
90+
verbose ? reportage : nullptr, x, inputs, p, alloc);
9091
if (constrain) p.constrainParameterValuesRT(verbose ? reportage : nullptr);
9192
if(verbose)
9293
{

include/wrapper/ArgsFromClient.hpp

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,13 @@ struct ParamReader<impl::FloatControlsIter>
126126
auto id = fromArgs(x, args, index{}, 0);
127127
return {id >= 0 ? std::to_string(id).c_str() : "" };
128128
}
129-
130-
static auto fromArgs(Unit*,Controls& args,typename LongRuntimeMaxT::type&, int)
129+
130+
static auto fromArgs(Unit*, Controls& args, typename LongRuntimeMaxT::type&,
131+
int)
131132
{
132-
return typename LongRuntimeMaxT::type{static_cast<index>(args.next()), static_cast<index>(args.next())};
133+
return typename LongRuntimeMaxT::type{static_cast<index>(args.next()),
134+
static_cast<index>(args.next())};
133135
}
134-
135136
};
136137

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

330331

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

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

354-
return a.value();
357+
/// He said "I don't like it, but I have to go along with it"
358+
/// Make sure that the maximum for LongRuntimeMax params is
359+
/// properly constrained *as soon as possible*
360+
if constexpr (std::is_same_v<T, LongRuntimeMaxT>)
361+
{
362+
auto param = a.value();
363+
index maximum = param.maxRaw();
364+
maximum = p.template applyConstraintToMax<N>(maximum);
365+
return LongRuntimeMaxParam(param(), maximum);
366+
}
367+
else
368+
return a.value();
355369
}
356-
357-
template<typename Context, typename Client = typename Wrapper::Client, size_t Number = N>
358-
std::enable_if_t<impl::IsNamedShared_v<Client> && Number==0, typename T::type>
359-
operator()(Context* x, ArgType& args, Allocator& alloc)
370+
371+
template <typename Context, typename Params,
372+
typename Client = typename Wrapper::Client, size_t Number = N>
373+
std::enable_if_t<impl::IsNamedShared_v<Client> && Number == 0,
374+
typename T::type>
375+
operator()(Context* x, ArgType& args, Params&, Allocator& alloc)
360376
{
361377
// Just return default if there's nothing left to grab
362378
if (args.remain() == 0)

include/wrapper/NonRealtime.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,16 @@ class NonRealTime : public SCUnit
272272
: NRTCommand{world, args, replyAddr, !IsNamedShared_v<Client>},
273273
mParams{Client::getParameterDescriptors(), NRTCommand::allocator()}
274274
{
275-
mParams.template setParameterValuesRT<ParamsFromOSC>(nullptr, world,
276-
*args, NRTCommand::allocator());
275+
mParams.template setParameterValuesRT<ParamsFromOSC>(
276+
nullptr, world, *args, mParams, NRTCommand::allocator());
277277
}
278278

279279
CommandNew(index id, World* world, FloatControlsIter& args, Unit* x)
280280
: NRTCommand{world, id}, mParams{Client::getParameterDescriptors(),
281281
NRTCommand::allocator()}
282282
{
283283
mParams.template setParameterValuesRT<ParamsFromSynth>(
284-
nullptr, x, args, NRTCommand::allocator());
284+
nullptr, x, args, mParams, NRTCommand::allocator());
285285
}
286286

287287
static const char* name()
@@ -364,8 +364,8 @@ class NonRealTime : public SCUnit
364364
if (auto ptr = get(NRTCommand::mID).lock())
365365
{
366366
ptr->mDone.store(false, std::memory_order_release);
367-
mParams.template setParameterValuesRT<ParamsFromOSC>(nullptr, world,
368-
ar, NRTCommand::allocator());
367+
mParams.template setParameterValuesRT<ParamsFromOSC>(
368+
nullptr, world, ar, mParams, NRTCommand::allocator());
369369
mSynchronous = static_cast<bool>(ar.geti());
370370
} // if this fails, we'll hear about it in stage2 anyway
371371
}
@@ -716,7 +716,7 @@ class NonRealTime : public SCUnit
716716
if (auto ptr = get(NRTCommand::mID).lock())
717717
{
718718
ptr->mParams.template setParameterValuesRT<ParamsFromOSC>(
719-
nullptr, world, ar, NRTCommand::allocator());
719+
nullptr, world, ar, ptr->mParams, NRTCommand::allocator());
720720
Result result = validateParameters(ptr->mParams);
721721
ptr->mClient.setParams(ptr->mParams);
722722
}
@@ -747,7 +747,7 @@ class NonRealTime : public SCUnit
747747
if (auto ptr = get(NRTCommand::mID).lock())
748748
{
749749
ptr->mParams.template setParameterValues<ParamsFromOSC>(
750-
true, world, mArgs, FluidDefaultAllocator());
750+
true, world, mArgs, ptr->mParams, FluidDefaultAllocator());
751751
Result result = validateParameters(ptr->mParams);
752752
ptr->mClient.setParams(ptr->mParams);
753753
}

release-packaging/Classes/FluidBufSines.sc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FluidBufSines : FluidBufProcessor {
22

3-
*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|
3+
*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|
44

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

@@ -10,10 +10,10 @@ FluidBufSines : FluidBufProcessor {
1010

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

13-
^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);
13+
^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);
1414
}
1515

16-
*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|
16+
*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|
1717

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

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

33-
*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|
33+
*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|
3434

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

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

release-packaging/Classes/FluidDataSet.sc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,13 @@ FluidDataSet : FluidDataObject
101101
actions[\getIds] = [nil,action];
102102
this.prSendMsg(this.getIdsMsg(labelSet));
103103
}
104+
105+
kNearestMsg{|buffer,k|
106+
^this.prMakeMsg(\kNearest,id, this.prEncodeBuffer(buffer),k);
107+
}
108+
109+
kNearest{ |buffer, k, action|
110+
actions[\kNearest] = [strings(FluidMessageResponse,_,_),action];
111+
this.prSendMsg(this.kNearestMsg(buffer,k));
112+
}
104113
}

release-packaging/Classes/FluidKDTree.sc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ FluidKDTree : FluidModelObject
3636
this.prSendMsg(this.kNearestMsg(buffer,k));
3737
}
3838

39-
kNearestDistMsg {|buffer|
40-
^this.prMakeMsg(\kNearestDist,id,this.prEncodeBuffer(buffer));
39+
kNearestDistMsg {|buffer, k|
40+
k !?
41+
{^this.prMakeMsg(\kNearestDist,id,this.prEncodeBuffer(buffer),k);}
42+
??
43+
{^this.prMakeMsg(\kNearestDist,id,this.prEncodeBuffer(buffer));}
4144
}
4245

43-
kNearestDist { |buffer, action|
46+
kNearestDist { |buffer, k, action|
4447
actions[\kNearestDist] = [numbers(FluidMessageResponse,_,nil,_),action];
45-
this.prSendMsg(this.kNearestDistMsg(buffer));
48+
this.prSendMsg(this.kNearestDistMsg(buffer,k));
4649
}
4750

4851
kr{|trig, inputBuffer,outputBuffer, numNeighbours = 1, lookupDataSet|

release-packaging/Classes/FluidSines.sc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FluidSines : FluidRTMultiOutUGen {
2-
*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;
3-
^this.multiNew('audio', in.asAudioRateInput(this), bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackingMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize, maxFFTSize)
2+
*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;
3+
^this.multiNew('audio', in.asAudioRateInput(this), bandwidth, detectionThreshold,birthLowThreshold, birthHighThreshold, minTrackLen, trackMethod, trackMagRange, trackFreqRange, trackProb, windowSize, hopSize, fftSize, maxFFTSize)
44
}
55
init { arg ... theInputs;
66
inputs = theInputs;

0 commit comments

Comments
 (0)