Enhance/max params (#93)

* CMake: Centralise C++ version and set to 17

* Wrapper: handle new LongRuntimeMax param type

* POC for new LongRuntimeMax param with MFCC numCoeffs
nix
Owen Green 4 years ago committed by GitHub
parent 82cd8769e7
commit 167ea1cc9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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++")

@ -119,6 +119,12 @@ 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)
{
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
@ -285,6 +291,11 @@ struct ParamReader<sc_msg_iter>
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<sc_msg_iter>
{
return Optional<T>{fromArgs(w,args,T{},int{})};
}
};

@ -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));

@ -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') {

@ -5,7 +5,7 @@
# under the European Unions 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

Loading…
Cancel
Save