Merge pull request #173 from flucoma/pre-production

[release] 1.0.7
nix
tremblap 2 years ago committed by GitHub
commit 34a5435159
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,121 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: false
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Merge
# Try and group includes by 'locality'
# We use "" with rel paths for headers in same repo
# Headers in quotes wiht no relative path at top
# Group ../ and ../../ with different priorities, so they get sorted separately
# <> headers *with a folder break* likely not to be STL -> STL / systems headers last
IncludeCategories:
- Regex: '<.+/'
Priority: 4
- Regex: '"../../'
Priority: 3
- Regex: '../' #
Priority: 2
- Regex: '".+hpp"'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...

18
.gitattributes vendored

@ -0,0 +1,18 @@
* text=auto
*.cmake text
*.cpp text
*.csv text
*.gitignore text
*.hpp text
*.in text
*.json text
*.md text
*.sc text
*.scd text
*.schelp text
*.txt text
*.yaml text
*.yml text
*.png binary

@ -93,19 +93,20 @@ jobs:
with: with:
name: linuxbuild name: linuxbuild
- uses: dev-drprasad/delete-tag-and-release@v0.2.0 - uses: dev-drprasad/delete-tag-and-release@v0.2.1
with: with:
delete_release: true # default: false delete_release: true # default: false
tag_name: nightly # tag name to delete tag_name: nightly # tag name to delete
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: package and upload - name: create release
uses: softprops/action-gh-release@v1 uses: ncipollo/release-action@v1
with: with:
name: FluCoMa SuperCollider Nightly Release name: FluCoMa SuperCollider Nightly Release
artifacts: "FluCoMa*"
body: "This is a nightly build of the FluCoMa SuperCollider package. As such, be warned there may be bugs or other unexpected behaviour. The build hash is ${{ github.sha }}" body: "This is a nightly build of the FluCoMa SuperCollider package. As such, be warned there may be bugs or other unexpected behaviour. The build hash is ${{ github.sha }}"
files: FluCoMa* tag: nightly
prerelease: true prerelease: true
tag_name: nightly
draft: false draft: false
allowUpdates: true

@ -1,4 +1,4 @@
# Copyright 2017-2019 University of Huddersfield. # Copyright University of Huddersfield.
# Licensed under the BSD-3 License. # Licensed under the BSD-3 License.
# See license.md file in the project root for full license information. # See license.md file in the project root for full license information.
# This project has received funding from the European Research Council (ERC) # This project has received funding from the European Research Council (ERC)
@ -132,11 +132,6 @@ if(APPLE OR WIN32)
set(CMAKE_SHARED_MODULE_SUFFIX ".scx") set(CMAKE_SHARED_MODULE_SUFFIX ".scx")
endif() endif()
#needed for complaint-free static linking with GCC
if(CMAKE_COMPILER_IS_GNUCXX)
target_compile_options( HISSTools_FFT PUBLIC -fPIC )
endif()
#sandbox regrettable dependency on SC internals for SendReply() #sandbox regrettable dependency on SC internals for SendReply()
if(SYSTEM_BOOST) if(SYSTEM_BOOST)

@ -1,6 +1,6 @@
BSD 3-Clause License BSD 3-Clause License
Copyright (c) 2017-2020 University of Huddersfield Copyright University of Huddersfield
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

