http://at.or.at/hans/pd/objects.html
Another libc port: stat. It lets you get all sorts of data from a
file. Quite handy for a number of things, like testing what kind of
file something is, or get the time of the last access, status change,
or modification. Should work on all platforms.
Also included is [file_type] object which is written in Pd and uses
[stat]. It tells you what kind of file something is (file, folder,
character, block, fifo, etc).
Of course, it'll be in the next Pd-extended test release.
.hc
Computer science is no more related to the computer than astronomy is
related to the telescope. -Edsger Dykstra
PD-announce mailing list PD-announce@iem.at http://lists.puredata.info/listinfo/pd-announce
Is there a way to get a random file of a certain type (like .mov) from a specific directory using your objects?
cgc
On 6/14/06, Hans-Christoph Steiner hans@eds.org wrote:
http://at.or.at/hans/pd/objects.html
Another libc port: stat. It lets you get all sorts of data from a file. Quite handy for a number of things, like testing what kind of file something is, or get the time of the last access, status change, or modification. Should work on all platforms.
Also included is [file_type] object which is written in Pd and uses [stat]. It tells you what kind of file something is (file, folder, character, block, fifo, etc).
Of course, it'll be in the next Pd-extended test release.
.hc
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
PD-announce mailing list PD-announce@iem.at http://lists.puredata.info/listinfo/pd-announce
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
[stat] just returns info about one file. You can get a listing of
files [folder_list] based on a glob pattern like *.mov. I am
planning on changing it to [file/match] that will act like [qlist] in
that you bang to get a new filename, then it'll bang when end of the
file listing is reached.
.hc
On Jun 14, 2006, at 8:27 AM, chris clepper wrote:
Is there a way to get a random file of a certain type (like .mov)
from a specific directory using your objects?cgc
On 6/14/06, Hans-Christoph Steiner hans@eds.org wrote:
http://at.or.at/hans/pd/objects.html
Another libc port: stat. It lets you get all sorts of data from a file. Quite handy for a number of things, like testing what kind of file something is, or get the time of the last access, status change, or modification. Should work on all platforms.
Also included is [file_type] object which is written in Pd and uses [stat]. It tells you what kind of file something is (file, folder, character, block, fifo, etc).
Of course, it'll be in the next Pd-extended test release.
.hc
--
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
PD-announce mailing list PD-announce@iem.at http://lists.puredata.info/listinfo/pd-announce
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
I have the audacity to believe that peoples everywhere can have three
meals a day for their bodies, education and culture for their minds,
and dignity, equality and freedom for their spirits. - Martin
Luther King, Jr.
On Jun 14, 2006, at 8:27 AM, chris clepper wrote:
Is there a way to get a random file of a certain type (like .mov)
from a specific directory using your objects?
...why don't you use playlist from unauthorized? It's included in pd- extended: just remember that it's referenced as "unauthorized/ playlist"...so, you'd want to try something like:
[location /path/to/mov/directory< | [nmbr] | | | [seek $1< |/ [unauthorized/playlist mov 200 200]
...[seek < lets you cycle thru name list (with auto wraparound!), so
just send a random number to it...
jamie
playlist leaks memory each time you seek and I could not figure out where.
On 6/14/06, james tittle tigital@mac.com wrote:
On Jun 14, 2006, at 8:27 AM, chris clepper wrote:
Is there a way to get a random file of a certain type (like .mov) from a specific directory using your objects?
...why don't you use playlist from unauthorized? It's included in pd- extended: just remember that it's referenced as "unauthorized/ playlist"...so, you'd want to try something like:
[location /path/to/mov/directory< | [nmbr] | | | [seek $1< |/ [unauthorized/playlist mov 200 200]
...[seek < lets you cycle thru name list (with auto wraparound!), so just send a random number to it...
jamie
On Wed, 2006-06-14 at 07:27 -0500, chris clepper wrote:
Is there a way to get a random file of a certain type (like .mov) from a specific directory using your objects?
would this python one-liner be an option for you?
import random, glob
def choose(path): return random.choice(glob.glob(path+"/*.mov"))
t
-- tim@klingt.org ICQ: 96771783 http://www.mokabar.tk
Life is really simple, but we insist on making it complicated. Confucius
On 6/14/06, Tim Blechmann TimBlechmann@gmx.net wrote:
On Wed, 2006-06-14 at 07:27 -0500, chris clepper wrote:
Is there a way to get a random file of a certain type (like .mov) from a specific directory using your objects?
would this python one-liner be an option for you?
import random, glob
def choose(path): return random.choice(glob.glob(path+"/*.mov"))
It would if I knew any python! I'll see if I can figure out how to get that working inside Pd and also how the script works (seems really simple).
Thanks cgc
Hallo, chris clepper hat gesagt: // chris clepper wrote:
It would if I knew any python! I'll see if I can figure out how to get that working inside Pd and also how the script works (seems really simple).
http://docs.python.org/tut/tut.html is wonderful for learning Python in about one afternoon for people, who already know a bit of programming. Others will need two or three afternoons. ;)
Frank Barknecht _ ______footils.org_ __goto10.org__