Add FluidBufSelect and FluidBufSelectEvery

nix
Owen Green 5 years ago
parent 6ace31d7fb
commit 731b04a208

@ -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 {}

@ -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 {}

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

@ -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 Unions Horizon 2020 research and innovation programme
(grant agreement No 725899).
*/
#include <clients/nrt/BufSelectClient.hpp>
#include <FluidSCWrapper.hpp>
static InterfaceTable *ft;
PluginLoad(OfflineFluidDecompositionUGens)
{
ft = inTable;
using namespace fluid::client;
makeSCWrapper<NRTThreadingSelectClient>("FluidBufSelect", ft);
}

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

@ -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 Unions Horizon 2020 research and innovation programme
(grant agreement No 725899).
*/
#include <clients/nrt/BufSelectEveryClient.hpp>
#include <FluidSCWrapper.hpp>
static InterfaceTable *ft;
PluginLoad(OfflineFluidDecompositionUGens)
{
ft = inTable;
using namespace fluid::client;
makeSCWrapper<NRTThreadingSelectEveryClient>("FluidBufSelectEvery", ft);
}
Loading…
Cancel
Save