diff --git a/release-packaging/Classes/FluidBufFlatten.sc b/release-packaging/Classes/FluidBufFlatten.sc new file mode 100644 index 0000000..825e7d3 --- /dev/null +++ b/release-packaging/Classes/FluidBufFlatten.sc @@ -0,0 +1,31 @@ +FluidBufFlatten : UGen { + + *new1 { |rate, source, destination, axis = 1, trig = 1, blocking| + + source = source.asUGenInput; + destination = destination.asUGenInput; + + source.isNil.if {"FluidBufFlatten: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufFlatten: Invalid destination buffer".throw}; + ^super.new1(rate, source, destination, axis, trig, blocking); + } + + *kr { |source, destination, axis = 1, trig = 1| + ^this.new1('control', source, destination, axis, trig, 1); + } + + *process { |server, source, destination, axis = 1, action| + ^FluidNRTProcess.new( + server, this, action, [destination], blocking:1 + ).process( + source, destination, axis + ); + + } + + *processBlocking { |server, source, destination, axis = 1, action| + ^process( + source, destination, axis + ); + } +} diff --git a/src/FluidBufFlatten/CMakeLists.txt b/src/FluidBufFlatten/CMakeLists.txt new file mode 100644 index 0000000..9646a4e --- /dev/null +++ b/src/FluidBufFlatten/CMakeLists.txt @@ -0,0 +1,21 @@ +# Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) +# Copyright 2017-2019 University of Huddersfield. +# Licensed under the BSD-3 License. +# See license.md file in the project root for full license information. +# This project has received funding from the European Research Council (ERC) +# under the European Union’s Horizon 2020 research and innovation programme +# (grant agreement No 725899). + +cmake_minimum_required(VERSION 3.11) + +get_filename_component(PLUGIN ${CMAKE_CURRENT_LIST_DIR} NAME_WE) +message("Configuring ${PLUGIN}") +set(FILENAME ${PLUGIN}.cpp) + +add_library( + ${PLUGIN} + MODULE + ${FILENAME} +) + +include(${CMAKE_CURRENT_LIST_DIR}/../../scripts/target_post.cmake) diff --git a/src/FluidBufFlatten/FluidBufFlatten.cpp b/src/FluidBufFlatten/FluidBufFlatten.cpp new file mode 100644 index 0000000..0a6746c --- /dev/null +++ b/src/FluidBufFlatten/FluidBufFlatten.cpp @@ -0,0 +1,22 @@ +/* +Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/) +Copyright 2017-2019 University of Huddersfield. +Licensed under the BSD-3 License. +See license.md file in the project root for full license information. +This project has received funding from the European Research Council (ERC) +under the European Union’s Horizon 2020 research and innovation programme +(grant agreement No 725899). +*/ + +#include + +#include + +static InterfaceTable *ft; + +PluginLoad(OfflineFluidDecompositionUGens) +{ + ft = inTable; + using namespace fluid::client; + makeSCWrapper("FluidBufFlatten", ft); +}