Skip to content

Commit

Permalink
some typos and formatting fixes for SC help files
Browse files Browse the repository at this point in the history
  • Loading branch information
tedmoore committed Jul 7, 2022
1 parent af0a47f commit 621b444
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 29 deletions.
1 change: 1 addition & 0 deletions example-code/sc/BufThreadDemo.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
3 changes: 1 addition & 2 deletions example-code/sc/DataSet.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions example-code/sc/Grid.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
45 changes: 22 additions & 23 deletions example-code/sc/KDTree.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
};
});
});
};
});
)

Expand Down
1 change: 1 addition & 0 deletions example-code/sc/KMeans.scd
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ fork{
)
::
strong::Distances::

Accessing the distances to each point's mean
code::
Expand Down
9 changes: 5 additions & 4 deletions example-code/sc/SKMeans.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
)

Expand Down

0 comments on commit 621b444

Please sign in to comment.