typo corrections in new helpfiles

nix
Pierre Alexandre Tremblay 6 years ago
parent 14aec9832a
commit fb64db6d50

@ -82,10 +82,11 @@ b = Buffer.read(s,~randomsoundfile.path,action:{"Sound Loaded".postln});
FluidBufPitch.process(s,b,numFrames:512 * 10,numChans:1,features:~pitchdata,action:{"Pitch Analysis Done".postln}); 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) // Flatten and print the flat buffer. We expect to see larger numbers (20-2000) interleaved with smaller (0-1)
(
FluidBufFlatten.process(s,~pitchdata,~flatdata,action:{ FluidBufFlatten.process(s,~pitchdata,~flatdata,action:{
~flatdata.loadToFloatArray(action:{ |a| ~flatdata.loadToFloatArray(action:{ |a|
a.postln; a.postln;
}) })
}) })
)
:: ::

@ -33,10 +33,12 @@ s.reboot;
~ds = FluidDataSet(s,\FluidDataSetWr); ~ds = FluidDataSet(s,\FluidDataSetWr);
) )
(
{ {
var b = LocalBuf.newFrom([0,1,2,3]); var b = LocalBuf.newFrom([0,1,2,3]);
FreeSelfWhenDone.kr(FluidDataSetWr.kr("help_data_point",b,~ds)); FreeSelfWhenDone.kr(FluidDataSetWr.kr("help_data_point",b,~ds));
}.play(s); }.play(s);
)
~ds.print; ~ds.print;

@ -49,7 +49,7 @@ code::
var pitch, stats,statsbuf,label,voice; var pitch, stats,statsbuf,label,voice;
label = data.key; label = data.key;
voice = data.value[\voice]; voice = data.value[\voice];
statsbuf = LocalBuf(7); statsbuf = LocalBuf(7,4);
pitch = FluidBufPitch.kr(src,start,num,features:~featurebuffers[voice]); pitch = FluidBufPitch.kr(src,start,num,features:~featurebuffers[voice]);
stats = FluidBufStats.kr(~featurebuffers[voice],stats:statsbuf,trig:Done.kr(pitch)); stats = FluidBufStats.kr(~featurebuffers[voice],stats:statsbuf,trig:Done.kr(pitch));
FluidDataSetWr.kr(label,statsbuf,~mydataset,Done.kr(stats)) FluidDataSetWr.kr(label,statsbuf,~mydataset,Done.kr(stats))
@ -84,7 +84,8 @@ EXAMPLES::
code:: code::
s.reboot; s.reboot;
//Load all the Fluid Corpus Manipulation audio f //Load all the Fluid Corpus Manipulation audio files
( (
~path = File.realpath(FluidLoadFolder.class.filenameSymbol).dirname +/+ "../AudioFiles"; ~path = File.realpath(FluidLoadFolder.class.filenameSymbol).dirname +/+ "../AudioFiles";
~loader = FluidLoadFolder(~path); ~loader = FluidLoadFolder(~path);
@ -96,12 +97,15 @@ s.reboot;
~pitchbufs = 4.collect{Buffer.new}; ~pitchbufs = 4.collect{Buffer.new};
~statsbufs = 4.collect{Buffer.new}; ~statsbufs = 4.collect{Buffer.new};
) )
//segment //segment
~slicer.play(s,~loader.buffer,~loader.index,{|dataDictionary| "Slicing done".postln;}); ~slicer.play(s,~loader.buffer,~loader.index,{|dataDictionary| "Slicing done".postln;});
//In the interests of brevity, let's just take a subset of the slices and process these //In the interests of brevity, let's just take a subset of the slices and process these
~subset = IdentityDictionary.newFrom(~slicer.index.asSortedArray[0..3].flatten(1)); ~subset = IdentityDictionary.newFrom(~slicer.index.asSortedArray[0..7].flatten(1));
//write pitch statistics into a dataset //write pitch statistics into a dataset
(
~extractor = FluidProcessSlices({|src,start,num,data| ~extractor = FluidProcessSlices({|src,start,num,data|
var pitch, stats, label,i; var pitch, stats, label,i;
i = data.value[\voice]; i = data.value[\voice];
@ -110,7 +114,10 @@ s.reboot;
stats = FluidBufStats.kr(~pitchbufs[i],stats:~statsbufs[i],trig:Done.kr(pitch)); stats = FluidBufStats.kr(~pitchbufs[i],stats:~statsbufs[i],trig:Done.kr(pitch));
FluidDataSetWr.kr(label,~statsbufs[i],~pitchdata,Done.kr(stats)) FluidDataSetWr.kr(label,~statsbufs[i],~pitchdata,Done.kr(stats))
}); });
)
~extractor.play(s,~loader.buffer,~subset,{"Feature extraction done".postln}); ~extractor.play(s,~loader.buffer,~subset,{"Feature extraction done".postln});
//view the data //view the data
~pitchdata.print ~pitchdata.print
:: ::

@ -6,7 +6,7 @@ related:: Classes/FluidLoadFolder, Classes/FluidProcessSlices, Classes/FluidBufO
DESCRIPTION:: DESCRIPTION::
A utility class that abstracts the boiler plate code involved with batch slicing a buffer containing distinct chunks of audio (a 'corpus' for these purposes). A utility class that abstracts the boiler plate code involved with batch slicing a buffer containing distinct chunks of audio (a 'corpus' for these purposes).
Whilst this class is designed to be used most easily in conjunction with link::Classes/FluidLoadFolder::, it doesn't have to be. However, it does excpect to be passed an link::Classes/IdentityDictionary:: of a particular format (see link::#indexFormat#description below::). Whilst this class is designed to be used most easily in conjunction with link::Classes/FluidLoadFolder::, it doesn't have to be. However, it does expect to be passed an link::Classes/IdentityDictionary:: of a particular format (see link::#indexFormat#description below::).
The actual mechanism for doing the slicing is provided by the user, in the form of a function that will form part of a larger link::Classes/Synth:: (see link::#sliceFuncDescription#below::). The actual mechanism for doing the slicing is provided by the user, in the form of a function that will form part of a larger link::Classes/Synth:: (see link::#sliceFuncDescription#below::).
@ -88,10 +88,13 @@ s.reboot
~loader.play(s,action:{ |dataDictionary| "Done loading".postln}); ~loader.play(s,action:{ |dataDictionary| "Done loading".postln});
) )
(
~slicer = FluidSliceCorpus({ |src,start,num,dest| ~slicer = FluidSliceCorpus({ |src,start,num,dest|
FluidBufOnsetSlice.kr(src,start,num,indices:dest, threshold:0.7) FluidBufOnsetSlice.kr(src,start,num,indices:dest, threshold:0.7)
}); });
)
(
~slicer.play(s,~loader.buffer,~loader.index,{|dataDictionary| ~slicer.play(s,~loader.buffer,~loader.index,{|dataDictionary|
"Slicing done".postln; "Slicing done".postln;
//we get passed an IdentityDictionary of slice data, let's look at it //we get passed an IdentityDictionary of slice data, let's look at it
@ -102,6 +105,5 @@ s.reboot
')'.postln; ')'.postln;
} }
}); });
)
:: ::

Loading…
Cancel
Save