How do I select an item from a list (of filenames). I'd like to give the argument as a line number, i.e. sending it 45 would return the filename on line 45 of the txt file.
-
-
Check the [zl nth] - part of cyclone library. Other then that, you can write the components of the list into an array by using [tabwrite], and call them with index number using [tabread] object. If you are trying to call lists, i.e. the item 45 is a list contains many things at once, [coll] object is another alternative. Check the help files..
-
[playlist] will do what you are looking for.
puredata punx http://www.cyberpunki.biz
-
pd extended easy way:
[goto 45, bang(
|
[msgfile]pd vanilla way:
load the .txt into [textfile], bang [textfile] until it reaches the end of the file, write the output of [textfile] into a
object, and then:
|
will give you the 45th item -
Wow, I was not aware of all the list objects. I think some of my ugly patches will get a bit more elegant now.
-
yeah. i held off on using them when they were first introduced (i'm a bit neophobic or whatever "fear of new, untested things" is called), but they are essential now for sure.