diff --git a/release-packaging/Classes/FluidAudioTransport.sc b/release-packaging/Classes/FluidAudioTransport.sc index e55384f..cc41b92 100644 --- a/release-packaging/Classes/FluidAudioTransport.sc +++ b/release-packaging/Classes/FluidAudioTransport.sc @@ -1,7 +1,7 @@ FluidAudioTransport : UGen { init { |...theInputs| - theInputs.postln; + theInputs; inputs = theInputs; this.specialIndex = 1; //two audio inputs // ^this.initOutputs(1,rate); diff --git a/release-packaging/HelpSource/Classes/FluidBufAmpGate.schelp b/release-packaging/HelpSource/Classes/FluidBufAmpGate.schelp index f9acdc3..b2add49 100644 --- a/release-packaging/HelpSource/Classes/FluidBufAmpGate.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufAmpGate.schelp @@ -182,7 +182,6 @@ b.play // create a new buffer as destinations c = Buffer.new(s); -OSCFunc.trace(false) //run the process on them ( // with basic params diff --git a/release-packaging/HelpSource/Classes/FluidBufAmpSlice.schelp b/release-packaging/HelpSource/Classes/FluidBufAmpSlice.schelp index b01fccd..68226c3 100644 --- a/release-packaging/HelpSource/Classes/FluidBufAmpSlice.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufAmpSlice.schelp @@ -145,16 +145,16 @@ b.play c = Buffer.new(s); //run the process on them - ( - // with basic params - Routine{ - var t = Main.elapsedTime; - var proc = FluidBufAmpSlice.process(s,b, indices: c, fastRampUp: 10,fastRampDown: 2205,slowRampUp: 4410,slowRampDown: 4410, onThreshold: 10,offThreshold: 5); - proc.wait; - c.query; - (Main.elapsedTime - t).postln; - }.play - ) +( + // with basic params + Routine{ + var t = Main.elapsedTime; + var proc = FluidBufAmpSlice.process(s,b, indices: c, fastRampUp: 10,fastRampDown: 2205,slowRampUp: 4410,slowRampDown: 4410, onThreshold: 10,offThreshold: 5); + proc.wait; + c.query; + (Main.elapsedTime - t).postln; + }.play +) // list the indicies of detected attacks - the two input channels have been summed. c.getn(0,c.numFrames,{|item|(item * 2).postln;}) diff --git a/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp b/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp index 2955970..a202579 100644 --- a/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufAudioTransport.schelp @@ -92,7 +92,6 @@ FluidBufAudioTransport.process(s,b,source2:c,destination:d,interpolation:0.5,act // listen to the source and the result b.play c.play -d.updateInfo d.play // more interesting sources: two cardboard bowing gestures diff --git a/release-packaging/HelpSource/Classes/FluidBufCompose.schelp b/release-packaging/HelpSource/Classes/FluidBufCompose.schelp index 626b58f..e28bb58 100644 --- a/release-packaging/HelpSource/Classes/FluidBufCompose.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufCompose.schelp @@ -72,8 +72,9 @@ d = Buffer.new(s); // with basic params (basic summing of each full buffer in all dimensions) ( Routine{ - FluidBufCompose.process(s, source: b, destination: d).wait; - FluidBufCompose.process(s, source: c, destination: d, destGain: 1.0).wait; + FluidBufCompose.process(s, source: b, destination: d); + FluidBufCompose.process(s, source: c, destination: d, destGain: 1.0); + s.sync; d.query; d.play; }.play; diff --git a/release-packaging/HelpSource/Classes/FluidBufFlatten.schelp b/release-packaging/HelpSource/Classes/FluidBufFlatten.schelp index 8d404a5..cd857eb 100644 --- a/release-packaging/HelpSource/Classes/FluidBufFlatten.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufFlatten.schelp @@ -83,7 +83,7 @@ b = Buffer.read(s,~randomsoundfile.path,action:{"Sound Loaded".postln}); ~flatdata = Buffer.new; ) -//Pitch analysis, writes pitches as frequecnies to chan 0, confidences [0-1] to chan 1 +//Pitch analysis, writes pitches as frequencies to chan 0, confidences [0-1] to chan 1 FluidBufPitch.process(s,b,numFrames:512 * 10,numChans:1,features:~pitchdata,action:{"Pitch Analysis Done".postln}); // Flatten and print the flat buffer. We expect to see larger numbers (20-2000) interleaved with smaller (0-1) @@ -94,4 +94,13 @@ FluidBufFlatten.process(s,~pitchdata,~flatdata,axis:1,action:{ }) }) ) + +//changing the axis, we see all large numbers first +( +FluidBufFlatten.process(s,~pitchdata,~flatdata,axis:0,action:{ + ~flatdata.loadToFloatArray(action:{ |a| + a.postln; + }) +}) +) :: diff --git a/release-packaging/HelpSource/Classes/FluidBufHPSS.schelp b/release-packaging/HelpSource/Classes/FluidBufHPSS.schelp index 11fe72f..c2b361c 100644 --- a/release-packaging/HelpSource/Classes/FluidBufHPSS.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufHPSS.schelp @@ -125,7 +125,7 @@ code:: d = Buffer.new(s); e = Buffer.new(s); ) -OSCFunc.trace(true, true) + // run with basic parameters ( Routine{ diff --git a/release-packaging/HelpSource/Classes/FluidBufNMF.schelp b/release-packaging/HelpSource/Classes/FluidBufNMF.schelp index 9f43e75..8d27b7d 100644 --- a/release-packaging/HelpSource/Classes/FluidBufNMF.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufNMF.schelp @@ -175,7 +175,7 @@ y = Buffer.new(s); ~fft_size = 1024; ~frame_size = 512; ~hop_size = 256; -~which_component = 3; +~which_component = 1; ) // matrix factorisation, requesting everything - wait for the computation time to appear. diff --git a/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp b/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp index 998b946..d5be65f 100644 --- a/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufNMFCross.schelp @@ -72,5 +72,6 @@ b = Buffer.read(s,~path+/+"Nicol-LoopE-M.wav") t = Buffer.read(s,~path+/+"Tremblay-SA-UprightPianoPedalWide.wav") o = Buffer.new FluidBufNMFCross.process(s,t,b,o,action:{"Ding".postln}) +//wait for it to be done. It is a long process. o.play :: diff --git a/release-packaging/HelpSource/Classes/FluidBufScale.schelp b/release-packaging/HelpSource/Classes/FluidBufScale.schelp index a57c4a3..7107e5c 100644 --- a/release-packaging/HelpSource/Classes/FluidBufScale.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufScale.schelp @@ -70,7 +70,7 @@ Routine{ // play with the scaling FluidBufScale.process(s, b, destination: c, inputLow: 0, inputHigh: 1, outputLow: 20, outputHigh:10).wait; // retrieve the buffer and enjoy the results. - c.getn(0,10,{|x|x.postln;}) + c.getn(0,10,{|x|x.round(0.000001).postln;}) }.play ) diff --git a/release-packaging/HelpSource/Classes/FluidBufStats.schelp b/release-packaging/HelpSource/Classes/FluidBufStats.schelp index 74ac2e6..0a6a0e3 100644 --- a/release-packaging/HelpSource/Classes/FluidBufStats.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufStats.schelp @@ -186,7 +186,6 @@ c = Buffer.new(s); // run the stats and send back the values FluidBufStats.process(s, b, stats:c, numDerivs:1, action:{c.getn(0,c.numFrames * c.numChannels,{|item|d = item; d.postln})}); -OSCFunc.allEnabled //looking at the result is not easy to grasp, since it is interleaved: first number is mean of L, second is mean of R, third is stddev of L, fourth is stddev or R //this will make it tidier - the first value of each line is Left, the second is Right diff --git a/release-packaging/HelpSource/Classes/FluidBufThresh.schelp b/release-packaging/HelpSource/Classes/FluidBufThresh.schelp index 172f641..f905faa 100644 --- a/release-packaging/HelpSource/Classes/FluidBufThresh.schelp +++ b/release-packaging/HelpSource/Classes/FluidBufThresh.schelp @@ -59,7 +59,7 @@ c = Buffer(s) // play with the threshold FluidBufThresh.process(s, b, destination: c, threshold: 0.5) // retrieve the buffer and enjoy the results. -c.getn(0,11,{|x|x.postln;}) +c.getn(0,11,{|x|x.round(0.000001).postln;}) // also works in multichannel - explore the following buffer b = Buffer.sendCollection(s,0.0.series(0.1,2.0).scramble,2) @@ -77,5 +77,5 @@ FluidBufThresh.process(s, b,startFrame: 3,numFrames: 4,startChan: 1,numChans: 1, //enjoy c.plot(separately: true).plotMode_(\points) c.query -c.getn(0,4,{|x|x.postln;}) +c.getn(0,4,{|x|x.round(0.000001).postln;}) :: diff --git a/release-packaging/HelpSource/Classes/FluidDataSet.schelp b/release-packaging/HelpSource/Classes/FluidDataSet.schelp index 4e6818e..7895827 100644 --- a/release-packaging/HelpSource/Classes/FluidDataSet.schelp +++ b/release-packaging/HelpSource/Classes/FluidDataSet.schelp @@ -123,7 +123,6 @@ fork{ :: STRONG:: Merging Datasets:: -s.dumpOSC code:: //this is how to add items between 2 datasets. //create 2 datasets @@ -131,7 +130,7 @@ code:: ~dsA = FluidDataSet.new(s); ~dsB = FluidDataSet.new(s); ) -Dictionary.new + //feed them items with same dimensions but different labels ~dsA.load(Dictionary.newFrom([\cols, 1, \data, Dictionary.newFrom([\one,1,\two,2])])); ~dsB.load(Dictionary.newFrom([\cols, 1, \data, Dictionary.newFrom([\three,3,\four,4])])); diff --git a/release-packaging/HelpSource/Classes/FluidDataSetQuery.schelp b/release-packaging/HelpSource/Classes/FluidDataSetQuery.schelp index 9b1d57d..9132ac1 100644 --- a/release-packaging/HelpSource/Classes/FluidDataSetQuery.schelp +++ b/release-packaging/HelpSource/Classes/FluidDataSetQuery.schelp @@ -120,9 +120,8 @@ fork{ s.sync; ~points.do{|x,i| ~tmpbuf.setn(0,x); - s.sync; ~dataSet.addPoint(i,~tmpbuf); - // s.sync + s.sync; } } ) @@ -137,7 +136,6 @@ fork{ // prepare a simple query ~query.filter(0,"<",0.04); ~query.addColumn(2); -s.dumpOSC ~query.transform(~dataSet, ~out); // check the result diff --git a/release-packaging/HelpSource/Classes/FluidKDTree.schelp b/release-packaging/HelpSource/Classes/FluidKDTree.schelp index cb25c2f..4ea497a 100644 --- a/release-packaging/HelpSource/Classes/FluidKDTree.schelp +++ b/release-packaging/HelpSource/Classes/FluidKDTree.schelp @@ -98,7 +98,7 @@ fork{ // Limit the search to an acceptable distance in a radius // Define a point, and observe typical distance values -~p = [ 0.2,0.2]; +~p = [ 0.4,0.4]; ( ~tmpbuf = Buffer.loadCollection(s, ~p, 1, { ~tree.kNearestDist(~tmpbuf,{ |a|a.postln;~nearest = a;}); @@ -129,7 +129,7 @@ For instance, whilst fitting the tree against some n-dimensional descriptor data code:: - ,( +( Routine{ var inputBuffer = Buffer.alloc(s,2); var outputBuffer = Buffer.alloc(s,10);//5 neighbours * 2D data points diff --git a/release-packaging/HelpSource/Classes/FluidKMeans.schelp b/release-packaging/HelpSource/Classes/FluidKMeans.schelp index 547a21d..4de6839 100644 --- a/release-packaging/HelpSource/Classes/FluidKMeans.schelp +++ b/release-packaging/HelpSource/Classes/FluidKMeans.schelp @@ -67,7 +67,6 @@ A function to run when complete, taking an array of the counts for each category EXAMPLES:: -Server.default.options.outDevice = "Built-in Output" code:: ( @@ -106,10 +105,6 @@ fork{ ~kmeans.size; ~kmeans.dump; - ~clusters.getLabel(0,{|clusterID| - (0.asString+clusterID).postln; -}); - // Retrieve labels of clustered points ( ~assignments = Array.new(128); @@ -157,8 +152,6 @@ subsection:: Queries in a Synth This is the equivalent of predictPoint, but wholly on the server code:: - -outputPoint.getToFloatArray(action:{|a|a.postln}) ( { var trig = Impulse.kr(5); diff --git a/release-packaging/HelpSource/Classes/FluidKNNClassifier.schelp b/release-packaging/HelpSource/Classes/FluidKNNClassifier.schelp index 9f882a1..9166851 100644 --- a/release-packaging/HelpSource/Classes/FluidKNNClassifier.schelp +++ b/release-packaging/HelpSource/Classes/FluidKNNClassifier.schelp @@ -62,7 +62,7 @@ code:: ~test = FluidDataSet(s); ~mapping = FluidLabelSet(s); ) -s.dumpOSC + //Make some clumped 2D points and place into a DataSet ( ~examplepoints = [[0.5,0.5],[-0.5,0.5],[0.5,-0.5],[-0.5,-0.5]]; @@ -93,7 +93,7 @@ d = Dictionary.with( ~classifier.predict(~test, ~mapping, 1); ) -//Return labels of clustered points +//Return labels of clustered points - wait for the dump to be done ( ~assignments = Array.new(~testpoints.size); fork{ @@ -175,7 +175,7 @@ code:: var outputPoint = LocalBuf(1); point.collect{|p,i| BufWr.kr([p],inputPoint,i)}; ~classifier.kr(trig,inputPoint,outputPoint); - SinOsc.ar((BufRd.kr(1,outputPoint,0,interpolation:0) + 69).midicps,mul: 0.1); + SinOsc.ar((BufRd.kr(1,outputPoint,0,interpolation:0) + 69).midicps, mul: 0.1); }.play ) :: diff --git a/release-packaging/HelpSource/Classes/FluidMFCC.schelp b/release-packaging/HelpSource/Classes/FluidMFCC.schelp index b799bbb..dac7a3f 100644 --- a/release-packaging/HelpSource/Classes/FluidMFCC.schelp +++ b/release-packaging/HelpSource/Classes/FluidMFCC.schelp @@ -89,7 +89,7 @@ x = {arg type = 0; // change the wave types, observe the amplitude invariance of the descriptors, apart from the leftmost coefficient x.set(\type, 1) -~winRange = 50; //adjust the range above and below 0 to zoom in or out on the MFCC +~winRange = 5; //adjust the range above and below 0 to zoom in or out on the MFCC x.set(\type, 2) x.set(\type, 0) // free this source diff --git a/release-packaging/HelpSource/Classes/FluidMLPClassifier.schelp b/release-packaging/HelpSource/Classes/FluidMLPClassifier.schelp index 6522cd9..f58b84f 100644 --- a/release-packaging/HelpSource/Classes/FluidMLPClassifier.schelp +++ b/release-packaging/HelpSource/Classes/FluidMLPClassifier.schelp @@ -124,10 +124,9 @@ code:: //Run the test data through the network, into the predicted labelset ~classifier.predict(~testdata,~predictedlabels,action:{"Test complete".postln}); -OSCFunc.trace(true,true) -OSCFunc.allEnabled + //get labels from server -~predictedlabels.dump(action:{|d|~labelsdict = d["data"]};~labelsdict.postln); +~predictedlabels.dump(action:{|d| ~labelsdict = d["data"]; ~labelsdict.postln}); //Visualise: we're hoping to see colours neatly mapped to quandrants... ( diff --git a/release-packaging/HelpSource/Classes/FluidNMFMatch.schelp b/release-packaging/HelpSource/Classes/FluidNMFMatch.schelp index 9c44521..a98d2bd 100644 --- a/release-packaging/HelpSource/Classes/FluidNMFMatch.schelp +++ b/release-packaging/HelpSource/Classes/FluidNMFMatch.schelp @@ -112,7 +112,7 @@ c = Buffer.new(s); // train only 2 seconds ( Routine { - FluidBufNMF.process(s,b,0,88200,0,1, c, ~bases, components:10,fftSize:2048); + FluidBufNMF.process(s,b,0,88200,0,1, c, ~bases, components:10,fftSize:2048).wait; c.query; }.play; ) @@ -197,7 +197,7 @@ c = Buffer.new(s); // train only 2 seconds ( Routine { - FluidBufNMF.process(s,b,0,88200,0,1, c, ~bases, components:8, hopSize:256, fftSize:2048); + FluidBufNMF.process(s,b,0,88200,0,1, c, ~bases, components:8, hopSize:256, fftSize:2048).wait; c.query; }.play; ) diff --git a/release-packaging/HelpSource/Classes/FluidNormalize.schelp b/release-packaging/HelpSource/Classes/FluidNormalize.schelp index 9838cec..b073ce3 100644 --- a/release-packaging/HelpSource/Classes/FluidNormalize.schelp +++ b/release-packaging/HelpSource/Classes/FluidNormalize.schelp @@ -130,7 +130,6 @@ FluidBufPitch.process(s,~audio, features: ~pitch_feature); ~inbuf = Buffer.loadCollection(s,0.5.dup); ~outbuf = Buffer.new(s); ~normalizer.transformPoint(~inbuf,~outbuf,{|x|x.postln;x.getn(0,2,{|y|y.postln;};)}); -OSCFunc.trace(false,true) //Server side queries ( diff --git a/release-packaging/HelpSource/Classes/FluidRobustScale.schelp b/release-packaging/HelpSource/Classes/FluidRobustScale.schelp index 6606576..6e4c1b0 100644 --- a/release-packaging/HelpSource/Classes/FluidRobustScale.schelp +++ b/release-packaging/HelpSource/Classes/FluidRobustScale.schelp @@ -66,7 +66,6 @@ EXAMPLES:: code:: s.boot; //Preliminaries: we want some audio, a couple of FluidDataSets, some Buffers and a FluidRobustScale -// FluidRobustScale.dumpAllMethods ( ~audiofile = File.realpath(FluidBufPitch.class.filenameSymbol).dirname +/+ "../AudioFiles/Tremblay-ASWINE-ScratchySynth-M.wav"; ~raw = FluidDataSet(s);