Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/max params #93

Merged
merged 4 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand All @@ -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++")
Expand Down
11 changes: 11 additions & 0 deletions include/wrapper/ArgsFromClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,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
Expand Down Expand Up @@ -266,6 +272,11 @@ struct ParamReader<sc_msg_iter>
res[i] = static_cast<Value>(args.geti());
return res;
}

static auto fromArgs(World*,sc_msg_iter& args,typename LongRuntimeMaxT::type&, int)
{
return typename LongRuntimeMaxT::type{args.geti(), args.geti()};
}
};


Expand Down
2 changes: 1 addition & 1 deletion include/wrapper/RealTimeBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
11 changes: 7 additions & 4 deletions release-packaging/Classes/FluidMFCC.sc
Original file line number Diff line number Diff line change
@@ -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') {
Expand Down
12 changes: 6 additions & 6 deletions scripts/target_post.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down