Hi,
well, it's not an error: I used that to output two values per line in my text file (here these values are the same, for the example, in the attachment, the second is multiplied by 2, anyway it doesn't matter for now). These values must be outputted at the same time, so no trigger is needed here.
Anyway, yestarday evening I found a solution that satisfies me. For who is interested, here is what I did:
In fact, adding values in the [textfile] is done before writing the [textfile] contents into the real text file, using a trigger as below:
[bang]
|
[savepanel]
|
[t a b]
/ |
[write $1( [metro 10]
| |
[textfile] [counter]
| | cables: come from the same outlet of [counter]
[pack f f]
|
[add $1 $2(
|
[textfile]
The problem is that [trigger] sends signals sequentially but with no delay. So the write message is sent after 0 second, when the only first data has been generated by the metronome. So we need a delay before the trigger sends the write message. This can be achieved using the [pipe] object between the trigger and the message:
[t a b]
/ |
[pipe s 2000] generating data as above
|
[write $1(
|
[textfile]
Now, the datas are saved after 2000 ms on the text file. The datas generated after these 2 seconds are lost. This becomes a pseudo-realtime saving because the data flow is recorded in realtime but only saved at a precise moment.
I join the Pd file corrected.
Next step is to replace the [pipe] object by something that sends the message when the metronome is stopped. If anyone manages this, I'm interested.
Anyway, thank you hardoff for worrying about our issues, you do help!
Mizu
http://www.pdpatchrepo.info/hurleur/using-textfile-corrected.pd