From baf5f329483b08dc4fea595ff66e98de4d3d1d2d Mon Sep 17 00:00:00 2001 From: Owen Green Date: Mon, 5 Aug 2019 15:53:37 +0100 Subject: [PATCH 1/2] release-packaging/HelpSource/Classes/FluidBufOnsetSlice.schelp: Function not metric, in this particular instance --- release-packaging/HelpSource/Classes/FluidBufOnsetSlice.schelp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-packaging/HelpSource/Classes/FluidBufOnsetSlice.schelp b/release-packaging/HelpSource/Classes/FluidBufOnsetSlice.schelp index 84a25b0..4893b02 100644 --- a/release-packaging/HelpSource/Classes/FluidBufOnsetSlice.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufOnsetSlice.schelp @@ -71,7 +71,7 @@ ARGUMENT:: fftSize The inner FFT/IFFT size. It should be at least 4 samples long, at least the size of the window, and a power of 2. Making it larger allows an oversampling of the spectral precision. The -1 default value will default to windowSize. ARGUMENT:: action - A Function to be evaluated once the offline process has finished and indices instance variables have been updated on the client side. The metric will be passed indices as an argument. + A Function to be evaluated once the offline process has finished and indices instance variables have been updated on the client side. The function will be passed indices as an argument. RETURNS:: Nothing, as the destination buffer is declared in the function call. From 2aa3d545d470fd76bc5675e2c31e6473c72f706b Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Mon, 26 Aug 2019 14:52:20 +0100 Subject: [PATCH 2/2] fluidmfcc: added the menu to choose which buffer to play, and a restart button --- .../HelpSource/Classes/FluidMFCC.schelp | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/release-packaging/HelpSource/Classes/FluidMFCC.schelp b/release-packaging/HelpSource/Classes/FluidMFCC.schelp index 8261515..d685eb2 100644 --- a/release-packaging/HelpSource/Classes/FluidMFCC.schelp +++ b/release-packaging/HelpSource/Classes/FluidMFCC.schelp @@ -131,7 +131,7 @@ STRONG::A musical example:: CODE:: //program that freezes mfcc spectra, then looks for matches between two frozen spectra ( -SynthDef("MFCCJamz", {arg freq=220, source = 0, buffer, mfccBus, distBus, t_freeze0=0, t_freeze1=0, onsetsOn0=0, onsetsOn1=0; +SynthDef("MFCCJamz", {arg freq=220, source = 0, buffer, mfccBus, distBus, t_freeze0=0, t_freeze1=0, onsetsOn0=0, onsetsOn1=0, restart = 1; var sound, mfcc, mfccFreeze0, mfccFreeze1, dist0, dist1, closest, slice; sound = SelectX.ar(source, [ @@ -141,7 +141,7 @@ SynthDef("MFCCJamz", {arg freq=220, source = 0, buffer, mfccBus, distBus, t_free Pulse.ar(freq, 0.5, 0.1), WhiteNoise.ar(0.1), PinkNoise.ar(0.1), - PlayBuf.ar(1, buffer, 1, loop:1) + PlayBuf.ar(1, buffer, 1, loop:1, trigger:restart) ]); slice = FluidOnsetSlice.ar(sound); //onset detection for mfcc freeze on onset @@ -168,7 +168,7 @@ SynthDef("MFCCJamz", {arg freq=220, source = 0, buffer, mfccBus, distBus, t_free ( -var buffers, buffer, paths, mfccBus, freezeBus, distBus, win, sliders, updateRout, winRange, currentMFCC, synth, movingGUI, trainButtons, oscFunc, closestBus; +var buffers, buffer, paths, mfccBus, freezeBus, distBus, win, sliders, updateRout, winRange, currentMFCC, synth, movingGUI, trainButtons, playbackButton, oscFunc, closestBus; winRange = 100; @@ -214,7 +214,7 @@ s.waitForBoot({ .maxWidth_(150), PopUpMenu().items_(paths) .action_{|menu| synth.set(\buffer, buffers[menu.value])} - .maxWidth_(150); + .maxWidth_(150) ]; //the buttons under the two frozen mfcc displays @@ -237,10 +237,18 @@ s.waitForBoot({ trainButtons.add(StaticText()); }; + playbackButton = Button().states_([["restart", Color.black, Color.green]]) + .mouseDownAction_({arg butt; + synth.set(\restart, 0.5); + }) + .action_{arg butt; + synth.set(\restart, -0.5); + }; + win.layout_(HLayout( VLayout(sliders[0], movingGUI[0], movingGUI[1], movingGUI[2]), - VLayout(sliders[1],HLayout(trainButtons[0],trainButtons[1]), HLayout(trainButtons[2],trainButtons[3])), - VLayout(sliders[2],HLayout(trainButtons[4],trainButtons[5]), HLayout(trainButtons[6],trainButtons[7])) + VLayout(sliders[1],HLayout(trainButtons[0],trainButtons[1]), HLayout(trainButtons[2],trainButtons[3]), movingGUI[3]), + VLayout(sliders[2],HLayout(trainButtons[4],trainButtons[5]), HLayout(trainButtons[6],trainButtons[7]), playbackButton) )); win.front; win.onClose_{synth.free; oscFunc.free; updateRout.stop};