I’m currently using [ggee/getdir] to determine the path of the current patch, and I was hoping that [file] would give me a vanilla alternative. It doesn’t seem to – am I missing something?
Thanks,
Phil Stone University of California, Davis
[dir( -> [pdcontrol]. Not very intuitive, I know...
We have been discussing to add such functionality to the [file] object family, where it would make more sense. See https://github.com/pure-data/pure-data/issues/1539.
Christof
On 23.03.2022 02:23, Philip Stone via Pd-list wrote:
I’m currently using [ggee/getdir] to determine the path of the current patch, and I was hoping that [file] would give me a vanilla alternative. It doesn’t seem to – am I missing something?
Thanks,
Phil Stone
University of California, Davis
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
Hi, so, [file] is great, I have a [dir] object in ELSE that browses through files in a directory and I guess one can now do it all in plain Vanilla, but I was trying things and it's not that easy or straight forward.
In [dir] you can easily browse through files like giving it a file number so it queries and gives you a file name, and you can ask for specific extensions like ".wav". Say you want to load audio files from a directory, just use the 'seek <float>' message and seek for the files, like "seek 4" gives us the 5th audio .wav file. The [dir] object also gives us the number of found files so we can choose them randomly.
I can do this with [file] but it needs lots of stuff. Check out my attached image.
So, one thing I'd like, just get the filename and extension from [file split] as an option, so I wouldn't need [list split]. Also, something weird happened and files with space in its name came out as 'lists', not symbols.
Another thing is just an easier way to 'seek' for files with a specific extension and also get the number of found files.
And yes, getting the patch's directory by default would make things easier and bypass the need of [pdcontrol].
cheers
Em ter., 22 de mar. de 2022 às 22:30, Christof Ressi info@christofressi.com escreveu:
[dir( -> [pdcontrol]. Not very intuitive, I know...
We have been discussing to add such functionality to the [file] object family, where it would make more sense. See https://github.com/pure-data/pure-data/issues/1539.
Christof On 23.03.2022 02:23, Philip Stone via Pd-list wrote:
I’m currently using [ggee/getdir] to determine the path of the current patch, and I was hoping that [file] would give me a vanilla alternative. It doesn’t seem to – am I missing something?
Thanks,
Phil Stone
University of California, Davis
_______________________________________________Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 3/23/22 20:44, Alexandre Torres Porres wrote:
So, one thing I'd like, just get the filename and extension from [file split] as an option, so I wouldn't need [list split].
i think the best would be if [list split] would accept negative indices (counting from the end), to simply extraxt the last element of a list.
Also, something weird happened and files with space in its name came out as 'lists', not symbols.
i'm not sure i can follow. [file split] always outputs a list, regardless of spaces. ifa filename contains spaces, i here get something like: [list foo\ bar.pd( (that's a "list"-message with a single symbol-atom "foo bar.pd")
however, i noticed that my unit-tests (that are automatically run on linux, windows and macOS) do not cover splitting files with spaces. so i might have missed some cross-platform thing.
Another thing is just an easier way to 'seek' for files with a specific extension and also get the number of found files.
that seems very high-level to me.
(aka: build your abstraction around [file] to get this and a graphical pull-down menu for chosing files and playing the soundfile)
And yes, getting the patch's directory by default would make things easier and bypass the need of [pdcontrol].
there's an open PR that adds [file patchpath] (and more).
gfdmasrf IOhannes
[list split] would accept negative indices (counting from the end)
+10!
Le jeu. 24 mars 2022 à 08:16, IOhannes m zmoelnig zmoelnig@iem.at a écrit :
On 3/23/22 20:44, Alexandre Torres Porres wrote:
So, one thing I'd like, just get the filename and extension from [file split] as an option, so I wouldn't need [list split].
i think the best would be if [list split] would accept negative indices (counting from the end), to simply extraxt the last element of a list.
Also, something weird happened and files with space in its name came out as 'lists', not
symbols.
i'm not sure i can follow. [file split] always outputs a list, regardless of spaces. ifa filename contains spaces, i here get something like: [list foo\ bar.pd( (that's a "list"-message with a single symbol-atom "foo bar.pd")
however, i noticed that my unit-tests (that are automatically run on linux, windows and macOS) do not cover splitting files with spaces. so i might have missed some cross-platform thing.
Another thing is just an easier way to 'seek' for files with a specific extension and also get the number of found files.
that seems very high-level to me.
(aka: build your abstraction around [file] to get this and a graphical pull-down menu for chosing files and playing the soundfile)
And yes, getting the patch's directory by default would make things
easier
and bypass the need of [pdcontrol].
there's an open PR that adds [file patchpath] (and more).
gfdmasrf IOhannes _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Em qui., 24 de mar. de 2022 às 06:48, Antoine Rousseau antoine@metalu.net escreveu:
[list split] would accept negative indices (counting from the end)
+10!
yeah, that's great. I have a n external that does that [slice] and would gladly remove it for a vanilla solution.
Le jeu. 24 mars 2022 à 08:16, IOhannes m zmoelnig zmoelnig@iem.at a écrit :
i'm not sure i can follow. [file split] always outputs a list, regardless of spaces. ifa filename contains spaces, i here get something like: [list foo\ bar.pd( (that's a "list"-message with a single symbol-atom "foo bar.pd")
yeah that's not the issue
however, i noticed that my unit-tests (that are automatically run on
linux, windows and macOS) do not cover splitting files with spaces. so i might have missed some cross-platform thing.
yup, this is the issue, when splitting a file with a space, like
*Users/porres/Desktop/rename
copy.pd*
I get:
list / Users porres Desktop *list\ rename\ copy.pd*
so for the file name I actually get *symbol list\ rename\ copy.pd*
that seems very high-level to me.
I'll insist and say I think it'd be really nice if we could have a [file seek] object that browses through files in a directory. But anyway, I can keep using [else/dir] for that.
cheers
On 3/25/22 17:31, Alexandre Torres Porres wrote:
Em qui., 24 de mar. de 2022 às 06:48, Antoine Rousseau antoine@metalu.net escreveu:
[list split] would accept negative indices (counting from the end)
+10!
yeah, that's great. I have a n external that does that [slice]
yeah. and zexy has [niagara] that does this. my git history only reaches back to 2002, and it was there back then.
but i was really talking about [list split] here.
yup, this is the issue, when splitting a file with a space, like *Users/porres/Desktop/rename
copy.pd*I get:
list / Users porres Desktop *list\ rename\ copy.pd*
so for the file name I actually get *symbol list\ rename\ copy.pd*
not for me. could you please provide a patch that shows this problem (without also requiring a copy of your harddisk; that is: the filename-with-space should be stored in the patch), and attach it to your bug-report.
gfmds IOhannes
Em sáb., 26 de mar. de 2022 às 03:46, IOhannes m zmölnig zmoelnig@iem.at escreveu:
not for me.
oops, my bad, nevermind
sorry
Em sáb., 26 de mar. de 2022 às 03:46, IOhannes m zmölnig zmoelnig@iem.at escreveu:
yeah, that's great. I have a n external that does that [slice]
yeah. and zexy has [niagara] that does this. my git history only reaches back to 2002, and it was there back then.
but i was really talking about [list split] here.
For the record, my reasoning was: "*I know there are externals but this is such an important feature that we shouldn't rely on externals for that and have a native solution instead (I have made an external for that myself and would gladly remove it from my library)*." I wasn't bragging about externals I have or promoting them, sorry if I gave that idea...
yup, this is the issue, when splitting a file with a space, like *Users/porres/Desktop/rename
copy.pd*I get:
list / Users porres Desktop *list\ rename\ copy.pd*
so for the file name I actually get *symbol list\ rename\ copy.pd*
not for me. could you please provide a patch that shows this problem (without also requiring a copy of your harddisk; that is: the filename-with-space should be stored in the patch), and attach it to your bug-report.
gfmds IOhannes _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list