diff --git a/release-packaging/Classes/FluidBufSelect.sc b/release-packaging/Classes/FluidBufSelect.sc new file mode 100644 index 0000000..a9cf200 --- /dev/null +++ b/release-packaging/Classes/FluidBufSelect.sc @@ -0,0 +1,67 @@ +FluidBufSelect : FluidBufProcessor { + + *kr { |source, destination, indices=#[-1], channels=#[-1], trig = 1, blocking = 1| + + var params; + + source = source.asUGenInput; + destination = destination.asUGenInput; + + indices = indices.asArray; + channels = channels.asArray; + + indices = [indices.size] ++ indices; + channels = [channels.size] ++ channels; + + source.isNil.if {"FluidBufSelect: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufSelect: Invalid destination buffer".throw}; + + params = indices ++ channels ++ [trig, blocking] + + ^FluidProxyUgen.kr(\FluidBufSelectTrigger,-1, source, destination, *params); + } + + + *process { |server, source, destination, indices=#[-1], channels=#[-1], freeWhenDone = true, action| + + source = source.asUGenInput; + destination = destination.asUGenInput; + + source.isNil.if {"FluidBufSelect: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufSelect: Invalid destination buffer".throw}; + + + indices = indices.asArray; + channels = channels.asArray; + + + + indices = [indices.size] ++ indices; + channels = [channels.size] ++ channels; + + indices.postln; + + ^this.new(server, nil, [destination]).processList([source, destination]++ indices ++ channels ++ [1], freeWhenDone, action);//NB always blocking + } + + *processBlocking { |server, source, destination, indices=#[-1], channels=#[-1], freeWhenDone = true, action| + + source = source.asUGenInput; + destination = destination.asUGenInput; + + source.isNil.if {"FluidBufSelect: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufSelect: Invalid destination buffer".throw}; + + indices = indices.asArray; + channels = channels.asArray; + + indices = [indices.size] ++ indices; + channels = [channels.size] ++ channels; + + + ^this.new( + server, nil, [destination] + ).processList([source, destination]++ indices ++ channels ++ [1], freeWhenDone, action);//NB always blocking + } +} +FluidBufSelectTrigger : FluidProxyUgen {} diff --git a/release-packaging/Classes/FluidBufSelectEvery.sc b/release-packaging/Classes/FluidBufSelectEvery.sc new file mode 100644 index 0000000..3339e51 --- /dev/null +++ b/release-packaging/Classes/FluidBufSelectEvery.sc @@ -0,0 +1,44 @@ +FluidBufSelectEvery : FluidBufProcessor { + + *kr { |source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, frameHop = 1, channelHop = 1, trig = 1, blocking = 1| + + source = source.asUGenInput; + destination = destination.asUGenInput; + + source.isNil.if {"FluidBufSelectEvery: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufSelectEvery: Invalid destination buffer".throw}; + + ^FluidProxyUgen.kr(\FluidBufSelectEveryTrigger, -1, source, startFrame, numFrames, startChan, numChans, destination, frameHop, channelHop, trig, blocking); + } + + *process { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, frameHop = 1, channelHop = 1, freeWhenDone = true, action| + + source = source.asUGenInput; + destination = destination.asUGenInput; + + source.isNil.if {"FluidBufSelectEvery: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufSelectEvery: Invalid destination buffer".throw}; + + ^this.new( + server, nil, [destination] + ).processList( + [source, startFrame, numFrames, startChan, numChans, destination, frameHop, channelHop, 0], freeWhenDone, action + ); + } + + *processBlocking { |server, source, startFrame = 0, numFrames = -1, startChan = 0, numChans = -1, destination, frameHop = 1, channelHop = 1, freeWhenDone = true, action| + + source = source.asUGenInput; + destination = destination.asUGenInput; + + source.isNil.if {"FluidBufSelectEvery: Invalid source buffer".throw}; + destination.isNil.if {"FluidBufSelectEvery: Invalid destination buffer".throw}; + + ^this.new( + server, nil, [destination] + ).processList( + [source, startFrame, numFrames, startChan, numChans, destination, frameHop, channelHop, 1], freeWhenDone, action + ); + } +} +FluidBufSelectEveryTrigger : FluidProxyUgen {} diff --git a/src/FluidBufSelect/CMakeLists.txt b/src/FluidBufSelect/CMakeLists.txt new file mode 100644 index 0000000..9646a4e --- /dev/null +++ b/src/FluidBufSelect/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/FluidBufSelect/FluidBufSelect.cpp b/src/FluidBufSelect/FluidBufSelect.cpp new file mode 100644 index 0000000..43fc58a --- /dev/null +++ b/src/FluidBufSelect/FluidBufSelect.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("FluidBufSelect", ft); +} diff --git a/src/FluidBufSelectEvery/CMakeLists.txt b/src/FluidBufSelectEvery/CMakeLists.txt new file mode 100644 index 0000000..9646a4e --- /dev/null +++ b/src/FluidBufSelectEvery/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/FluidBufSelectEvery/FluidBufSelectEvery.cpp b/src/FluidBufSelectEvery/FluidBufSelectEvery.cpp new file mode 100644 index 0000000..87c1d9b --- /dev/null +++ b/src/FluidBufSelectEvery/FluidBufSelectEvery.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("FluidBufSelectEvery", ft); +}