Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion example-code/sc/Standardize.scd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ s.boot;
~features = Buffer(s);
FluidBufSpectralShape.processBlocking(s,~src,features:~features,select:~select);
~ds = FluidDataSet(s).fromBuffer(~features);
"Firs the Raw Data, then the Standardized Data:".postln;
"First the Raw Data, then the Standardized Data:".postln;
~ds.print;
~stand = FluidStandardize(s).fitTransform(~ds,~ds);
~ds.print;
Expand All @@ -19,6 +19,49 @@ FluidBufSpectralShape.processBlocking(s,~src,features:~features,select:~select);
defer{FluidPlotter(dict:dict)}
});
)

::
strong::Transforming a single point::
code::

~src = Buffer.read(s,FluidFilesPath("Tremblay-UW-ComplexDescent-M.wav"));

// standardize a spectral analysis
(
~features = Buffer(s);
FluidBufSpectralShape.processBlocking(s,~src,features:~features);
~ds = FluidDataSet(s).fromBuffer(~features);
"Firs the Raw Data, then the Standardized Data:".postln;
~ds.print;
~ds_stand = FluidDataSet(s);
~stand = FluidStandardize(s).fitTransform(~ds,~ds_stand);
~ds_stand.print;
)

~singlePoint = Buffer.alloc(s,7);

// take a look at the original via a bar graph. see post window for extreme differences in scale
(
~ds.getPoint("0",~singlePoint);
~singlePoint.loadToFloatArray(action:{
arg fa;
fa.postln;
defer{fa.plot.plotMode_(\bars)};
});
)

~scaledPoint = Buffer.alloc(s,7);

// now standardize it using the `fit` from above
// see the post window to notice that the ranges are now all similar
(
~stand.transformPoint(~singlePoint,~scaledPoint);
~scaledPoint.loadToFloatArray(action:{
arg fa;
fa.postln;
defer{fa.plot.plotMode_(\bars)};
});
)
::
strong::Server-side Querying::
code::
Expand Down