From 35874eafe883387785c77763c255d39951195ea6 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Wed, 22 Feb 2023 10:50:08 +0000 Subject: [PATCH 1/4] Tag release to correct commit --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6dab9c1..1607cfd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,5 +101,6 @@ jobs: files: FluCoMa* prerelease: true tag_name: ${{ needs.linuxbuild.outputs.version }} + target_commitish: ${{ github.sha }} draft: false From 8403b25256ca65f29ebe8b4ca956c924ecdd3cf0 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Wed, 22 Feb 2023 13:13:25 +0000 Subject: [PATCH 2/4] release: delete pre-existing --- .github/workflows/release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1607cfd..3bb3b0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,6 +93,14 @@ jobs: with: name: linuxbuild + - name: delete pre-existing release + uses: dev-drprasad/delete-tag-and-release@v0.2.0 + with: + delete_release: true # default: false + tag_name: ${{ needs.linuxbuild.outputs.version }} # tag name to delete + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: package and upload uses: softprops/action-gh-release@v1 with: From 1491a7cb1a23ea6819f5a15f7d29869c0e5d9491 Mon Sep 17 00:00:00 2001 From: tremblap Date: Tue, 28 Mar 2023 14:06:42 +0100 Subject: [PATCH 3/4] amended script tag management version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3bb3b0d..5e03eb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,7 +94,7 @@ jobs: name: linuxbuild - name: delete pre-existing release - uses: dev-drprasad/delete-tag-and-release@v0.2.0 + uses: dev-drprasad/delete-tag-and-release@v0.2.1 with: delete_release: true # default: false tag_name: ${{ needs.linuxbuild.outputs.version }} # tag name to delete From c58b5ca5ac1165d8bfe42cd62112295857708c74 Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Mon, 6 Jan 2025 09:40:35 +0100 Subject: [PATCH 4/4] fix prerelease tests and remove redundant ones --- test/10a-weighted-MFCCs-comparison.scd | 1 + test/12-windowed-clustered-segmentation.scd | 2 +- test/FluidPlotter_test.scd | 25 +++-- test/FluidWaveform_test.scd | 94 +++++++++--------- test/PCA_inverse_test.scd | 11 ++- test/TestFluidManipulationLifecyle.sc | 101 -------------------- test/foo | 0 test/overlay.scd | 72 -------------- 8 files changed, 65 insertions(+), 241 deletions(-) delete mode 100644 test/TestFluidManipulationLifecyle.sc delete mode 100644 test/foo delete mode 100644 test/overlay.scd diff --git a/test/10a-weighted-MFCCs-comparison.scd b/test/10a-weighted-MFCCs-comparison.scd index db3f0a6..f9e4b1e 100644 --- a/test/10a-weighted-MFCCs-comparison.scd +++ b/test/10a-weighted-MFCCs-comparison.scd @@ -117,6 +117,7 @@ t = Main.elapsedTime; }); }); ) + ~curator.transform(~ds,~curated) ~curator.transform(~dsW,~curatedW) diff --git a/test/12-windowed-clustered-segmentation.scd b/test/12-windowed-clustered-segmentation.scd index 95dad07..ef5d99b 100644 --- a/test/12-windowed-clustered-segmentation.scd +++ b/test/12-windowed-clustered-segmentation.scd @@ -166,7 +166,7 @@ t = Main.elapsedTime; //OPTIONAL: try again with more clusters (3) and a wider window (6) and more overlap (2) ~newindices = [~originalslicesarray[0]]; ~newkeys = [~orginalkeys[0]]; ~kmeans.numClusters = 3; -~windowedFunct.value(0,6,2); +~windowedFunct.value(0, 6, 2); //compare sizes ~orginalkeys.size diff --git a/test/FluidPlotter_test.scd b/test/FluidPlotter_test.scd index 1bb75f9..6d5d211 100644 --- a/test/FluidPlotter_test.scd +++ b/test/FluidPlotter_test.scd @@ -192,18 +192,17 @@ s.boot; // always be a Symbol) ~ds.dump({ arg dict; - // dict.at("data").postln; - ~fp = FluidPlotter(bounds:Rect(200,200,600,600),dict:dict,mouseMoveAction:{ - arg view, x, y, modifiers; - // [x,y].postln; - ~xybuf.setn(0,[x,y]); - ~kdtree.kNearest(~xybuf,{ - arg nearest; - nearest.postln; - view.highlight_(nearest); + defer{ + // dict.at("data").postln; + ~fp = FluidPlotter(bounds:Rect(200,200,600,600),dict:dict,mouseMoveAction:{ + arg view, x, y, modifiers; + [x,y].postln; + ~xybuf.setn(0,[x,y]); + ~kdtree.kNearest(~xybuf, 1, { + arg nearest; + nearest.postln; + view.highlight_(nearest); + }); }); - // [view, x, y, modifiers].postln; - // "".postln; - }); -}); +}}); ) \ No newline at end of file diff --git a/test/FluidWaveform_test.scd b/test/FluidWaveform_test.scd index 3b719e6..47616e4 100644 --- a/test/FluidWaveform_test.scd +++ b/test/FluidWaveform_test.scd @@ -1,34 +1,30 @@ ( // og test s.waitForBoot{ + var buf = Buffer.read(s,FluidFilesPath("Nicol-LoopE-M.wav")); + var slicepoints = Buffer(s); - Task{ - var buf = Buffer.read(s,"/Users/macprocomputer/Desktop/_flucoma/code/flucoma-core-src/AudioFiles/Nicol-LoopE-M.wav"); - var slicepoints = Buffer(s); - - FluidBufAmpSlice.process(s,buf,indices:slicepoints,fastRampUp:10,fastRampDown:2205,slowRampUp:4410,slowRampDown:4410,onThreshold:10,offThreshold:5,floor:-40,minSliceLength:4410,highPassFreq:20,action:{ - FluidWaveform(buf,slicepoints,bounds:Rect(0,0,1600,400)).front; - }); - - }.play(AppClock); + FluidBufAmpSlice.process(s,buf,indices:slicepoints,fastRampUp:10,fastRampDown:2205,slowRampUp:4410,slowRampDown:4410,onThreshold:10,offThreshold:5,floor:-40,minSliceLength:4410,highPassFreq:20,action:{ + defer{FluidWaveform(buf,slicepoints,bounds:Rect(0,0,1600,400)).front}; + }); } ) -( + ( // embed it in a different window s.waitForBoot{ - var buf = Buffer.read(s,"/Users/macprocomputer/Desktop/_flucoma/code/flucoma-core-src/AudioFiles/Nicol-LoopE-M.wav"); + var buf = Buffer.read(s,FluidFilesPath("Nicol-LoopE-M.wav")); var slicepoints = Buffer(s); FluidBufAmpSlice.process(s,buf,indices:slicepoints,fastRampUp:10,fastRampDown:2205,slowRampUp:4410,slowRampDown:4410,onThreshold:10,offThreshold:5,floor:-40,minSliceLength:4410,highPassFreq:20,action:{ - fork({ + defer{ ~win = Window("test",Rect(0,0,1600,400)); - FluidWaveform(buf,slicepoints,bounds:Rect(100,100,1400,200),parent:~win).front; - },AppClock); + FluidWaveform(buf,slicepoints,bounds:Rect(100,100,1400,200),parent:~win); + ~win.front; + }; }); - } ) @@ -78,6 +74,8 @@ s.waitForBoot{ ~pitch_analysis = Buffer(s); FluidBufPitch.processBlocking(s,~audio,features:~pitch_analysis); + s.sync; + ~fw = FluidWaveform(bounds:Rect(100,100,1200,300)); ~fw.addImageLayer(~mels,1,1); @@ -111,7 +109,7 @@ s.waitForBoot{ s.sync; - ~fw = FluidWaveform(~audio,~indices,~pitch_analysis,imageBuffer:~mels,bounds:Rect(100,100,1200,300),imageColorScaling:1,imageColorScheme:1).front; + ~fw = FluidWaveform(~audio,~indices,~pitch_analysis,imageBuffer:~mels,bounds:Rect(100,100,1200,300),imageColorScaling:1,imageColorScheme:1); } ) @@ -132,11 +130,11 @@ s.waitForBoot{ s.sync; - ~fw = FluidWaveform(~audio,~indices,~pitch_analysis,bounds:Rect(100,100,1200,300),imageColorScaling:1,imageColorScheme:1).front; + ~fw = FluidWaveform(~audio,~indices,~pitch_analysis,bounds:Rect(100,100,1200,300),imageColorScaling:1,imageColorScheme:1); } ) - +// adding layers one at a time kinda test ( s.waitForBoot{ // do some analysis @@ -163,25 +161,26 @@ s.waitForBoot{ ) ( -// plot most of it, but then... -~fw = FluidWaveform(bounds:Rect(100,100,1200,300)); +// plot some of it, but then... +~fw = FluidWaveform(bounds:Rect(100,450,1200,300)); ~fw.addImageLayer(~mels,2,imageColorScaling:1); -~fw.addAudioLayer(~audio,Color(1,1,1,0.5)); -~fw.addIndicesLayer(~indices,~audio,Color.black); ~fw.front; ) -// add one more -~fw.addFeaturesLayer(~pitch_analysis,[Color.cyan,Color.yellow]).front; +// add one feature at a time +~fw.addAudioLayer(~audio,Color(1,1,1,0.5)).refresh; + +~fw.addIndicesLayer(~indices,~audio,Color.black).refresh; + +~fw.addFeaturesLayer(~pitch_analysis,[Color.cyan,Color.yellow]).refresh; // check how many layers ~fw.layers ( // plot differen components with different colors -s.waitForBoot{ +Routine{ ~audio = Buffer.read(s,FluidFilesPath("Nicol-LoopE-M.wav")); - // ~audio = Buffer.read(s,FluidFilesPath("Tremblay-ASWINE-ScratchySynth-M.wav")); ~resynth = Buffer(s); ~n_components = 3; ~resynths = {Buffer(s)} ! ~n_components; @@ -196,7 +195,9 @@ s.waitForBoot{ ~hopSize = 256; s.sync; - FluidBufNMF.processBlocking(s,~audio,resynth:~resynth,activations:~activations,components:~n_components); + + FluidBufNMF.processBlocking(s,~audio,resynth:~resynth,activations:~activations,components:~n_components,resynthMode: 1); + 2.do{ arg i; FluidBufHPSS.processBlocking(s,~audio,harmonic:~harm[i],percussive:~perc[i],maskingMode:i,harmFilterSize:51,percFilterSize:91); @@ -220,35 +221,30 @@ s.waitForBoot{ ~colors = FluidViewer.createCatColors.collect{ arg color; - // color.alpha_(0.4); color; }; s.sync; - // ~resynths.postln; - ~melsfw = FluidWaveform(bounds:Rect(0,0,1600,400)); + defer{ + ~melsfw = FluidWaveform(bounds:Rect(0,0,1600,400)); - // ~n_components.do{ - // arg i; - // ~fw.addAudioLayer(~resynths[i],~colors[i]); - // }; + ~n_components.do{ + arg i; + ~melsfw.addImageLayer(~mels[i],~colors[i],1,1); + }; - ~n_components.do{ - arg i; - ~melsfw.addImageLayer(~mels[i],~colors[i],1,1); - }; + ~melsfw.front; - ~melsfw.front; + ~binaryfw = FluidWaveform(bounds:Rect(0,400,1600,400)); + ~binaryfw.addImageLayer(~percmels[1],~colors[0],1); + ~binaryfw.addImageLayer(~harmmels[1],~colors[1],1); + ~binaryfw.front; - ~binaryfw = FluidWaveform(bounds:Rect(0,400,1600,400)); - ~binaryfw.addImageLayer(~percmels[1],~colors[0],1); - ~binaryfw.addImageLayer(~harmmels[1],~colors[1],1); - ~binaryfw.front; - - ~softfw = FluidWaveform(bounds:Rect(0,0,1600,400)); - ~softfw.addImageLayer(~percmels[0],~colors[0],1); - ~softfw.addImageLayer(~harmmels[0],~colors[1],1); - ~softfw.front; -} + ~softfw = FluidWaveform(bounds:Rect(0,800,1600,400)); + ~softfw.addImageLayer(~percmels[0],~colors[0],1); + ~softfw.addImageLayer(~harmmels[0],~colors[1],1); + ~softfw.front; + }; +}.play; ) diff --git a/test/PCA_inverse_test.scd b/test/PCA_inverse_test.scd index a798015..5fd7f1f 100644 --- a/test/PCA_inverse_test.scd +++ b/test/PCA_inverse_test.scd @@ -7,15 +7,15 @@ fork{ [(i/2).asInteger,Array.fill(5,{rrand(-1.0,1.0)})] }).flatten) ]); - // ~dict.at("data").at(0).postln; ~ds = FluidDataSet(s).load(~dict); ~pca = FluidPCA(s,5); ~pca.fit(~ds); b = Buffer.alloc(s,5); + e = 5.collect{rrand(-1.0,1.0)}.postln; s.sync; - b.setn(0,Array.fill(5,{rrand(-1.0,1.0)}).postln); - // ~ds.getPoint(0,b); + b.setn(0,e); c = Buffer.alloc(s,5); + d = Buffer(); } ) @@ -30,11 +30,12 @@ c.loadToFloatArray(action:{ }); ) -~pca.inverseTransformPoint(c,b); +~pca.inverseTransformPoint(c,d); ( -b.loadToFloatArray(action:{ +d.loadToFloatArray(action:{ arg fa; fa.postln; + (fa - e).postln; }); ) \ No newline at end of file diff --git a/test/TestFluidManipulationLifecyle.sc b/test/TestFluidManipulationLifecyle.sc deleted file mode 100644 index 796673a..0000000 --- a/test/TestFluidManipulationLifecyle.sc +++ /dev/null @@ -1,101 +0,0 @@ - -TestFluidCorpusManipulationServer : UnitTest -{ - var waitForCounts, countsListener; - - setUp{ - waitForCounts = Condition.new(false); - countsListener = { |s,changed| - if(changed == \counts) { - waitForCounts.test = true; - waitForCounts.signal; - } - }; - Server.default.addDependant(countsListener); - } - - tearDown{ - Server.default.removeDependant(countsListener); - Server.default.quit; - } - - test_DataSetPersistence{ - var foo, bar, tree, testPoint; - //No server on? You get nothing - this.assertEquals(nil,FluidDataSet(Server.default,\foo)); - - this.bootServer(Server.default); - // while {Server.default.serverRunning.not}{0.2.wait}; - - waitForCounts.test = false; - Server.default.doWhenBooted{foo=FluidDataSet(Server.default,\foo)}; - waitForCounts.wait; - this.assertEquals(Server.default.numSynths,1,"Dataset: One Synth present after deferred boot"); - waitForCounts.test = false; - foo.free; - waitForCounts.wait; - this.assertEquals(Server.default.numSynths,0,"Dataset: No synth present via cretation after free"); - foo=FluidDataSet(Server.default,\foo); - //Uniqueness test (difficult to run with previous instance of foo, because - //UnitTest.bootServer messes with Server alloctors and screws up the ID cache - this.assertException({ - bar = FluidDataSet(Server.default,\foo); - },FluidDataSetExistsError,"DataSetDuplicateError on reused name", onFailure:{ - "Exception fail".postln; - }); - - waitForCounts.test = false; - bar = FluidDataSet(Server.default,\bar); - waitForCounts.wait; - this.assertEquals(Server.default.numSynths,2,"Dataset: Two Synths present after new valid Dataset added"); - - testPoint = Buffer.alloc(Server.default,8); - Server.default.sync; - testPoint.setn(0,[1,2,3,4,5,6,7,8]); - Server.default.sync; - foo.addPoint(\one,testPoint); - Server.default.sync; - foo.size({|size| - this.assertEquals(size,1,"Dataset size is 1"); - }); - Server.default.sync; - foo.cols({|cols| - this.assertEquals(cols,8,"Dataset cols is 8"); - }); - - Server.default.sync; - waitForCounts.test = false; - - tree = FluidKDTree(Server.default); - waitForCounts.wait; - - this.assert(tree.synth.notNil,"Tree should have a valid synth"); - this.assertEquals(Server.default.numSynths,3,"Dataset: Three Synths remain after cmd-."); - - tree.fit(foo); - Server.default.sync; - tree.cols({|cols| - this.assertEquals(cols,8,"KDTree correct dims after fit") - }); - Server.default.sync; - - //Test cmd-period resistance - waitForCounts.test = false; - Server.default.freeAll; - Server.default.sync; - Server.default.sync; - waitForCounts.wait; - - this.assertEquals(Server.default.numSynths,3,"Dataset: Three Synths remain after cmd-."); - foo.size({|size| - this.assertEquals(size,1,"Dataset size is still 1 after Cmd-."); - }); - Server.default.sync; - foo.cols({|cols| - this.assertEquals(cols,8,"Dataset cols is still 8 after Cmd-."); - }); - Server.default.sync; - tree.cols({|cols| this.assertEquals(cols,8,"KDTree correct dims after Cmd-.")}); - Server.default.sync; - } -} \ No newline at end of file diff --git a/test/foo b/test/foo deleted file mode 100644 index e69de29..0000000 diff --git a/test/overlay.scd b/test/overlay.scd deleted file mode 100644 index 07cf104..0000000 --- a/test/overlay.scd +++ /dev/null @@ -1,72 +0,0 @@ -( -s.waitForBoot{ - //var audio = Buffer.readChannel(s,FluidFilesPath("Tremblay-CEL-GlitchyMusicBoxMelo.wav"),channels:[0]); - // var audio = Buffer.readChannel(s,FluidFilesPath("Nicol-LoopE-M.wav"),channels:[0]); - var audio = Buffer.readChannel(s,FluidFilesPath("Harker-DS-TenOboeMultiphonics-M.wav"),channels:[0]); - - var window = Window(bounds:Rect(0,0,1600,400)); - var mels = Buffer(s); - var mags = Buffer(s); - var chroma = Buffer(s); - var mfccs = Buffer(s); - var addLayer = { - arg win, imageBuffer, color, imageAlpha, colorScaling; - imageBuffer.loadToFloatArray(action:{ - arg vals; - fork({ - var colors = CSVFileReader.readInterpret(FluidFilesPath("../color-schemes/%.csv".format(color))).collect{ - arg row; - Color.fromArray(row); - }; - var img = Image(imageBuffer.numFrames,imageBuffer.numChannels); - - colorScaling.switch( - 0,{ - var minItem = vals.minItem; - vals = (vals - minItem) / (vals.maxItem - minItem); - vals = (vals * 255).asInteger; - }, - 1,{ - vals = (vals + 1e-6).log; - vals = vals.linlin(vals.minItem,vals.maxItem,0.0,255.0).asInteger; - // vals.postln; - }, - { - "% colorScaling argument % is invalid.".format(thisMethod,colorScaling).warn; - } - ); - - vals.do{ - arg val, index; -/* img.postln; - index.postln; - val.postln;*/ - img.setColor(colors[val], index.div(imageBuffer.numChannels), imageBuffer.numChannels - 1 - index.mod(imageBuffer.numChannels)); - }; - - UserView(win,Rect(0,0,win.bounds.width,win.bounds.height)) - .drawFunc_{ - img.drawInRect(Rect(0,0,win.bounds.width,win.bounds.height),fraction:imageAlpha); - }; - },AppClock) - }); - }; - - FluidBufMelBands.processBlocking(s,audio,features:mels); - FluidBufSTFT.processBlocking(s,audio,magnitude:mags); - FluidBufChroma.processBlocking(s,audio,features:chroma); - FluidBufMFCC.processBlocking(s,audio,features:mfccs); - - s.sync; - - "analysis done".postln; - - // addLayer.(window,imageBuffer:mags,color:"CET-L02",imageAlpha:0.7,colorScaling:1); - addLayer.(window,imageBuffer:mels,color:"CET-L02",imageAlpha:1,colorScaling:1); - - // addLayer.(window,imageBuffer:chroma,color:"CET-L16",imageAlpha:0.5,colorScaling:1); - addLayer.(window,imageBuffer:mfccs,color:"CET-L16",imageAlpha:0.3,colorScaling:0); - - window.front; -}; -) \ No newline at end of file