Dear all
I am wondering if I my assumptions are wrong, or if there is a discrepancy that needs solving (or not.)
Setup: if one installs objects like our flucoma.org bundle, one might have stuff included in the help, like media files. To make a clean install, we have put all of them in a folder called media/
The behaviour I rely on for the held-files is that [soundfiler] will find, for instance, [read -resize media/mysound.wav] (see attached file)
First question: am I right to do so (not ethically, but in term of path resolution to installed libraries)
— If I am right that it should find the file (as it does), let’s continue:
Second question: should [file glob] resolve [symbol media/*.wav] ? Because it doesn’t and that makes me doubt the whole world.
— Thanks for your help as usual
pa
On Tue, 2022-01-11 at 11:31 +0000, Pierre Alexandre Tremblay wrote:
Dear all
I am wondering if I my assumptions are wrong, or if there is a discrepancy that needs solving (or not.)
Setup: if one installs objects like our flucoma.org bundle, one might have stuff included in the help, like media files. To make a clean install, we have put all of them in a folder called media/
The behaviour I rely on for the held-files is that [soundfiler] will find, for instance, [read -resize media/mysound.wav] (see attached file)
If 'media' lies near the patch, yes. From what I understand, when given a relative path to [soundfiler] (and many other objects), it'll try all search paths, starting with the directory of the path.
First question: am I right to do so (not ethically, but in term of path resolution to installed libraries)
From what I understand: yes.
— If I am right that it should find the file (as it does), let’s continue:
Second question: should [file glob] resolve [symbol media/*.wav] ? Because it doesn’t and that makes me doubt the whole world.
I guess you missed this whole thread from a few days ago: https://lists.puredata.info/pipermail/pd-list/2022-01/130639.html
TLDR: Unlike many other file accessing objects like [soundfile], [reasf~], [textfile], etc. [file] doesn't use search paths¹. Relative paths given to it are resolved against the current working directory, which is the start location of Pd (which is your user home when starting Pd from menu).
[symbol media/*.wav(->[file glob] doesn't work unless you started Pd from the location where your patch resides.
Until there is a pure [file]-based solution, you could use [dir( - [pdcontrol] to get the directory of your patch, append '/media/*.wav' to it and feed that to [file glob].
Roman
¹ [file which] does traverse all search paths, but it doesn't work for directories or for globs.
Thanks Roman for the fabulous answer.
If 'media' lies near the patch
It doesn’t actually. It seems to work from wherever I am on my machine.
TLDR: Unlike many other file accessing objects like [soundfile], [reasf~], [textfile], etc. [file] doesn't use search paths¹.
With that footnote, I was hopeful to get [file which] to give me the path of [media/] but no luck.
I’ve also tried to find a way to get [dir] from pdcontrol… I wondered if there was a way to get the path to a given object help, like in SuperCollider
FluidBufAmpGate.class.filenameSymbol
Anyway. Good to know that it is not me. Thanks again for the reply.
On Tue, 2022-01-11 at 13:41 +0000, Pierre Alexandre Tremblay wrote:
With that footnote, I was hopeful to get [file which] to give me the path of [media/] but no luck.
[file which] only searches for files in all search paths. It doesn't work for directories.
I’ve also tried to find a way to get [dir] from pdcontrol
My suggestion was to use the message 'dir' sent to [pdcontrol] object:
[dir( | [pdcontrol]
This returns the directory of the patch. You said that the media folder is not located near your patch. So, I assume it is in your search paths then. Then I don't know to get its location as absolute path. Sorry.
Roman
I was hopeful to get [file which] to give me the path of [media/] but no luck.
It should allow you to get the path of [media/mysound.wav] though.
Le mar. 11 janv. 2022 à 14:41, Pierre Alexandre Tremblay tremblap@gmail.com a écrit :
Thanks Roman for the fabulous answer.
If 'media' lies near the patch
It doesn’t actually. It seems to work from wherever I am on my machine.
TLDR: Unlike many other file accessing objects like [soundfile], [reasf~], [textfile], etc. [file] doesn't use search paths¹.
With that footnote, I was hopeful to get [file which] to give me the path of [media/] but no luck.
I’ve also tried to find a way to get [dir] from pdcontrol… I wondered if there was a way to get the path to a given object help, like in SuperCollider
FluidBufAmpGate.class.filenameSymbol
Anyway. Good to know that it is not me. Thanks again for the reply._______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Indeed I can ask for the help file!!! Thanks!
On 11 Jan 2022, at 16:46, Christof Ressi info@christofressi.com wrote:
I wondered if there was a way to get the path to a given object help, like in SuperCollider
FluidBufAmpGate.class.filenameSymbol
Yes, that's possible with [file which]
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On Tue, 2022-01-11 at 17:46 +0100, Christof Ressi wrote:
I wondered if there was a way to get the path to a given object help, like in SuperCollider
FluidBufAmpGate.class.filenameSymbol
Yes, that's possible with [file which]
Yay, we finally have a way to programmatically check if dependencies have been installed/configured correctly :-)
Roman