From 8cfa7a1e95f21f95133527be5b0e2ca1b1c5369c Mon Sep 17 00:00:00 2001 From: Ted Moore Date: Tue, 14 Dec 2021 00:57:58 +0000 Subject: [PATCH] FluidFilesPath helpfile --- .../HelpSource/Classes/FluidFilesPath.schelp | 55 +++++++++++++++++++ test/FluidFilesPath_test.scd | 5 +- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 release-packaging/HelpSource/Classes/FluidFilesPath.schelp diff --git a/release-packaging/HelpSource/Classes/FluidFilesPath.schelp b/release-packaging/HelpSource/Classes/FluidFilesPath.schelp new file mode 100644 index 0000000..23bfacc --- /dev/null +++ b/release-packaging/HelpSource/Classes/FluidFilesPath.schelp @@ -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; +} +) +:: diff --git a/test/FluidFilesPath_test.scd b/test/FluidFilesPath_test.scd index 585f577..db380e7 100644 --- a/test/FluidFilesPath_test.scd +++ b/test/FluidFilesPath_test.scd @@ -1,11 +1,11 @@ ( -// should all return the same path: +// these will return the same path (FluidFilesPath()++"Nicol-LoopE-M.wav").postln; 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"; @@ -19,6 +19,7 @@ s.waitForBoot{ ) ( +// test it another way s.waitForBoot{ Routine{ var path = FluidFilesPath("Nicol-LoopE-M.wav");