what would be an appropriate way to get all filenames out of a directory in pd-vanilla?
i have only seen very old posts about this, they all use pd-extended. is there any recent object/external that does this? it could be nice if openpanel could also open a directory and output all the filenames...
alternatively is there a way to just read all the files from a directory one after the other?
cheers
It's not possible with Vanilla objects. There are three possible interfaces I've seen for an external that lists files:1) linked-list style -- start at the beginning, send a "next" message to output the next file in the directory, bang an ancillary outlet when finished. (You can have more complex variations on this, like "rewind" to go back to the head...)2) list style -- output a single list where each element is a file in the directory.3) sequence -- output each file as a separate message, until there are no files left to output. I'm not a fan of #1 as it almost always requires boilerplate (like [until] and a wire connecting upwards). I also don't like #3 because it forces the user to eat the cost of sending all those messages. For example, the user may just want to count how many files there are. Also, it is a re-entrancy nightmare just waiting to happen. #2 is the most flexible. You can use it with [list-drip] to get #3 with very little additional overhead. -Jonathan
On Monday, December 7, 2015 4:27 AM, Simon Iten <itensimon@gmail.com> wrote:
what would be an appropriate way to get all filenames out of a directory in pd-vanilla?
i have only seen very old posts about this, they all use pd-extended. is there any recent object/external that does this? it could be nice if openpanel could also open a directory and output all the filenames...
alternatively is there a way to just read all the files from a directory one after the other?
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
sounds good, so what would be an external with approach number 2?
cheers
On 07 Dec 2015, at 17:26, Jonathan Wilkes jancsika@yahoo.com wrote:
It's not possible with Vanilla objects.
There are three possible interfaces I've seen for an external that lists files:
- linked-list style -- start at the beginning, send a "next" message to output the next file in the directory, bang an ancillary outlet when finished. (You can have more complex variations on this, like "rewind" to go back to the head...)
- list style -- output a single list where each element is a file in the directory.
- sequence -- output each file as a separate message, until there are no files left to output.
I'm not a fan of #1 as it almost always requires boilerplate (like [until] and a wire connecting upwards).
I also don't like #3 because it forces the user to eat the cost of sending all those messages. For example, the user may just want to count how many files there are. Also, it is a re-entrancy nightmare just waiting to happen.
#2 is the most flexible. You can use it with [list-drip] to get #3 with very little additional overhead.
-Jonathan
On Monday, December 7, 2015 4:27 AM, Simon Iten itensimon@gmail.com wrote:
what would be an appropriate way to get all filenames out of a directory in pd-vanilla?
i have only seen very old posts about this, they all use pd-extended. is there any recent object/external that does this? it could be nice if openpanel could also open a directory and output all the filenames...
alternatively is there a way to just read all the files from a directory one after the other?
cheers
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list http://lists.puredata.info/listinfo/pd-list
hcs/folder_list does #3, but I don't know one that does #2 -Jonathan
On Monday, December 7, 2015 12:26 PM, Simon Iten <itensimon@gmail.com> wrote:
sounds good, so what would be an external with approach number 2? cheers
On 07 Dec 2015, at 17:26, Jonathan Wilkes jancsika@yahoo.com wrote: It's not possible with Vanilla objects. There are three possible interfaces I've seen for an external that lists files:1) linked-list style -- start at the beginning, send a "next" message to output the next file in the directory, bang an ancillary outlet when finished. (You can have more complex variations on this, like "rewind" to go back to the head...)2) list style -- output a single list where each element is a file in the directory.3) sequence -- output each file as a separate message, until there are no files left to output. I'm not a fan of #1 as it almost always requires boilerplate (like [until] and a wire connecting upwards). I also don't like #3 because it forces the user to eat the cost of sending all those messages. For example, the user may just want to count how many files there are. Also, it is a re-entrancy nightmare just waiting to happen. #2 is the most flexible. You can use it with [list-drip] to get #3 with very little additional overhead. -Jonathan
On Monday, December 7, 2015 4:27 AM, Simon Iten <itensimon@gmail.com> wrote:
what would be an appropriate way to get all filenames out of a directory in pd-vanilla?
i have only seen very old posts about this, they all use pd-extended. is there any recent object/external that does this? it could be nice if openpanel could also open a directory and output all the filenames...
alternatively is there a way to just read all the files from a directory one after the other?
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
i checked out deken but there is little stuff for osx. while i mainly use linux, this patch is for osx…hmm.
On 07 Dec 2015, at 22:00, Roman Haefeli reduzent@gmail.com wrote:
On Mon, 2015-12-07 at 17:50 +0000, Jonathan Wilkes via Pd-list wrote:
hcs/folder_list does #3, but I don't know one that does #2
[readdir] (available as 'readdir' through deken) does #1.
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mit, 2015-12-09 at 09:26 +0100, Simon Iten wrote:
i checked out deken but there is little stuff for osx. while i mainly use linux, this patch is for osx…hmm.
Oh, I would be happy to support builds for OS X, too, but I lack access to a OS X machine. I'll look around for one...
Roman
On 07 Dec 2015, at 22:00, Roman Haefeli reduzent@gmail.com wrote:
On Mon, 2015-12-07 at 17:50 +0000, Jonathan Wilkes via Pd-list
wrote:
hcs/folder_list does #3, but I don't know one that does #2
[readdir] (available as 'readdir' through deken) does #1.
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
On 07/12/15 17:26, Jonathan Wilkes via Pd-list wrote:
It's not possible with Vanilla objects.
In 2016 it would really be nice for Pd *Vanilla* to allow *natively* the use of some scripting language. My personal fav would be Python, but I'd be happy with anything really...
After the heated debates about luscious beizer curved chords and gradients in 2013, I this is still miss this feature more than any sexy GUI - :-)
Lorenzo.
Hi Lorenzo, There's pdlua. Pd Vanilla now includes deken, so if you want to package and maintain pdlua it will then become "native". -Jonathan
On Monday, December 7, 2015 4:25 PM, Lorenzo Sutton <lorenzofsutton@gmail.com> wrote:
On 07/12/15 17:26, Jonathan Wilkes via Pd-list wrote:
It's not possible with Vanilla objects.
In 2016 it would really be nice for Pd *Vanilla* to allow *natively* the use of some scripting language. My personal fav would be Python, but I'd be happy with anything really...
After the heated debates about luscious beizer curved chords and gradients in 2013, I this is still miss this feature more than any sexy GUI - :-)
Lorenzo.
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 07/12/15 22:39, Jonathan Wilkes wrote:
Hi Lorenzo, There's pdlua.
Pd Vanilla now includes deken, so if you want to package and maintain pdlua it will then become "native".
I admit I haven't looked at deken yet. But isn't using externals kinda "cheating" about "nativeness"?
I wonder if something similar to the gui-plugins would allow to use tcl in specially named objects such as:
[tcl mytclabstraction]
and then that would use mytclabstraction.tcl
Lorenzo.
-Jonathan
On Monday, December 7, 2015 4:25 PM, Lorenzo Sutton lorenzofsutton@gmail.com wrote:
On 07/12/15 17:26, Jonathan Wilkes via Pd-list wrote:
It's not possible with Vanilla objects.
In 2016 it would really be nice for Pd *Vanilla* to allow *natively* the use of some scripting language. My personal fav would be Python, but I'd be happy with anything really...
After the heated debates about luscious beizer curved chords and gradients in 2013, I this is still miss this feature more than any sexy GUI - :-)
Lorenzo.
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Well, there's also a pdtcl external for loading code written in tcl. I guess I'm curious what you mean by "native" here. -Jonathan
On Monday, December 7, 2015 4:52 PM, Lorenzo Sutton <lorenzofsutton@gmail.com> wrote:
On 07/12/15 22:39, Jonathan Wilkes wrote:
Hi Lorenzo, There's pdlua.
Pd Vanilla now includes deken, so if you want to package and maintain pdlua it will then become "native".
I admit I haven't looked at deken yet. But isn't using externals kinda "cheating" about "nativeness"?
I wonder if something similar to the gui-plugins would allow to use tcl in specially named objects such as:
[tcl mytclabstraction]
and then that would use mytclabstraction.tcl
Lorenzo.
-Jonathan
On Monday, December 7, 2015 4:25 PM, Lorenzo Sutton lorenzofsutton@gmail.com wrote:
On 07/12/15 17:26, Jonathan Wilkes via Pd-list wrote: > It's not possible with Vanilla objects.
In 2016 it would really be nice for Pd *Vanilla* to allow *natively* the use of some scripting language. My personal fav would be Python, but I'd be happy with anything really...
After the heated debates about luscious beizer curved chords and gradients in 2013, I this is still miss this feature more than any sexy GUI - :-)
Lorenzo.
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 07/12/15 23:23, Jonathan Wilkes wrote:
Well, there's also a pdtcl external for loading code written in tcl.
I guess I'm curious what you mean by "native" here.
Yes, I admit the term is confusing. Out-of-the-box maybe makes more sense. Not provided by an external, unless the external is distributed with Pd Vanilla itself (e.g. expr~)
Lorenzo.
-Jonathan
On Monday, December 7, 2015 4:52 PM, Lorenzo Sutton lorenzofsutton@gmail.com wrote:
On 07/12/15 22:39, Jonathan Wilkes wrote:
Hi Lorenzo, There's pdlua.
Pd Vanilla now includes deken, so if you want to package and maintain pdlua it will then become "native".
I admit I haven't looked at deken yet. But isn't using externals kinda "cheating" about "nativeness"?
I wonder if something similar to the gui-plugins would allow to use tcl in specially named objects such as:
[tcl mytclabstraction]
and then that would use mytclabstraction.tcl
Lorenzo.
-Jonathan
On Monday, December 7, 2015 4:25 PM, Lorenzo Sutton <lorenzofsutton@gmail.com mailto:lorenzofsutton@gmail.com> wrote:
On 07/12/15 17:26, Jonathan Wilkes via Pd-list wrote:
It's not possible with Vanilla objects.
In 2016 it would really be nice for Pd *Vanilla* to allow *natively* the use of some scripting language. My personal fav would be Python, but I'd be happy with anything really...
After the heated debates about luscious beizer curved chords and gradients in 2013, I this is still miss this feature more than any sexy GUI - :-)
Lorenzo.
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at
<mailto:Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at> mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 07/12/15 10:26, Simon Iten wrote:
what would be an appropriate way to get all filenames out of a directory in pd-vanilla?
i have only seen very old posts about this, they all use pd-extended. is there any recent object/external that does this? it could be nice if openpanel could also open a directory and output all the filenames...
alternatively is there a way to just read all the files from a directory one after the other?
If you are on Linux (unix? macs?) and have Bash you could have in Pd a netreceive obeject e.g.:
[netreceive 6666]
Then from bash something like this (from within the dir you want to list)
echo $(ls -1 | tr "\n" ";") > /dev/tcp/127.0.0.1/6666
or like this (example to feed directly the netreceive outlet to a [list] object..):
echo $(find . -maxdepth 1 -type f -printf '%f ')";" >
/dev/tcp/127.0.0.1/6666
The last one would also list hidden (i.e. 'dot') filenames
Lorenzo.