I’m very new to SuperCollider and am having a hard time finding any documentation about the file path to read a sound file into a buffer. How do I set the correct file path and where does the macOS SuperCollider app look for the root folder for a sound file?
Try to copy-paste an audio file from Finder to your SC document! You’ll get the absolute file path typed down for you
About the root:
If the path is absolute (starts with “/”) the root is the root of your filesystem
If the path is relative (doesn’t start with “/”), it is relative to your home folder, at least on my machine
Thanks that was easy!
Also fun: drag the file into the IDE window and watch the path appear wherever you drop it.
You might find using Dialog
more interesting/useful, if you’re looking for files on a regular basis. Here’s an example:
(
Dialog.openPanel({ arg path;
path.postln;
});
)
You’ll see the file path is posted in the post window (and you can copy and paste that too). Furthermore, if you want to try it out, you could do a little test using an environment variable like this:
(
Dialog.openPanel({ |path|
~b = Buffer.read(s, path);
});
)
~b.play;
I hope that helps.
Oh, and by the way … welcome to our community!
Awesome this will be a lot of help in the future!