diff --git a/release-packaging/HelpSource/Classes/FluidBufCompose.schelp b/release-packaging/HelpSource/Classes/FluidBufCompose.schelp new file mode 100644 index 0000000..d363ef3 --- /dev/null +++ b/release-packaging/HelpSource/Classes/FluidBufCompose.schelp @@ -0,0 +1,79 @@ +TITLE:: FluidBufCompose +summary:: NRT Buffer Compositing Utility +categories:: Libraries>FluidDecomposition, Libraries/Buffers +related:: Guides/FluCoMa, Guides/FluidDecomposition, Classes/Buffer + +DESCRIPTION:: +This Class performs basic compositing on buffers on the non-real-time thread. It avoids having to come back to the language side. It is part of the Fluid Decomposition Toolkit of the FluCoMa project. footnote:: +This was made possible thanks to the FluCoMa project (http://www.flucoma.org/) funded by the European Research Council (https://erc.europa.eu/) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 725899).:: + + The algorythm will take two buffer in, and will put the composited information at the provided dstBuf. + + +CLASSMETHODS:: + +METHOD:: process + This method triggers the compositing. + +ARGUMENT:: server + The server on which the buffers to be processed are allocated. + +ARGUMENT:: srcBufNumA + The bufNum of the first source buffer. + +ARGUMENT:: startAtA + The starting point (in samples) from which to copy in the first source buffer. + +ARGUMENT:: nFramesA + The duration (in samples) to copy from the first source buffer. + +ARGUMENT:: startChanA + The first channel from which to copy in the first source buffer. + +ARGUMENT:: nChansA + The number of channels from which to copy in the first source buffer. This parameter will wrap around the number of channels in the source buffer. + +ARGUMENT:: srcGainA + The gain applied to the samples to be copied from the first source buffer. + +ARGUMENT:: dstStartAtA + The time offset (in samples) in the destination buffer to start writing the first source at. The destination buffer will be resized if the portion to copy is overflowing. + +ARGUMENT:: dstStartChanA + The channel offest in the destination buffer to start writing the first source at. The destination buffer will be resized if the number of channels to copy is overflowing. + +ARGUMENT:: srcBufNumB + The bufNum of the second source buffer. + +ARGUMENT:: startAtB + The starting point (in samples) from which to copy in the second source buffer. + +ARGUMENT:: nFramesB + The duration (in samples) to copy from the second source buffer. + +ARGUMENT:: startChanB + The first channel from which to copy in the second source buffer. + +ARGUMENT:: nChansB + The number of channels from which to copy in the second source buffer. This parameter will wrap around the number of channels in the source buffer. + +ARGUMENT:: srcGainB + The gain applied to the samples to be copied from the second source buffer. + +ARGUMENT:: dstStartAtB + The time offset (in samples) in the destination buffer to start writing the second source at. The destination buffer will be resized if the portion to copy is overflowing. + +ARGUMENT:: dstStartChanB + The channel offest in the destination buffer to start writing the second source at. The destination buffer will be resized if the number of channels to copy is overflowing. + +ARGUMENT:: dstBufNum + The bufNum of the destination buffer. + +returns:: + Nothing, as the various destination buffers are declared in the function call. + +EXAMPLES:: + +code:: +(some example code) +:: \ No newline at end of file diff --git a/release-packaging/HelpSource/Classes/FluidBufNMF.schelp b/release-packaging/HelpSource/Classes/FluidBufNMF.schelp index e0249fe..7922a9e 100644 --- a/release-packaging/HelpSource/Classes/FluidBufNMF.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufNMF.schelp @@ -1,7 +1,7 @@ TITLE:: FluidBufNMF summary:: Non-Negative Matrix Factorisation on Spectral Frames categories:: Libraries>FluidDecomposition -related:: Overviews/FluCoMa +related:: Guides/FluCoMa, Guides/FluidDecomposition DESCRIPTION:: This Class performs Non-Negative Matrix Factorisation (NMF for short) on buffers on the non-real-time thread. It is a good way to get different components out of a buffered signal. It is part of the Fluid Decomposition Toolkit of the FluCoMa project. footnote:: @@ -12,7 +12,7 @@ This was made possible thanks to the FluCoMa project (http://www.flucoma.org/) ## an amplitude envoloppe of each rank in the form of gains for each consecutive frames of the unterlying FFT (called an activation in NMF lingo) ## a reconstruction of each rank in audio domain. :: - The whole process can be related to a vocoder, where each filter is instead a spectrograme of magnitudes (no phase information). More information for musicianly uses of NMF are availabe on this website, and in the LINK::Overviews/FluCoMa:: overview file. + The whole process can be related to a vocoder, where each filter is instead a spectrograme of magnitudes (no phase information). More information for musicianly uses of NMF are availabe on this website, and in LINK::Guides/FluCoMa:: overview file. CLASSMETHODS:: diff --git a/release-packaging/HelpSource/Classes/FluidBufTransients.schelp b/release-packaging/HelpSource/Classes/FluidBufTransients.schelp index b65926f..739590d 100644 --- a/release-packaging/HelpSource/Classes/FluidBufTransients.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufTransients.schelp @@ -36,28 +36,28 @@ ARGUMENT:: resBufNum (describe argument here) ARGUMENT:: order -(describe argument here) + order of the IR filter used to model the signal in samples (how many samples previously are used to predict the next one as reference for the model) - higer = more accurate spectral def - like fft - low end res improv as well but not conencted to temporal res ARGUMENT:: blockSize -(describe argument here) + size of frame on which it is operating - hi is hi cpu but determines max trans size (not more than half) ARGUMENT:: padding -(describe argument here) + handles on each sides of the block just for analyse - just for model param, not processed ARGUMENT:: skew -(describe argument here) + -10 to 10 -> chapt 5 or 7 of the digital (kind of hysteresis on bespoke detection function) ARGUMENT:: threshFwd -(describe argument here) + threshold of the onset of error ARGUMENT:: threshBack -(describe argument here) + threshold of the offset of the error ARGUMENT:: windowSize -(describe argument here) + averaging window of the error detection function (because it is jittery) ARGUMENT:: debounce -(describe argument here) + clumps transients within that window size returns:: (describe returnvalue here) diff --git a/release-packaging/HelpSource/Classes/FluidSTFTPass.schelp b/release-packaging/HelpSource/Classes/FluidSTFTPass.schelp index 897bda6..c9014b4 100644 --- a/release-packaging/HelpSource/Classes/FluidSTFTPass.schelp +++ b/release-packaging/HelpSource/Classes/FluidSTFTPass.schelp @@ -1,4 +1,4 @@ -TITLE:: FluidBufSTFTPass +TITLE:: FluidSTFTPass summary:: Real-Time FFT/IFFT return trip. categories:: UGens>Algebraic related:: Classes/UnaryOpFunction @@ -32,17 +32,17 @@ EXAMPLES:: Summing with the inverse (gain of -1) with a delay of the latency gives us CPU-expensive silence. code:: - { var source = PinkNoise.ar(0.1); DelayN.ar(source, delaytime:1024/s.sampleRate, mul: -1) + FluidBufSTFTPass.ar(source, 1024, 256, 1024); }.play + { var source = PinkNoise.ar(0.1); DelayN.ar(source, delaytime:1024/s.sampleRate, mul: -1) + FluidSTFTPass.ar(source, 1024, 256, 1024); }.play :: Larger, oversampled, FFT code:: - { FluidBufSTFTPass.ar(PinkNoise.ar(0.1), 2048, 128, 8192) }.play + { FluidSTFTPass.ar(PinkNoise.ar(0.1), 2048, 128, 8192) }.play :: Stereo Input Tests. code:: - { FluidBufSTFTPass.ar([SinOsc.ar(222,mul: 0.1), PinkNoise.ar(Decay.ar(Impulse.ar(0.666,mul: 0.2), 0.5))], fftSize:1024)}.play + { FluidSTFTPass.ar([SinOsc.ar(222,mul: 0.1), PinkNoise.ar(Decay.ar(Impulse.ar(0.666,mul: 0.2), 0.5))], fftSize:1024)}.play :: Stereo Parameter Tests. code:: - { FluidBufSTFTPass.ar(SinOsc.ar(222,mul: 0.1), [1024,8192],256,8192)}.play + { FluidSTFTPass.ar(SinOsc.ar(222,mul: 0.1), [1024,8192],256,8192)}.play :: diff --git a/release-packaging/HelpSource/Guides/FluCoMa.schelp b/release-packaging/HelpSource/Guides/FluCoMa.schelp new file mode 100644 index 0000000..fe14906 --- /dev/null +++ b/release-packaging/HelpSource/Guides/FluCoMa.schelp @@ -0,0 +1,11 @@ +title:: The Fluid Corpus Manipulation Project +summary:: This section gives an overview of the Fluid Corpus Manipulation Project +categories:: Libraries>FluidDecomposition +related:: Classes/FluidBufNMF + +description:: +This is my description of the FluCoMa project. footnote:: +This was made possible thanks to the FluCoMa project (http://www.flucoma.org/) funded by the European Research Council (https://erc.europa.eu/) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 725899).:: + +subsection:: stuff +This is my subsection diff --git a/release-packaging/HelpSource/Guides/FluidDecomposition.schelp b/release-packaging/HelpSource/Guides/FluidDecomposition.schelp new file mode 100644 index 0000000..c0fb666 --- /dev/null +++ b/release-packaging/HelpSource/Guides/FluidDecomposition.schelp @@ -0,0 +1,11 @@ +title:: Fluid Decomposition Toolbox +summary:: This section gives an overview of the toolbox for signal decomposition +categories:: Libraries>FluidDecomposition +related:: Classes/FluidBufNMF + +description:: +This is my description. It is part of the Fluid Decomposition Toolkit of the FluCoMa project. footnote:: +This was made possible thanks to the FluCoMa project (http://www.flucoma.org/) funded by the European Research Council (https://erc.europa.eu/) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 725899).:: + +subsection:: stuff +This is my subsection diff --git a/src/FluidBufCompose/tests.scd b/src/FluidBufCompose/tests.scd index 4b5d627..4c907d6 100644 --- a/src/FluidBufCompose/tests.scd +++ b/src/FluidBufCompose/tests.scd @@ -3,21 +3,52 @@ s.reboot // test for efficiency ( -b = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/archives-2017-18/denoise_stn/sources/01-mix.wav"); -c = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/archives-2017-18/denoise_stn/sources/02-guit.wav"); +b = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/fluid_decomposition/AudioFiles/Tremblay-AaS-SynthTwoVoices-M.wav"); +c = Buffer.read(s,"/Users/pa/Documents/documents@hudd/research/projects/fluid corpus navigation/research/fluid_decomposition/AudioFiles/Tremblay-SA-UprightPianoPedalWide.wav"); d = Buffer.new(s); ) ( -// without basic params +// without basic params (basic summing of each full buffer in all dimensions) Routine{ t = Main.elapsedTime; - FDCompose.process(s, srcBufNumA: b.bufnum, srcBufNumB: c.bufnum, dstBufNum: d.bufnum); + FluidBufCompose.process(s, srcBufNumA: b.bufnum, srcBufNumB: c.bufnum, dstBufNum: d.bufnum); s.sync; (Main.elapsedTime - t).postln; -}.play -); +}.play; +) d.query; d.play; -d.plot \ No newline at end of file +d.plot + +//constructing a mono buffer, with a quiet punch from the synth, with a choked piano resonance from the left channel +( +Routine{ + t = Main.elapsedTime; + FluidBufCompose.process(s, srcBufNumA: b.bufnum, nFramesA: 9000, srcGainA: 0.5, srcBufNumB: c.bufnum, startAtB:30000, nFramesB:44100, nChansB:1, srcGainB:0.9, dstBufNum: d.bufnum); + s.sync; + (Main.elapsedTime - t).postln; +}.play; +) + +//constructing a stereo buffer, with the end of the mono synth in both channels, with a piano resonance in swapped stereo +( +Routine{ + t = Main.elapsedTime; + FluidBufCompose.process(s, srcBufNumA: b.bufnum, startAtA: 441000, nChansA: 2, srcGainA: 0.6, srcBufNumB: c.bufnum, nFramesB: 80000, startChanB: 1, nChansB: 2, srcGainB: 0.5, dstStartAtB: 22050, dstStartChanB: 0, dstBufNum: d.bufnum); + s.sync; + (Main.elapsedTime - t).postln; +}.play; +) + +//constructing a one second buffer: the first second of each buffer, the mono synth on the right, the piano on the left +process monosynth 0 44100 0 1 1 0 1 stereopiano 0 44100 0 1 1 dst +( +Routine{ + t = Main.elapsedTime; + FluidBufCompose.process(s, srcBufNumA: b.bufnum, nFramesA: 44100, nChansA: 1, dstStartChanA: 1, srcBufNumB: c.bufnum, nFramesB:44100, nChansB:1, dstBufNum: d.bufnum); + s.sync; + (Main.elapsedTime - t).postln; +}.play; +) \ No newline at end of file