@ -1,6 +1,6 @@
/* /*
Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
Copyright 2017-2019 University of Huddersfield. Copyright University of Huddersfield.
Licensed under the BSD-3 License. Licensed under the BSD-3 License.
See license.md file in the project root for full license information. See license.md file in the project root for full license information.
This project has received funding from the European Research Council (ERC) This project has received funding from the European Research Council (ERC)
@ -38,12 +38,14 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
bool mInit{false}; bool mInit{false};
public: public:
template <size_t N, typename T> template <size_t N, typename T>
using ArgumentSetter = typename ClientParams<FluidSCWrapper>::template Setter<sc_msg_iter, N, T>; using ArgumentSetter =
typename ClientParams<FluidSCWrapper>::template Setter<sc_msg_iter, N, T>;
template <size_t N, typename T> template <size_t N, typename T>
using ControlSetter = typename ClientParams<FluidSCWrapper>::template Setter<FloatControlsIter, N, T>; using ControlSetter =
typename ClientParams<FluidSCWrapper>::template Setter<FloatControlsIter,
N, T>;
using Client = C; using Client = C;
using ParamSetType = typename C::ParamSetType; using ParamSetType = typename C::ParamSetType;
@ -70,10 +72,10 @@ public:
std::string commandName("/"); std::string commandName("/");
commandName += getName(); commandName += getName();
commandName += "/version"; commandName += "/version";
ft->fDefinePlugInCmd(commandName.c_str(), ft->fDefinePlugInCmd(
commandName.c_str(),
[](World*, void*, sc_msg_iter*, void*) { doVersion(nullptr, nullptr); }, [](World*, void*, sc_msg_iter*, void*) { doVersion(nullptr, nullptr); },
nullptr); nullptr);
} }
static auto& setParams(Unit* x, ParamSetType& p, FloatControlsIter& inputs, static auto& setParams(Unit* x, ParamSetType& p, FloatControlsIter& inputs,
@ -84,7 +86,9 @@ public:
using Reportage = decltype(static_cast<FluidSCWrapper*>(x)->mReportage); using Reportage = decltype(static_cast<FluidSCWrapper*>(x)->mReportage);
Reportage* reportage = initialized ? &(static_cast<FluidSCWrapper*>(x)->mReportage) : new Reportage(); Reportage* reportage = initialized
? &(static_cast<FluidSCWrapper*>(x)->mReportage)
: new Reportage();
p.template setParameterValuesRT<ControlSetter>( p.template setParameterValuesRT<ControlSetter>(
verbose ? reportage : nullptr, x, inputs, p, alloc); verbose ? reportage : nullptr, x, inputs, p, alloc);
@ -100,35 +104,27 @@ public:
return p; return p;
} }
// static void printResult(SharedState<C>& x, Result& r)
// {
// if (!x.get() || !x->mNodeAlive) return;
// FluidSCWrapper::printResult(x->mNode->mWorld, r);
// }
static void printResult(World* w, Result& r) static void printResult(World* w, Result& r)
{ {
switch (r.status()) switch (r.status())
{ {
case Result::Status::kWarning: case Result::Status::kWarning: {
{
if (!w || w->mVerbosity > 0) if (!w || w->mVerbosity > 0)
std::cout << "WARNING: " << getName() << " - " << r.message().c_str() << '\n'; std::cout << "WARNING: " << getName() << " - " << r.message().c_str()
<< '\n';
break; break;
} }
case Result::Status::kError: case Result::Status::kError: {
{ std::cout << "ERROR: " << getName() << " - " << r.message().c_str()
std::cout << "ERROR: " << getName() << " - " << r.message().c_str() << '\n'; << '\n';
break; break;
} }
case Result::Status::kCancelled: case Result::Status::kCancelled: {
{
std::cout << getName() << ": Task cancelled\n" << '\n'; std::cout << getName() << ": Task cancelled\n" << '\n';
break; break;
} }
default: default: {
{
} }
} }
} }

@ -1,6 +1,6 @@
/* /*
Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
Copyright 2017-2019 University of Huddersfield. Copyright University of Huddersfield.
Licensed under the BSD-3 License. Licensed under the BSD-3 License.
See license.md file in the project root for full license information. See license.md file in the project root for full license information.
This project has received funding from the European Research Council (ERC) This project has received funding from the European Research Council (ERC)

@ -1,8 +1,8 @@
#pragma once #pragma once
#include <Eigen/Core>
#include <data/FluidMemory.hpp> #include <data/FluidMemory.hpp>
#include <SC_PlugIn.hpp> #include <SC_PlugIn.hpp>
#include <Eigen/Core>
namespace fluid { namespace fluid {
namespace client { namespace client {
@ -84,7 +84,8 @@ struct RealTimeBase
} }
void init(SCUnit& unit, Client& client, FloatControlsIter& controls, Allocator& alloc) void init(SCUnit& unit, Client& client, FloatControlsIter& controls,
Allocator& alloc)
{ {
assert(!(client.audioChannelsOut() > 0 && assert(!(client.audioChannelsOut() > 0 &&
client.controlChannelsOut().count > 0) && client.controlChannelsOut().count > 0) &&
@ -113,16 +114,22 @@ struct RealTimeBase
} }
else if (client.controlChannelsIn()) else if (client.controlChannelsIn())
{ {
mControlInputBuffer.resize(unit.mSpecialIndex + 1); mControlInputBuffer.resize(client.controlChannelsIn(),
mAudioInputs.emplace_back(mControlInputBuffer); (unit.mSpecialIndex + 1) /
client.controlChannelsIn());
for (index i = 0; i < client.controlChannelsIn(); ++i)
{
mAudioInputs.emplace_back(mControlInputBuffer.row(i));
}
mInputMapper = &RealTimeBase::mapControlInputs; mInputMapper = &RealTimeBase::mapControlInputs;
} }
else mInputMapper = &RealTimeBase::mapNoOp; else { mInputMapper = &RealTimeBase::mapNoOp; }
index outputSize = client.controlChannelsOut().size > 0 index outputSize = client.controlChannelsOut().size > 0
? std::max(client.audioChannelsOut(), ? std::max(client.audioChannelsOut(),
client.maxControlChannelsOut()) client.maxControlChannelsOut())
: unit.mSpecialIndex + 1; : (unit.mSpecialIndex + 1);
mOutputs.reserve(asUnsigned(outputSize)); mOutputs.reserve(asUnsigned(outputSize));
if (client.audioChannelsOut()) if (client.audioChannelsOut())
@ -177,18 +184,27 @@ struct RealTimeBase
} }
} }
void mapControlInputs(SCUnit& unit, Client&) void mapControlInputs(SCUnit& unit, Client& client)
{ {
for (index i = 0; i < unit.mSpecialIndex + 1; ++i) assert((unit.mSpecialIndex + 1) % client.controlChannelsIn() == 0 &&
"Control channels can't be mapped");
index itemsPerChannel =
(unit.mSpecialIndex + 1) / client.controlChannelsIn();
for (index i = 0, offset = 0; i < client.controlChannelsIn();
++i, offset += itemsPerChannel)
{ {
assert(i <= std::numeric_limits<int>::max()); for (index j = 0; j < itemsPerChannel; ++j)
mControlInputBuffer[i] = unit.in0(static_cast<int>(i)); {
assert(j <= std::numeric_limits<int>::max());
mControlInputBuffer(i, j) = unit.in0(static_cast<int>(offset + j));
}
} }
} }
void mapControlOutputs(SCUnit& unit, Client&) void mapControlOutputs(SCUnit& unit, Client&)
{ {
index numOuts = std::min<index>(mControlOutputBuffer.size(),unit.mNumOutputs); index numOuts =
std::min<index>(mControlOutputBuffer.size(), unit.mNumOutputs);
for (index i = 0; i < numOuts; ++i) for (index i = 0; i < numOuts; ++i)
{ {
@ -228,7 +244,7 @@ private:
std::vector<bool> mOutputConnections; std::vector<bool> mOutputConnections;
std::vector<HostVector> mAudioInputs; std::vector<HostVector> mAudioInputs;
std::vector<HostVector> mOutputs; std::vector<HostVector> mOutputs;
FluidTensor<float, 1> mControlInputBuffer; FluidTensor<float, 2> mControlInputBuffer;
FluidTensor<float, 1> mControlOutputBuffer; FluidTensor<float, 1> mControlOutputBuffer;
bool mPrevTrig; bool mPrevTrig;
IOMapFn mInputMapper; IOMapFn mInputMapper;

@ -1,6 +1,6 @@
/* /*
Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
Copyright 2017-2019 University of Huddersfield. Copyright University of Huddersfield.
Licensed under the BSD-3 License. Licensed under the BSD-3 License.
See license.md file in the project root for full license information. See license.md file in the project root for full license information.
This project has received funding from the European Research Council (ERC) This project has received funding from the European Research Council (ERC)

@ -110,4 +110,13 @@ FluidDataSet : FluidDataObject
actions[\kNearest] = [strings(FluidMessageResponse,_,_),action]; actions[\kNearest] = [strings(FluidMessageResponse,_,_),action];
this.prSendMsg(this.kNearestMsg(buffer,k)); this.prSendMsg(this.kNearestMsg(buffer,k));
} }
kNearestDistMsg {|buffer, k|
^this.prMakeMsg(\kNearestDist,id,this.prEncodeBuffer(buffer),k);
}
kNearestDist { |buffer, k, action|
actions[\kNearestDist] = [numbers(FluidMessageResponse,_,nil,_),action];
this.prSendMsg(this.kNearestDistMsg(buffer,k));
}
} }

@ -3,7 +3,7 @@ FluidSineFeature : FluidRTMultiOutUGen {
maxNumPeaks = maxNumPeaks ? numPeaks; maxNumPeaks = maxNumPeaks ? numPeaks;
^this.multiNew('control', in.asAudioRateInput(this), numPeaks, maxNumPeaks, detectionThreshold, order, freqUnit, magUnit, windowSize, hopSize, fftSize, maxFFTSize) ^this.multiNew('control', in.asAudioRateInput(this), numPeaks, maxNumPeaks, detectionThreshold, order, freqUnit, magUnit, windowSize, hopSize, fftSize, maxFFTSize).reshape(2,maxNumPeaks)
} }
init { arg ... theInputs; init { arg ... theInputs;

@ -1,5 +1,5 @@
# Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) # Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
# Copyright 2017-2019 University of Huddersfield. # Copyright University of Huddersfield.
# Licensed under the BSD-3 License. # Licensed under the BSD-3 License.
# See license.md file in the project root for full license information. # See license.md file in the project root for full license information.
# This project has received funding from the European Research Council (ERC) # This project has received funding from the European Research Council (ERC)

@ -1,5 +1,5 @@
# Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) # Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
# Copyright 2017-2019 University of Huddersfield. # Copyright University of Huddersfield.
# Licensed under the BSD-3 License. # Licensed under the BSD-3 License.
# See license.md file in the project root for full license information. # See license.md file in the project root for full license information.
# This project has received funding from the European Research Council (ERC) # This project has received funding from the European Research Council (ERC)
@ -42,7 +42,6 @@ function(add_sc_extension PLUGIN FILENAME)
PRIVATE PRIVATE
FLUID_DECOMPOSITION FLUID_DECOMPOSITION
FLUID_SC_WRAPPER FLUID_SC_WRAPPER
HISSTools_FFT
) )
target_include_directories( target_include_directories(

Loading…
Cancel
Save