diff --git a/CMakeLists.txt b/CMakeLists.txt index 40c5273..bbe8ebc 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/include/wrapper/ArgsFromClient.hpp b/include/wrapper/ArgsFromClient.hpp index e4ea235..9f7b091 100644 --- a/include/wrapper/ArgsFromClient.hpp +++ b/include/wrapper/ArgsFromClient.hpp @@ -119,6 +119,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 @@ -285,6 +291,11 @@ struct ParamReader return res; } + static auto fromArgs(World*,sc_msg_iter& args,typename LongRuntimeMaxT::type&, int) + { + return typename LongRuntimeMaxT::type{args.geti(), args.geti()}; + } + static auto fromArgs(World*, sc_msg_iter& args, typename ChoicesT::type, int) { int x = args.geti(); @@ -296,7 +307,6 @@ struct ParamReader { return Optional{fromArgs(w,args,T{},int{})}; } - }; diff --git a/include/wrapper/RealTimeBase.hpp b/include/wrapper/RealTimeBase.hpp index cd228f2..2814af5 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)); diff --git a/release-packaging/Classes/FluidMFCC.sc b/release-packaging/Classes/FluidMFCC.sc index ac1f695..406e84f 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') { diff --git a/scripts/target_post.cmake b/scripts/target_post.cmake index cce9658..487c4ac 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