Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery matohawk@gmail.com wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.com mailto:matohawk@gmail.com> wrote:
Hi pd-list, test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity -- Matohawk alias Th-Th www.th-th.fr <http://www.th-th.fr> _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk matohawk@gmail.com wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.commailto: matohawk@gmail.com> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr
Pd-list@iem.at mailto:Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk matohawk@gmail.com wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.commailto: matohawk@gmail.com> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr
Pd-list@iem.at mailto:Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
Hi Pedro,
Yes that's my problem, the Float It's difficult to explain the purpose of my programm but I need to read a line in a textfile like -> float 0 0 0
But I can't because textfile makes a bir Error
Thanks for your help Thomas
Pedro Lopes a écrit :
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <pedro.lopes@ist.utl.pt mailto:pedro.lopes@ist.utl.pt> wrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately? 'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want. I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :) Best of luck, Pedro On Tue, Jun 29, 2010 at 11:36 PM, matohawk <matohawk@gmail.com <mailto:matohawk@gmail.com>> wrote: Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt Download the twho files, open the patch and click on bang Cheers, Thomas Pedro Lopes a écrit : I'm not following the "concept" behind your code. Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly. [read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list] And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :) Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer. On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.com <mailto:matohawk@gmail.com> <mailto:matohawk@gmail.com <mailto:matohawk@gmail.com>>> wrote: Hi pd-list, test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity -- Matohawk alias Th-Th www.th-th.fr <http://www.th-th.fr> <http://www.th-th.fr> _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> <mailto:Pd-list@iem.at <mailto:Pd-list@iem.at>> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> <mailto:jazz@radiozero.pt <mailto:jazz@radiozero.pt>> website: http://web.ist.utl.pt/Pedro.Lopes _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
I'm looking at the C code, it should be something with outputing the "float", because when it receives the message "print", the textfile element shows its debugging data and the whole message is there "float bla bla". Well honestly, the only thing the debug method does is print the buffer, so it is obvious "it's there".
a more in-depth look, showed this...
//code from > externals/vanilla > from the band method of the external { x->x_onset = onset2; if (ap->a_type == A_SYMBOL) outlet_anything(x->x_ob.ob_outlet, ap->a_w.w_symbol, onset2-onset-1, ap+1); else outlet_list(x->x_ob.ob_outlet, 0, onset2-onset, ap); } else { x->x_onset = 0x7fffffff; outlet_bang(x->x_bangout); } //end of code
This seems that it only adds "stuff" to the list, when a A_SYMBOL is found? Or am I not getting this straight? If its true, then the issue could be this... because according to [1] A_SYMBOL is not A_FLOAT (this sounds philosophical..=P).
Best regards, Pedro
[1] http://iem.kug.ac.at/pd/externals-HOWTO/node7.html
I guess my help won't fix this :)
On Tue, Jun 29, 2010 at 11:49 PM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk matohawk@gmail.com wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.commailto: matohawk@gmail.com> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr
Pd-list@iem.at mailto:Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
p.s.: I'm not understanding this line of code completely:
p.p.s: definitely someone with more know-how of this object's internal workings could be of service for you matohawk :)
On Wed, Jun 30, 2010 at 12:00 AM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
I'm looking at the C code, it should be something with outputing the "float", because when it receives the message "print", the textfile element shows its debugging data and the whole message is there "float bla bla". Well honestly, the only thing the debug method does is print the buffer, so it is obvious "it's there".
a more in-depth look, showed this...
//code from > externals/vanilla > from the band method of the external { x->x_onset = onset2; if (ap->a_type == A_SYMBOL) outlet_anything(x->x_ob.ob_outlet, ap->a_w.w_symbol, onset2-onset-1, ap+1); else outlet_list(x->x_ob.ob_outlet, 0, onset2-onset, ap); } else { x->x_onset = 0x7fffffff; outlet_bang(x->x_bangout); } //end of code
This seems that it only adds "stuff" to the list, when a A_SYMBOL is found? Or am I not getting this straight? If its true, then the issue could be this... because according to [1] A_SYMBOL is not A_FLOAT (this sounds philosophical..=P).
Best regards, Pedro
[1] http://iem.kug.ac.at/pd/externals-HOWTO/node7.html
I guess my help won't fix this :)
On Tue, Jun 29, 2010 at 11:49 PM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk matohawk@gmail.com wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.commailto: matohawk@gmail.com> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr
Pd-list@iem.at mailto:Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
Thanks Pedro, If someone know about this and how to fix this
Have a look of this patch and textfile, it's better to understand the problem (see pd console): http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Thomas
Pedro Lopes a écrit :
p.s.: I'm not understanding this line of code completely:
- "else outlet_list(x->x_ob.ob_outlet, 0, onset2-onset, ap);" (line 136)
p.p.s: definitely someone with more know-how of this object's internal workings could be of service for you matohawk :)
On Wed, Jun 30, 2010 at 12:00 AM, Pedro Lopes <pedro.lopes@ist.utl.pt mailto:pedro.lopes@ist.utl.pt> wrote:
I'm looking at the C code, it should be something with outputing the "float", because when it receives the message "print", the textfile element shows its debugging data and the whole message is there "float bla bla". Well honestly, the only thing the debug method does is print the buffer, so it is obvious "it's there". a more in-depth look, showed this... //code from > externals/vanilla > from the band method of the external { x->x_onset = onset2; if (ap->a_type == A_SYMBOL) outlet_anything(x->x_ob.ob_outlet, ap->a_w.w_symbol, onset2-onset-1, ap+1); else outlet_list(x->x_ob.ob_outlet, 0, onset2-onset, ap); } else { x->x_onset = 0x7fffffff; outlet_bang(x->x_bangout); } //end of code This seems that it only adds "stuff" to the list, when a A_SYMBOL is found? Or am I not getting this straight? If its true, then the issue could be this... because according to [1] A_SYMBOL is not A_FLOAT (this sounds philosophical..=P). Best regards, Pedro [1] http://iem.kug.ac.at/pd/externals-HOWTO/node7.html I guess my help won't fix this :) On Tue, Jun 29, 2010 at 11:49 PM, Pedro Lopes <pedro.lopes@ist.utl.pt <mailto:pedro.lopes@ist.utl.pt>> wrote: humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that. On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <pedro.lopes@ist.utl.pt <mailto:pedro.lopes@ist.utl.pt>> wrote: I did that, but what are you expecting your patch to do? Should it send each object read from text file separately? 'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want. I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :) Best of luck, Pedro On Tue, Jun 29, 2010 at 11:36 PM, matohawk <matohawk@gmail.com <mailto:matohawk@gmail.com>> wrote: Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt Download the twho files, open the patch and click on bang Cheers, Thomas Pedro Lopes a écrit : I'm not following the "concept" behind your code. Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly. [read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list] And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :) Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer. On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.com <mailto:matohawk@gmail.com> <mailto:matohawk@gmail.com <mailto:matohawk@gmail.com>>> wrote: Hi pd-list, test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity -- Matohawk alias Th-Th www.th-th.fr <http://www.th-th.fr> <http://www.th-th.fr> _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> <mailto:Pd-list@iem.at <mailto:Pd-list@iem.at>> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> <mailto:jazz@radiozero.pt <mailto:jazz@radiozero.pt>> website: http://web.ist.utl.pt/Pedro.Lopes _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> website: http://web.ist.utl.pt/Pedro.Lopes -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> website: http://web.ist.utl.pt/Pedro.Lopes -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any message that has the "float" selector to have one argument, and that argument should be a float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float" selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."
In your example patch, if you disconnect all the objects from the outlet of [textfile] and click the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error.
(On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be the right type of atom, so Pd would just silently truncate everything after the first argument. But you'd still get an error from the right inlet of [select float] because, ironically, by making the first argument of [select] the word "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol messages and not floats.)
As far as a solution, you could begin each line of your text file with the selector "list", or a word that is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure what the best solution is.
-Jonathan
From: Pedro Lopes pedro.lopes@ist.utl.pt To: matohawk matohawk@gmail.com Cc: pd-list Pd-list@iem.at Sent: Tue, June 29, 2010 6:49:44 PM Subject: Re: [PD] Problem with Textfile and line with float
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes pedro.lopes@ist.utl.pt wrote:
I did that, but what are you expecting your patch to do?
Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk matohawk@gmail.com wrote:
Hi Pedro,
Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.com mailto:matohawk@gmail.com> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr
_______________________________________________ Pd-list@iem.at mailto:Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Not trying to hijack this thread into a different subject, I was messing with the external in order to understand how it works. I got my mods on, compiled it, all ok.
But how can I load it? pdextended always load a default "filetext", I even started with the -nostdpath but no luck. It doesn't load mine. I'm launching pd from the same dir as the filetext.pd_linux... What's the correct way to test externals in these conditions..?
Some help?
Best regards to all, Pedro p.s. also tryed >pdextended -path textfile.pd_linux (nothin'..)
On Wed, Jun 30, 2010 at 12:24 AM, Jonathan Wilkes jancsika@yahoo.comwrote:
The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any message that has the "float" selector to have one argument, and that argument should be a float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float" selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."
In your example patch, if you disconnect all the objects from the outlet of [textfile] and click the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error.
(On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be the right type of atom, so Pd would just silently truncate everything after the first argument. But you'd still get an error from the
right inlet of [select float] because, ironically, by making the first argument of [select] the word "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol messages and not floats.)
As far as a solution, you could begin each line of your text file with the selector "list", or a word that is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure what the best solution is.
-Jonathan
*From:* Pedro Lopes pedro.lopes@ist.utl.pt *To:* matohawk matohawk@gmail.com *Cc:* pd-list Pd-list@iem.at *Sent:* Tue, June 29, 2010 6:49:44 PM *Subject:* Re: [PD] Problem with Textfile and line with float
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk matohawk@gmail.com wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.commailto: matohawk@gmail.com> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr
Pd-list@iem.at mailto:Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
I could rephrase my question into a more generic one:
externals and load them for experiments?
*(because there all vannila objects)
On Wed, Jun 30, 2010 at 12:47 AM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
Not trying to hijack this thread into a different subject, I was messing with the external in order to understand how it works. I got my mods on, compiled it, all ok.
But how can I load it? pdextended always load a default "filetext", I even started with the -nostdpath but no luck. It doesn't load mine. I'm launching pd from the same dir as the filetext.pd_linux... What's the correct way to test externals in these conditions..?
Some help?
Best regards to all, Pedro p.s. also tryed >pdextended -path textfile.pd_linux (nothin'..)
On Wed, Jun 30, 2010 at 12:24 AM, Jonathan Wilkes jancsika@yahoo.comwrote:
The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any message that has the "float" selector to have one argument, and that argument should be a float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float" selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."
In your example patch, if you disconnect all the objects from the outlet of [textfile] and click the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error.
(On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be the right type of atom, so Pd would just silently truncate everything after the first argument. But you'd still get an error from the right inlet of [select float] because, ironically, by making the first argument of [select] the word "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol messages and not floats.)
As far as a solution, you could begin each line of your text file with the selector "list", or a word that is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure what the best solution is.
-Jonathan
*From:* Pedro Lopes pedro.lopes@ist.utl.pt *To:* matohawk matohawk@gmail.com *Cc:* pd-list Pd-list@iem.at *Sent:* Tue, June 29, 2010 6:49:44 PM *Subject:* Re: [PD] Problem with Textfile and line with float
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes pedro.lopes@ist.utl.ptwrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk matohawk@gmail.com wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.commailto: matohawk@gmail.com> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr
Pd-list@iem.at mailto:Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt
website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
Hi Jonathan,
Yes I know textfile "works" but I can't put any kind of object behind this Texfile.
I'll try all list object and this the same problem. Look this : http://www.th-th.fr/DOCS/Patch/bug-texfile.pd
I need to read this line with float at the begining but I can't. So I think we will take a script to do this because textfile can't do this.
Thanks for your help Thomas
Jonathan Wilkes a écrit :
The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any message that has the "float" selector to have one argument, and that argument should be a float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float" selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."
In your example patch, if you disconnect all the objects from the outlet of [textfile] and click the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error.
(On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be the right type of atom, so Pd would just silently truncate everything after the first argument. But you'd still get an error from the right inlet of [select float] because, ironically, by making the first argument of [select] the word "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol messages and not floats.)
As far as a solution, you could begin each line of your text file with the selector "list", or a word that is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure what the best solution is.
-Jonathan
*From:* Pedro Lopes pedro.lopes@ist.utl.pt *To:* matohawk matohawk@gmail.com *Cc:* pd-list Pd-list@iem.at *Sent:* Tue, June 29, 2010 6:49:44 PM *Subject:* Re: [PD] Problem with Textfile and line with float
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <pedro.lopes@ist.utl.pt mailto:pedro.lopes@ist.utl.pt> wrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately? 'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want. I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :) Best of luck, Pedro On Tue, Jun 29, 2010 at 11:36 PM, matohawk <matohawk@gmail.com <mailto:matohawk@gmail.com>> wrote: Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt Download the twho files, open the patch and click on bang Cheers, Thomas Pedro Lopes a écrit : I'm not following the "concept" behind your code. Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly. [read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list] And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :) Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer. On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.com <mailto:matohawk@gmail.com> <mailto:matohawk@gmail.com <mailto:matohawk@gmail.com>>> wrote: Hi pd-list, test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity -- Matohawk alias Th-Th www.th-th.fr <http://www.th-th.fr/> <http://www.th-th.fr> _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> <mailto:Pd-list@iem.at <mailto:Pd-list@iem.at>> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> <mailto:jazz@radiozero.pt <mailto:jazz@radiozero.pt>> website: http://web.ist.utl.pt/Pedro.Lopes _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
One way to do it is to change the order:
toto float 0 1 2
This way "float" is treated as a symbol.
On 06/30/2010 09:58 AM, matohawk wrote:
Hi Jonathan,
Yes I know textfile "works" but I can't put any kind of object behind this Texfile.
I'll try all list object and this the same problem. Look this : http://www.th-th.fr/DOCS/Patch/bug-texfile.pd
I need to read this line with float at the begining but I can't. So I think we will take a script to do this because textfile can't do this.
Thanks for your help Thomas
Jonathan Wilkes a écrit :
The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any message that has the "float" selector to have one argument, and that argument should be a float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float" selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."
In your example patch, if you disconnect all the objects from the outlet of [textfile] and click the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error.
(On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be the right type of atom, so Pd would just silently truncate everything after the first argument. But you'd still get an error from the right inlet of [select float] because, ironically, by making the first argument of [select] the word "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol messages and not floats.)
As far as a solution, you could begin each line of your text file with the selector "list", or a word that is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure what the best solution is.
-Jonathan
*From:* Pedro Lopes pedro.lopes@ist.utl.pt *To:* matohawk matohawk@gmail.com *Cc:* pd-list Pd-list@iem.at *Sent:* Tue, June 29, 2010 6:49:44 PM *Subject:* Re: [PD] Problem with Textfile and line with float
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <pedro.lopes@ist.utl.pt mailto:pedro.lopes@ist.utl.pt> wrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately? 'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what
you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :) Best of luck, Pedro On Tue, Jun 29, 2010 at 11:36 PM, matohawk <matohawk@gmail.com
mailto:matohawk@gmail.com> wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt Download the twho files, open the patch and click on bang Cheers, Thomas Pedro Lopes a écrit : I'm not following the "concept" behind your code. Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly. [read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list] And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :) Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer. On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery
<matohawk@gmail.com mailto:matohawk@gmail.com <mailto:matohawk@gmail.com mailto:matohawk@gmail.com>> wrote:
Hi pd-list, test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't
do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr <http://www.th-th.fr/> <http://www.th-th.fr> _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at>
<mailto:Pd-list@iem.at mailto:Pd-list@iem.at> mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt>
<mailto:jazz@radiozero.pt mailto:jazz@radiozero.pt>
website: http://web.ist.utl.pt/Pedro.Lopes _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi, Yes I know but the order it's important because this is a backup of a data structures Score. So I can't change the order.
Thomas
ailo a écrit :
One way to do it is to change the order:
toto float 0 1 2
This way "float" is treated as a symbol.
On 06/30/2010 09:58 AM, matohawk wrote:
Hi Jonathan,
Yes I know textfile "works" but I can't put any kind of object behind this Texfile.
I'll try all list object and this the same problem. Look this : http://www.th-th.fr/DOCS/Patch/bug-texfile.pd
I need to read this line with float at the begining but I can't. So I think we will take a script to do this because textfile can't do this.
Thanks for your help Thomas
Jonathan Wilkes a écrit :
The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any message that has the "float" selector to have one argument, and that argument should be a float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float" selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo."
In your example patch, if you disconnect all the objects from the outlet of [textfile] and click the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error.
(On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be the right type of atom, so Pd would just silently truncate everything after the first argument. But you'd still get an error from the right inlet of [select float] because, ironically, by making the first argument of [select] the word "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol messages and not floats.)
As far as a solution, you could begin each line of your text file with the selector "list", or a word that is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure what the best solution is.
-Jonathan
*From:* Pedro Lopes pedro.lopes@ist.utl.pt *To:* matohawk matohawk@gmail.com *Cc:* pd-list Pd-list@iem.at *Sent:* Tue, June 29, 2010 6:49:44 PM *Subject:* Re: [PD] Problem with Textfile and line with float
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <pedro.lopes@ist.utl.pt mailto:pedro.lopes@ist.utl.pt> wrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately? 'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what
you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :) Best of luck, Pedro On Tue, Jun 29, 2010 at 11:36 PM, matohawk <matohawk@gmail.com
mailto:matohawk@gmail.com> wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt Download the twho files, open the patch and click on bang Cheers, Thomas Pedro Lopes a écrit : I'm not following the "concept" behind your code. Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly. [read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list] And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :) Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer. On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery
<matohawk@gmail.com mailto:matohawk@gmail.com <mailto:matohawk@gmail.com mailto:matohawk@gmail.com>> wrote:
Hi pd-list, test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't
do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr <http://www.th-th.fr/> <http://www.th-th.fr> _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at>
<mailto:Pd-list@iem.at mailto:Pd-list@iem.at> mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt>
<mailto:jazz@radiozero.pt mailto:jazz@radiozero.pt>
website: http://web.ist.utl.pt/Pedro.Lopes _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list -- Pedro Lopes contacto: jazz@radiozero.pt <mailto:jazz@radiozero.pt> website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 2010-06-30 10:27, matohawk wrote:
Hi, Yes I know but the order it's important because this is a backup of a data structures Score. So I can't change the order.
in this case i would use something like: $ sed -e 's|float|Float|g' scorefile.txt > newscorefile.txt and use the newscorefile.txt instead of the original one.
(of course you might want to refine the sed-expression, e.g. use 's|^float |Float |' or 's|<float>|Float|g')
it's a limitation in Pd's parser and you currently just should not use the symbol "float" as anything else but a selector for numbers.
fgmasdr IOhannes
Ok I understand, It's a pity We will try to do something else, no problem
IOhannes m zmoelnig a écrit :
On 2010-06-30 10:27, matohawk wrote:
Hi, Yes I know but the order it's important because this is a backup of a data structures Score. So I can't change the order.
in this case i would use something like: $ sed -e 's|float|Float|g' scorefile.txt > newscorefile.txt and use the newscorefile.txt instead of the original one.
(of course you might want to refine the sed-expression, e.g. use 's|^float |Float |' or 's|<float>|Float|g')
it's a limitation in Pd's parser and you currently just should not use the symbol "float" as anything else but a selector for numbers.
fgmasdr IOhannes
None of the [list] objects will work either, for the reasons I wrote below. For an example of what I'm saying, open text-float.txt, add the word "list" at the beginning and save it. Then you will see that your patch works.
If anyone knows of an external that works like [textfile] but outputs each line as a list, that would solve your problem.
-Jonathan
From: matohawk matohawk@gmail.com Cc: pd-list Pd-list@iem.at Sent: Wed, June 30, 2010 3:58:56 AM Subject: Re: [PD] Problem with Textfile and line with float
Hi Jonathan,
Yes I know textfile "works" but I can't put any kind of object behind this Texfile.
I'll try all list object and this the same problem. Look this : http://www.th-th.fr/DOCS/Patch/bug-texfile.pd
I need to read this line with float at the begining but I can't. So I think we will take a script to do this because textfile can't do this.
Thanks for your help Thomas
Jonathan Wilkes a écrit :
The problem occurs because Pd has several built-in message types, and the float message is one of them. Pd expects any message that has the "float" selector to have one argument, and that argument should be a float-atom (e.g., "float 1"). So if you type "float foo" in a message box and click it, Pd complains about "bad arguments" because (I think) when the message box tries to parse the message, it sees the "float" selector and thus expects a number for the argument, but instead it gets the symbolic-atom "foo." In your example patch, if you disconnect all the objects from the outlet of [textfile] and click the [bng], you'll notice that you don't get an error. I would take this to mean that [textfile] does its job-- its just that once you try to do anything with the message "float toto 0 1 2" by connecting [textfile]'s outlet to another object, Pd will catch the badly formed message and report an error. (On the other hand, if your example text file had the line "float 3 0 1 2," the first argument ("3") would be the right type of atom, so Pd would just silently truncate everything after the first argument. But you'd still get an error from the right inlet of [select float] because, ironically, by making the first argument of [select] the word "float" instead of a float-atom like "3," you are instantiating a [select] object that expects symbol messages and not floats.) As far as a solution, you could begin each line of your text file with the selector "list", or a word that is not the selector of Pd's builtin messages. If you're reading in arbitrary data and you can't control whether each line starts with something that could be confused for a built-in Pd message type, I'm not sure what the best solution is. -Jonathan
*From:* Pedro Lopes pedro.lopes@ist.utl.pt *To:* matohawk matohawk@gmail.com *Cc:* pd-list Pd-list@iem.at *Sent:* Tue, June 29, 2010 6:49:44 PM *Subject:* Re: [PD] Problem with Textfile and line with float
humm.. I see what you mean now. It gives a error with the float argument when it arrives at the objects after the textfile. I'm trying to figure out the reason for that.
On Tue, Jun 29, 2010 at 11:42 PM, Pedro Lopes <pedro.lopes@ist.utl.pt mailto:pedro.lopes@ist.utl.pt> wrote:
I did that, but what are you expecting your patch to do? Should it send each object read from text file separately?
'Cause here (with the patch I explain in my previous reply) the textfile reads your file and outputs all the values to a [print list] so then its just a matter of manipulating that into what you want.
I used your file for the tests. I can try to look and guess what do you intend, but its probably less ambiguous if you explain the purpose. :)
Best of luck, Pedro
On Tue, Jun 29, 2010 at 11:36 PM, matohawk <matohawk@gmail.com mailto:matohawk@gmail.com> wrote:
Hi Pedro, Sorry I think I'm not very with explanation. I know how textfile works it's not my problem Have a look of this patch and textfile, it's better to understand the problem: http://www.th-th.fr/DOCS/Patch/bug-texfile.pd http://www.th-th.fr/DOCS/Patch/text-float.txt
Download the twho files, open the patch and click on bang
Cheers, Thomas
Pedro Lopes a écrit :
I'm not following the "concept" behind your code.
Notice that you can connect a message box "print" and send that command to textfile. And it reads your file to the pd shell correctly.
[read your-file.txt] | [print( <-- this is a message | / |/ | [bang] <-- hit this to read,. | / |/ [textfile] | | [print list]
And it works. Take a look at the help file, it shows hot to use it. I hope I'm understanding your issue, if not, hopefully someone does :)
Best of luck, Pedro p.s: remember to use the "rewind" message to textfile, because otherwise it doesn't read the line again! Because it moves forward with the seek file pointer.
On Tue, Jun 29, 2010 at 10:37 PM, thomas thiery <matohawk@gmail.com mailto:matohawk@gmail.com <mailto:matohawk@gmail.com mailto:matohawk@gmail.com>> wrote:
Hi pd-list,
test this patch, I saw a curious problem. I need to read line with "float" at the begining of a line and textfile can't do this. It's a pity
-- Matohawk alias Th-Th www.th-th.fr http://www.th-th.fr/ http://www.th-th.fr
_______________________________________________ Pd-list@iem.at mailto:Pd-list@iem.at <mailto:Pd-list@iem.at mailto:Pd-list@iem.at> mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt <mailto:jazz@radiozero.pt mailto:jazz@radiozero.pt>
website: http://web.ist.utl.pt/Pedro.Lopes
_______________________________________________ Pd-list@iem.at mailto:Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
-- Pedro Lopes contacto: jazz@radiozero.pt mailto:jazz@radiozero.pt website: http://web.ist.utl.pt/Pedro.Lopes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
You can also see what Chris McCormick's s-abstractions can do for you. I use s-map to handle big 'tables' (many rows of long lists they are). It doesn't need 'list' at the beginning of the lines :)
Andras
On Wed, Jun 30, 2010 at 7:17 PM, Jonathan Wilkes jancsika@yahoo.com wrote:
None of the [list] objects will work either, for the reasons I wrote below. For an example of what I'm saying, open text-float.txt, add the word "list" at the beginning and save it. Then you will see that your patch works.
If anyone knows of an external that works like [textfile] but outputs each line as a list, that would solve your problem.
-Jonathan
*From:* matohawk matohawk@gmail.com *Cc:* pd-list Pd-list@iem.at *Sent:* Wed, June 30, 2010 3:58:56 AM *Subject:* Re: [PD] Problem with Textfile and line with float
Hi Jonathan,
Yes I know textfile "works" but I can't put any kind of object behind this Texfile.
I'll try all list object and this the same problem. Look this : http://www.th-th.fr/DOCS/Patch/bug-texfile.pd
I need to read this line with float at the begining but I can't. So I think we will take a script to do this because textfile can't do this.
Thanks for your help Thomas
From: András Murányi muranyia@gmail.com To: PD List pd-list@iem.at Sent: Wed, June 30, 2010 2:25:04 PM Subject: Re: [PD] Problem with Textfile and line with float
You can also see what Chris McCormick's s-abstractions can do for you. I use s-map to handle big 'tables' (many rows of long lists they are). It doesn't need 'list' at the beginning of the lines :)
Andras
The [textfile] object, which is used inside [s-map], doesn't need 'list' at the beginning of the lines, either. However, once [textfile] outputs a message that looks like ill-formed to Pd, you'll get an error and won't be able to do anything with the data. (Try reading text-float.txt from the original post with [s-map] and sending it a "find x" message-- you'll get the error originally mentioned in this thread.)
Since it's impossible to know whether an arbitrary text file will generate ill-formed messages when output by [textfile], it'd be useful if there were an object that could output each line of a text file as a list (or maybe there already is an external that does this?). "float foo 1 2 3" in text file -> "list float foo 1 2 3" in Pd "symbol foo" in text file -> "list symbol foo" in Pd "list" -> "list list" "bang" -> "list bang" etc.
Then something like [s-map] could take a list output by such an object and use [list split 1] to get at the first element of the data without any error.
(I was about to try screwing around with the code of [textfile] to see if I could achieve this with my [lack of] c skills, but my linux box just died.)
-Jonathan
(I was about to try screwing around with the code of [textfile] to see if
I could achieve this >with my [lack of] c skills, but my linux box just died.) I was trying too, but couldn't figure out how to make pd load my modified textfile.pd_linux instead of the default one.. any hints? (I tried with--nostdpath and --path "file")
2010/7/1 Jonathan Wilkes jancsika@yahoo.com
(I was about to try screwing around with the code of [textfile] to see if I could achieve this with my [lack of] c skills, but my linux box just died.)
I'm not sure about that. I just compiled Miller's version, commented out some lines in x_qlist.c so that [textfile] always outputs a list, then recompiled. And hey, it worked! But it's pretty simple-minded, and I didn't get a chance to test if I broke something by doing that.
-Jonathan
From: Pedro Lopes pedro.lopes@ist.utl.pt To: Jonathan Wilkes jancsika@yahoo.com Cc: András Murányi muranyia@gmail.com; PD List pd-list@iem.at Sent: Wed, June 30, 2010 11:13:49 PM Subject: Re: [PD] Problem with Textfile and line with float
(I was about to try screwing around with the code of [textfile] to see if I could achieve this >with my [lack of] c skills, but my linux box just died.)
I was trying too, but couldn't figure out how to make pd load my modified textfile.pd_linux instead of the default one.. any hints? (I tried with--nostdpath and --path "file")
2010/7/1 Jonathan Wilkes jancsika@yahoo.com
(I was about to try screwing around with the code of [textfile] to see if I could achieve this with my [lack of] c skills, but my linux box just died.)
On 2010-07-01 05:13, Pedro Lopes wrote:
(I was about to try screwing around with the code of [textfile] to see if
I could achieve this >with my [lack of] c skills, but my linux box just died.) I was trying too, but couldn't figure out how to make pd load my modified textfile.pd_linux instead of the default one.. any hints? (I tried with--nostdpath and --path "file")
for one thing, Pd only uses a single dash for flags, so "-nostdpath" would be better. the other thing is, that the "stdpath" is only about the .../extra path (the standard path (hence the name) to install addons to, like expr~ or anything else). built-ins have nothing todo with the standard path, as they are not looked for in a certain path but are built into (hence the name) Pd.
anyhow, you can overwrite a built-in (with a recent-enough Pd-version (0.42; PdX-0.42 might not do) by just making sure that a library gets loaded which then registers an objectclass with e.g. "textfile" as the name. suppose your textfile.pd_linux provides this, you just tell Pd to load exactly this file: $ pd -lib textfile should do the trick. if it does not, try something like $ pd -lib /full/path/to/my/textfile
you can even force the loading from within a running Pd (e.g. because you forgot to specify the "-lib" flag) normally it would be enough to create an object, e.g. [tuxfile] to make Pd look for tuxfile.pd_linux in (e.g.) extra/; this obviously doesn't work with [textfile] because Pd already knows what to do when asked for a [ŧextfile]. but you can use [../my/textfile] (supposed that textfile.pd_linux is in a subdirectory "my" and you started Pd from there (or have added there to your searchpaths)), to make Pd look again for a binary and eventually load it: the loading will then magically override your object.
the confusion with "path" and "lib" probably comes from the fact that PdX treats adding search-paths as equivalent to load libraries
fgm,asdr IOhannes