From a09ad2fc127819b1b070d919e51854d2f17fa1a8 Mon Sep 17 00:00:00 2001 From: weefuzzy Date: Thu, 28 Apr 2022 12:33:40 +0100 Subject: [PATCH 1/3] CMake: Centralise C++ version and set to 17 --- CMakeLists.txt | 5 ++++- scripts/target_post.cmake | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40c5273a..bbe8ebcf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,10 @@ cmake_minimum_required(VERSION 3.11) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + ################################################################################ # Paths set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/install" CACHE PATH "") @@ -22,7 +26,6 @@ set(FLUID_PATH "" CACHE PATH "Optional path to the Fluid Decomposition repo") if (APPLE) set(CMAKE_XCODE_GENERATE_SCHEME ON) - set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "") #A consequence of targetting 10.8. Needs to be set globally from 10.15 onwards in order for the test program to compile successfully during configure string(APPEND CMAKE_CXX_FLAGS " -stdlib=libc++") diff --git a/scripts/target_post.cmake b/scripts/target_post.cmake index cce96580..487c4ac5 100644 --- a/scripts/target_post.cmake +++ b/scripts/target_post.cmake @@ -5,7 +5,7 @@ # under the European Union’s Horizon 2020 research and innovation programme # (grant agreement No 725899). -target_compile_features(${PLUGIN} PRIVATE cxx_std_14) +# target_compile_features(${PLUGIN} PRIVATE cxx_std_14) if(MSVC) target_compile_options(${PLUGIN} PRIVATE /W3) @@ -20,11 +20,11 @@ else() endif() endif() -set_target_properties(${PLUGIN} PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED YES - CXX_EXTENSIONS NO -) +# set_target_properties(${PLUGIN} PROPERTIES +# CXX_STANDARD 14 +# CXX_STANDARD_REQUIRED YES +# CXX_EXTENSIONS NO +# ) if(APPLE) set_target_properties(${PLUGIN} PROPERTIES From c4e47670d5f24a6ed18314f623689e5e8dffe5f9 Mon Sep 17 00:00:00 2001 From: weefuzzy Date: Thu, 28 Apr 2022 12:34:35 +0100 Subject: [PATCH 2/3] Wrapper: handle new LongRuntimeMax param type --- include/wrapper/ArgsFromClient.hpp | 11 +++++++++++ include/wrapper/RealTimeBase.hpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/wrapper/ArgsFromClient.hpp b/include/wrapper/ArgsFromClient.hpp index 88ae458b..36a584de 100644 --- a/include/wrapper/ArgsFromClient.hpp +++ b/include/wrapper/ArgsFromClient.hpp @@ -114,6 +114,12 @@ struct ParamReader 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) + { + return typename LongRuntimeMaxT::type{static_cast(args.next()), static_cast(args.next())}; + } + }; // NRT case: we're decoding data from sc_msg_iter*, there will be a World*, we can't have LocalBufs @@ -266,6 +272,11 @@ struct ParamReader res[i] = static_cast(args.geti()); return res; } + + static auto fromArgs(World*,sc_msg_iter& args,typename LongRuntimeMaxT::type&, int) + { + return typename LongRuntimeMaxT::type{args.geti(), args.geti()}; + } }; diff --git a/include/wrapper/RealTimeBase.hpp b/include/wrapper/RealTimeBase.hpp index cd228f23..2814af51 100644 --- a/include/wrapper/RealTimeBase.hpp +++ b/include/wrapper/RealTimeBase.hpp @@ -118,7 +118,7 @@ struct RealTimeBase index outputSize = client.controlChannelsOut().size > 0 ? std::max(client.audioChannelsOut(), - client.controlChannelsOut().size) + client.maxControlChannelsOut()) : unit.mSpecialIndex + 1; mOutputs.reserve(asUnsigned(outputSize)); From af2174577a9f4b58a7e412e2fbe96c61212c2a39 Mon Sep 17 00:00:00 2001 From: weefuzzy Date: Thu, 28 Apr 2022 12:35:10 +0100 Subject: [PATCH 3/3] POC for new LongRuntimeMax param with MFCC numCoeffs --- release-packaging/Classes/FluidMFCC.sc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/release-packaging/Classes/FluidMFCC.sc b/release-packaging/Classes/FluidMFCC.sc index ac1f695e..406e84fe 100644 --- a/release-packaging/Classes/FluidMFCC.sc +++ b/release-packaging/Classes/FluidMFCC.sc @@ -1,18 +1,21 @@ FluidMFCC : FluidRTMultiOutUGen { - *kr { arg in = 0, numCoeffs = 13, numBands = 40, startCoeff = 0, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, maxNumCoeffs = 13, maxFFTSize = 16384; - ^this.multiNew('control', in.asAudioRateInput(this), numCoeffs, numBands, startCoeff, minFreq, maxFreq, maxNumCoeffs, windowSize, hopSize, fftSize, maxFFTSize); + *kr { arg in = 0, numCoeffs = 13, numBands = 40, startCoeff = 0, minFreq = 20, maxFreq = 20000, windowSize = 1024, hopSize = -1, fftSize = -1, maxNumCoeffs = nil, maxFFTSize = 16384; + + maxNumCoeffs = maxNumCoeffs ? numCoeffs; + + ^this.multiNew('control', in.asAudioRateInput(this), numCoeffs, maxNumCoeffs, numBands, startCoeff, minFreq, maxFreq, windowSize, hopSize, fftSize, maxFFTSize); } init {arg ...theInputs; inputs = theInputs; - ^this.initOutputs(inputs.at(6),rate);//this instantiate the number of output from the maxNumCoeffs in the multiNew order + ^this.initOutputs(inputs.at(2),rate);//this instantiate the number of output from the maxNumCoeffs in the multiNew order } checkInputs { // the checks of rates here are in the order of the kr method definition - if(inputs.at(6).rate != 'scalar') { + if(inputs.at(2).rate != 'scalar') { ^(": maxNumCoeffs cannot be modulated."); }; if(inputs.at(10).rate != 'scalar') {