Merge pull request #44 from flucoma/enhance/FluidFilesPath
created FluidFilesPath and a test filenix
commit
79385e7f9f
@ -0,0 +1,7 @@
|
||||
FluidFilesPath {
|
||||
*new {
|
||||
arg fileName;
|
||||
fileName = fileName ? "";
|
||||
^("%/../AudioFiles/".format(File.realpath(FluidDataSet.class.filenameSymbol).dirname) +/+ fileName);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
TITLE:: FluidFilesPath
|
||||
summary:: A convenience class for accessing the audio files provided with the FluCoMa Extension
|
||||
categories:: Libraries>FluidCorpusManipulation
|
||||
related:: Classes/FluidLoadFolder
|
||||
|
||||
DESCRIPTION::
|
||||
|
||||
|
||||
CLASSMETHODS::
|
||||
|
||||
METHOD:: new
|
||||
Get the path to the "AudioFiles" folder inside the FluCoMa extensions folder. Following this with a ++ "name_Of_The_File-You-Want.wav" will create the path to file you want.
|
||||
|
||||
ARGUMENT:: fileName
|
||||
Optionally, you may pass in the name of the file you want to use and the *new class method will return the path to that file.
|
||||
|
||||
returns:: The path to the "AudioFiles" folder inside the FluCoMa extensions folder (optionally with provided file name).
|
||||
|
||||
EXAMPLES::
|
||||
|
||||
code::
|
||||
(
|
||||
// these will return the same path
|
||||
(FluidFilesPath()++"Nicol-LoopE-M.wav").postln;
|
||||
FluidFilesPath("Nicol-LoopE-M.wav").postln;
|
||||
)
|
||||
|
||||
(
|
||||
// test it one way
|
||||
s.waitForBoot{
|
||||
Routine{
|
||||
var path = FluidFilesPath()++"Nicol-LoopE-M.wav";
|
||||
var buf = Buffer.read(s,path);
|
||||
|
||||
s.sync;
|
||||
|
||||
buf.play;
|
||||
}.play;
|
||||
}
|
||||
)
|
||||
|
||||
(
|
||||
// test it another way
|
||||
s.waitForBoot{
|
||||
Routine{
|
||||
var path = FluidFilesPath("Nicol-LoopE-M.wav");
|
||||
var buf = Buffer.read(s,path);
|
||||
|
||||
s.sync;
|
||||
|
||||
buf.play;
|
||||
}.play;
|
||||
}
|
||||
)
|
||||
::
|
||||
@ -0,0 +1,33 @@
|
||||
(
|
||||
// these will return the same path
|
||||
(FluidFilesPath()++"Nicol-LoopE-M.wav").postln;
|
||||
FluidFilesPath("Nicol-LoopE-M.wav").postln;
|
||||
)
|
||||
|
||||
(
|
||||
// test it one way
|
||||
s.waitForBoot{
|
||||
Routine{
|
||||
var path = FluidFilesPath()++"Nicol-LoopE-M.wav";
|
||||
var buf = Buffer.read(s,path);
|
||||
|
||||
s.sync;
|
||||
|
||||
buf.play;
|
||||
}.play;
|
||||
}
|
||||
)
|
||||
|
||||
(
|
||||
// test it another way
|
||||
s.waitForBoot{
|
||||
Routine{
|
||||
var path = FluidFilesPath("Nicol-LoopE-M.wav");
|
||||
var buf = Buffer.read(s,path);
|
||||
|
||||
s.sync;
|
||||
|
||||
buf.play;
|
||||
}.play;
|
||||
}
|
||||
)
|
||||
Loading…
Reference in New Issue