diff --git a/example-code/sc/BufThreadDemo.scd b/example-code/sc/BufThreadDemo.scd index 036f92b..16522b7 100644 --- a/example-code/sc/BufThreadDemo.scd +++ b/example-code/sc/BufThreadDemo.scd @@ -22,6 +22,7 @@ c.cancel; ) :: strong::processBlocking:: + Using code::.processBlocking:: will add the process to the OCS server queue to ensure that the operations get done in order. code:: diff --git a/example-code/sc/DataSet.scd b/example-code/sc/DataSet.scd index 0b09b43..4dc6d95 100644 --- a/example-code/sc/DataSet.scd +++ b/example-code/sc/DataSet.scd @@ -185,7 +185,6 @@ code:: ~srcB = Buffer.read(s,FluidFilesPath("Harker-DS-TenOboeMultiphonics-M.wav")); ) -// use .fromBuffer to add *every* mfcc analysis to the dataset ( fork{ var mfccs = Buffer(s); @@ -219,7 +218,7 @@ fork{ // merge dataset B into dataset A // because there are no overlapping identifiers, -// nothign will be overwritten +// nothing will be overwritten ( ~dsA.merge(~dsB); ~dsA.print; diff --git a/example-code/sc/Grid.scd b/example-code/sc/Grid.scd index 5645079..6277564 100644 --- a/example-code/sc/Grid.scd +++ b/example-code/sc/Grid.scd @@ -195,6 +195,7 @@ FluidNormalize(s).fitTransform(~ds_gridded,~ds_gridded); ) :: strong::With Sound:: + Using link::Classes/FluidUMAP:: to dimensionally reduce 13 dimensions of link::Classes/FluidBufMFCC:: analyses down to two dimensions, play with each of the plots and see which is more musically expressive. Each has it's strenghts and weaknesses! code:: diff --git a/example-code/sc/KDTree.scd b/example-code/sc/KDTree.scd index ec25153..684222e 100644 --- a/example-code/sc/KDTree.scd +++ b/example-code/sc/KDTree.scd @@ -10,30 +10,29 @@ ds.dump({ var xybuf = Buffer.alloc(s,2); var slicePoints = Buffer.read(s,FluidFilesPath("../Data/flucoma_corpus_slices.wav")); var loader = FluidLoadFolder(FluidFilesPath()); - loader.play(s,{ - defer{ - FluidPlotter(dict:dict,mouseMoveAction:{ - arg view, x, y; - xybuf.setn(0,[x,y]); - tree.kNearest(xybuf,1,{ - arg id; - var index = id.asInteger; - defer{ - view.highlight_(id); - }; - - { - var start = Index.kr(slicePoints,index); - var end = Index.kr(slicePoints,index+1); - var sig = PlayBuf.ar(2,loader.buffer,BufRateScale.ir(loader.buffer),1,start)[0]; - var dur_sec = min((end-start) / SampleRate.ir,1); - var env = EnvGen.kr(Env([0,1,1,0],[0.03,dur_sec-0.06,0.03]),doneAction:2); - sig.dup * env; - }.play; - }); + loader.play(s); + defer{ + FluidPlotter(dict:dict,mouseMoveAction:{ + arg view, x, y; + xybuf.setn(0,[x,y]); + tree.kNearest(xybuf,1,action:{ + arg id; + var index = id.asInteger; + defer{ + view.highlight_(id); + }; + + { + var start = Index.kr(slicePoints,index); + var end = Index.kr(slicePoints,index+1); + var sig = PlayBuf.ar(2,loader.buffer,BufRateScale.ir(loader.buffer),1,start)[0]; + var dur_sec = min((end-start) / SampleRate.ir,1); + var env = EnvGen.kr(Env([0,1,1,0],[0.03,dur_sec-0.06,0.03]),doneAction:2); + sig.dup * env; + }.play; }); - }; - }); + }); + }; }); ) diff --git a/example-code/sc/KMeans.scd b/example-code/sc/KMeans.scd index 9d03c99..92204b7 100644 --- a/example-code/sc/KMeans.scd +++ b/example-code/sc/KMeans.scd @@ -152,6 +152,7 @@ fork{ ) :: strong::Distances:: + Accessing the distances to each point's mean code:: diff --git a/example-code/sc/SKMeans.scd b/example-code/sc/SKMeans.scd index 1cb1932..770d685 100644 --- a/example-code/sc/SKMeans.scd +++ b/example-code/sc/SKMeans.scd @@ -155,10 +155,11 @@ code:: // get the distance of our given point (b) to each cluster, thus giving us 4 dimensions in our cluster-distance space ( -~skmeans.encodePoint(~inbuf,~encoded); -~encoded.getn(0,4,action:{ - arg dists; - dists.postln; +~skmeans.encodePoint(~inbuf,~encoded,action:{ + ~encoded.getn(0,4,action:{ + arg dists; + dists.postln; + }); }); )