Add NRT novelty segmentation
parent
b0307f9192
commit
519fd46f2a
@ -0,0 +1,13 @@
|
||||
FluidBufNoveltySlice{
|
||||
*process { arg server, src, offsetframes = 0, numframes = -1, offsetchans = 0, numchans = -1, transbuf, kernelsize = 3, threshold = 0.8, winsize = 1024, hopsize = 512, fftsize = 2048;
|
||||
|
||||
server = server ? Server.default;
|
||||
if(src.isNil) {Error("Invalid Source Buffer").format(thisMethod.name, this.class.name).throw};
|
||||
if(transbuf.isNil) {Error("Invalid Slices Buffer").format(thisMethod.name, this.class.name).throw};
|
||||
server.sendMsg(\cmd, \BufNoveltySlice, src, offsetframes, numframes, offsetchans, numchans,
|
||||
transbuf, kernelsize, threshold, winsize, hopsize, fftsize);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
get_filename_component(PLUGIN ${CMAKE_CURRENT_LIST_DIR} NAME_WE)
|
||||
message("Configuring ${PLUGIN}")
|
||||
set(FILENAME ${PLUGIN}.cpp)
|
||||
|
||||
add_library(
|
||||
${PLUGIN}
|
||||
MODULE
|
||||
${FILENAME}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
${PLUGIN} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../../include
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
${PLUGIN} PRIVATE FLUID_DECOMPOSITION
|
||||
)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../../scripts/target_post.cmake)
|
||||
@ -0,0 +1,71 @@
|
||||
s.reboot
|
||||
////////////////////////////
|
||||
// test for efficiency
|
||||
|
||||
(
|
||||
b = Buffer.read(s,"/Users/owen/Box Sync/FluCoMa/Temporary/GLRSegmentation/SegmentationExample.wav");
|
||||
c = Buffer.new(s);
|
||||
)
|
||||
b.query
|
||||
(
|
||||
// with basic params
|
||||
Routine{
|
||||
t = Main.elapsedTime;
|
||||
FluidBufNoveltySlice.process(s,b.bufnum, transbuf:c.bufnum, threshold:0.5);
|
||||
s.sync;
|
||||
(Main.elapsedTime - t).postln;
|
||||
}.play
|
||||
);
|
||||
|
||||
//check the number of slices
|
||||
c.query;
|
||||
|
||||
//loops over a splice
|
||||
(
|
||||
{
|
||||
BufRd.ar(
|
||||
1,
|
||||
b.bufnum,
|
||||
Phasor.ar(
|
||||
0,
|
||||
1,
|
||||
BufRd.kr(
|
||||
1,
|
||||
c.bufnum,
|
||||
MouseX.kr(
|
||||
0,
|
||||
BufFrames.kr(c.bufnum) - 1),
|
||||
0,
|
||||
1),
|
||||
BufRd.kr(
|
||||
1,
|
||||
c.bufnum,
|
||||
MouseX.kr(
|
||||
1,
|
||||
BufFrames.kr(c.bufnum)),
|
||||
0,
|
||||
1),
|
||||
BufRd.kr(
|
||||
1,
|
||||
c.bufnum,
|
||||
MouseX.kr(
|
||||
0,
|
||||
BufFrames.kr(c.bufnum) - 1),
|
||||
0,
|
||||
1)),
|
||||
0,
|
||||
1)
|
||||
}.play;
|
||||
)
|
||||
|
||||
|
||||
// with everything changed to make it much faster
|
||||
(
|
||||
Routine{
|
||||
t = Main.elapsedTime;
|
||||
FluidBufNoveltySlice.process(s,b.bufnum, 44100, 44100, 0, 0, c.bufnum, d.bufnum, 100, 512,256,1,2,1,12,20);
|
||||
s.sync;
|
||||
(Main.elapsedTime - t).postln;
|
||||
}.play
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue