Hi all
I want to use [textfile] without an external textfile. This is what I came up with. Is it working on Linux/OSX? Comments/feedback will be appreciated
o-o
#N canvas 645 128 258 440 12; #X obj 3 -13 cnv 15 235 415 empty empty empty 20 12 0 14 -237175 -66577 0; #X obj 31 93 hsl 161 93 0 127 0 0 empty empty empty -2 -8 0 10 -237121 -261681 -1 4157 1; #X obj 22 7 bng 53 123 50 0 empty empty empty 17 7 0 10 -260818 -24198 -1; #N canvas 314 85 828 487 rec 0; #X obj 233 60 cnv 15 253 345 empty empty empty 20 12 0 14 -261689 -66577 0; #X obj 164 190 timer; #X obj 75 214 list prepend; #X obj 75 284 list prepend add; #X obj 75 314 list trim; #X obj 271 334 textfile; #X obj 274 155 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 0 1; #X obj 271 118 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 75 170 t f b b; #X msg 271 230 print; #X obj 75 244 list prepend data; #X msg 271 77 read embed_Data.pd; #X msg 271 270 write embed_Data.pd; #X text 122 23 To record , first save the patch to erase my data. ; #X text 470 77 1 Read file into [textfile]; #X text 471 117 2 Reset [timer]; #X text 470 154 3 Record fader movements; #X text 471 190 4 Ad autostart when patch is loaded; #X text 470 230 5 Just tjekking; #X text 469 270 6 Save recorded data; #X text 279 421 7 If all is OK , patch will play data when reloaded ; #X msg 271 190 add start rewind , bang; #X connect 1 0 2 1; #X connect 2 0 10 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 6 0 8 0; #X connect 7 0 1 0; #X connect 8 0 2 0; #X connect 8 1 1 0; #X connect 8 2 1 1; #X connect 9 0 5 0; #X connect 10 0 3 0; #X connect 11 0 5 0; #X connect 12 0 5 0; #X connect 21 0 5 0; #X restore 43 236 pd rec; #N canvas 0 0 575 505 play 0; #X obj 155 98 list prepend add; #X obj 155 128 list trim; #X obj 155 163 textfile; #X obj 63 143 r feed; #X obj 105 423 s feed; #X obj 105 397 del; #X obj 105 348 t b f; #X obj 155 282 unpack; #X obj 140 373 * 1; #X obj 72 29 r data; #X obj 198 309 outlet; #X obj 314 120 inlet; #X msg 314 143 rewind , bang; #X obj 63 114 r start; #X obj 397 78 loadbang; #X obj 397 103 del 500; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 7 0; #X connect 3 0 2 0; #X connect 5 0 4 0; #X connect 6 0 5 0; #X connect 6 1 8 0; #X connect 7 0 6 0; #X connect 7 1 10 0; #X connect 8 0 5 1; #X connect 9 0 0 0; #X connect 11 0 12 0; #X connect 12 0 2 0; #X connect 13 0 2 0; #X connect 14 0 15 0; #X connect 15 0 12 0; #X coords 0 -1 1 1 13 14 2 100 100; #X restore 28 65 pd play; #X text 30 22 play; #X connect 2 0 4 0; #X connect 4 0 1 0; data 1250 0; data 163.333 3; data 21.3333 5; data 21.3333 8; data 20 29; data 20 39; data 20.6667 56; data 20 63; data 20.6667 76; data 20.6667 82; data 20 95; data 20 98; data 21.3333 105; data 20 106; data 20 110; data 21.3333 111; data 20 113; data 20 114; data 21.3333 115; data 165.333 113; data 24 112; data 22 106; data 21.3333 103; data 18 98; data 24 95; data 16.6667 93; data 31.3333 90; data 18 88; data 24 86; data 21.3333 79; data 20 76; data 20 66; data 21.3333 63; data 20 56; data 20 52; data 20.6667 41; data 20.6667 37; data 20 32; data 20.6667 29; data 20 26; data 40 25; data 102.667 26; data 21.3333 28; data 20 35; data 20 39; data 20.6667 53; data 20.6667 56; data 20 65; data 20.6667 69; data 20 80; data 21.3333 84; data 20 88; data 20 90; data 18 92; data 24 93; data 21.3333 96; data 20 97; data 20 101; data 21.3333 103; data 20 105; data 20 106; data 20.6667 109; data 20.6667 110; data 22 112; data 20.6667 114; data 22 115; data 41.3333 117; data 22 119; data 21.3333 121; data 20.6667 122; data 20.6667 123; data 40 124; data 40.6667 126; data 41.3333 127; start rewind , bang;
No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.4/475 - Release Date: 13-10-2006
Hallo, Steffen Leve Poulsen hat gesagt: // Steffen Leve Poulsen wrote:
I want to use [textfile] without an external textfile. This is what I came up with. Is it working on Linux/OSX? Comments/feedback will be appreciated
That's a creative exploitation of the pd file format, but too dangerous for my taste. You risk destroying your whole patch.
I would recommend to use message boxes if you want to save state into a patch. You can dump a message box's content into a [textfile] if you want to play it step by step.
Frank Barknecht _ ______footils.org_ __goto10.org__
At 19:21 14-10-2006, you wrote:
Hallo, Steffen Leve Poulsen hat gesagt: // Steffen Leve Poulsen wrote:
I want to use [textfile] without an external textfile. This is what I came up with. Is it working on Linux/OSX? Comments/feedback will be appreciated
That's a creative exploitation of the pd file format, but too dangerous for my taste. You risk destroying your whole patch.
OK tak I understand that. I need at least a 5MB pd-file. what is best?
Hej
Steffen
I would recommend to use message boxes if you want to save state into a patch. You can dump a message box's content into a [textfile] if you want to play it step by step.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list
Hallo, Steffen Leve Poulsen hat gesagt: // Steffen Leve Poulsen wrote:
At 19:21 14-10-2006, you wrote:
That's a creative exploitation of the pd file format, but too dangerous for my taste. You risk destroying your whole patch.
OK tak I understand that. I need at least a 5MB pd-file. what is best?
Hm, now I don't understand what you mean. ;(
Personally I prefer saving into a file outside of the patch so I can reuse the same patch for different "scores". A thing in the middle would be Pd's data structures, which an be exported to a file but also saved inside the patch.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Sat, 14 Oct 2006, Frank Barknecht wrote:
That's a creative exploitation of the pd file format, but too dangerous for my taste. You risk destroying your whole patch.
How many patches do you load without even checking whether they'd delete your home directory ?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Hallo, Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote:
On Sat, 14 Oct 2006, Frank Barknecht wrote:
That's a creative exploitation of the pd file format, but too dangerous for my taste. You risk destroying your whole patch.
How many patches do you load without even checking whether they'd delete your home directory ?
That's a danger of course. You can load unknown patches with "-noloadbang" and/or remove the "shell" external from your path as first measures. Of course this won't stop a really desperate attacker, so it's better to run unknown patches under a restricted accound (like doing a "sudo nobody" first)
However my comment regarding Steffen's patch was meant as a comment about the general principle he uses.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Sun, 15 Oct 2006, Frank Barknecht wrote:
That's a danger of course. You can load unknown patches with "-noloadbang" and/or remove the "shell" external from your path as first measures.
put this in file trojan.pd : #N canvas 0 0 0 0 0 0 10; #X obj 0 0 namecanvas self; self savetofile pd /usr/bin;
then "pd trojan.pd" will attempt to overwrite /usr/bin/pd, and so will "pd -noloadbang trojan.pd".
Of course this won't stop a really desperate attacker, so it's better to run unknown patches under a restricted accound (like doing a "sudo nobody" first)
yes
However my comment regarding Steffen's patch was meant as a comment about the general principle he uses.
i understand this.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Anyway,
I think it is a clever way to purely embed data in a patch... Not suitable for every purpose but indeed very clever.
++
Jé
Mathieu Bouchard a écrit :
On Sat, 14 Oct 2006, Frank Barknecht wrote:
That's a creative exploitation of the pd file format, but too dangerous for my taste. You risk destroying your whole patch.
How many patches do you load without even checking whether they'd delete your home directory ?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, Jerome Tuncer hat gesagt: // Jerome Tuncer wrote:
Anyway,
I think it is a clever way to purely embed data in a patch... Not suitable for every purpose but indeed very clever.
I disagree: It's not clever (or too clever), because it relies on Pd ignoring stuff in a patch that is not following the usual rules. It's exploiting something which could be considered a bug in Pd, and it will break, as soon as this "bug" is fixed.
Don't use this "solution".
Frank Barknecht _ ______footils.org_ __goto10.org__
Hallo,
I think I got why this is a bit tweaky : I didn't even know pd would ignore text lines not starting with the usual "#".
My enthousiasm came from the fact that I'd be glad some kind of data in-patch-embedding was availiable in pd (-:
++
Jé
Frank Barknecht a écrit :
Hallo, Jerome Tuncer hat gesagt: // Jerome Tuncer wrote:
Anyway,
I think it is a clever way to purely embed data in a patch... Not suitable for every purpose but indeed very clever.
I disagree: It's not clever (or too clever), because it relies on Pd ignoring stuff in a patch that is not following the usual rules. It's exploiting something which could be considered a bug in Pd, and it will break, as soon as this "bug" is fixed.
Don't use this "solution".
Ciao
hi all! At 18:02 15-10-2006, Jerom Tuncer wrote:
Hallo,
I think I got why this is a bit tweaky : I didn't even know pd would ignore text lines not starting with the usual "#".
But PD is not ignoring them. On the contrary lines omitting "#" will be transmitted to a [r ] that has the name of the beginning of the line. Thats how I discovered it. I was just pasting controldata after the #'lines in a txteditor, when I loaded the patch PD said: "no such receive". I guess I just considered it an undocumented feature, and found it very usefull. tjres Steffen
My enthousiasm came from the fact that I'd be glad some kind of data in-patch-embedding was availiable in pd (-:
++
Jé
Frank Barknecht a écrit :
Hallo, Jerome Tuncer hat gesagt: // Jerome Tuncer wrote:
Anyway,
I think it is a clever way to purely embed data in a patch... Not suitable for every purpose but indeed very clever.
I disagree: It's not clever (or too clever), because it relies on Pd ignoring stuff in a patch that is not following the usual rules. It's exploiting something which could be considered a bug in Pd, and it will break, as soon as this "bug" is fixed. Don't use this "solution". Ciao
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.4/475 - Release Date: 13-10-2006
-- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.4/475 - Release Date: 13-10-2006
Hallo, Steffen Leve Poulsen hat gesagt: // Steffen Leve Poulsen wrote:
But PD is not ignoring them. On the contrary lines omitting "#" will be transmitted to a [r ] that has the name of the beginning of the line. Thats how I discovered it. I was just pasting controldata after the #'lines in a txteditor, when I loaded the patch PD said: "no such receive". I guess I just considered it an undocumented feature, and found it very usefull.
This indeed is a (security) bug in Pd, IMO, especially as it allows another way to circumvent the -noloadbang "protection" against unwanted things.
Attached patch will print "data" received over the [r junk] receiver even if it is opened with -noloadbang.
Thankfully saving the patch from inside Pd will delete the junk at the end of the patch.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Sun, 15 Oct 2006, Steffen Leve Poulsen wrote:
But PD is not ignoring them. On the contrary lines omitting "#" will be transmitted to a [r ] that has the name of the beginning of the line. Thats how I discovered it. I was just pasting controldata after the #'lines in a txteditor, when I loaded the patch PD said: "no such receive". I guess I just considered it an undocumented feature, and found it very usefull. tjres Steffen
Also there's not really a technical advantage of that undocumented feature over using a very big message box that gets loadbang; e.g.:
junk patate poil; junk quick brown fox; junk lazy dog; junk 42;
vs
#X obj 0 0 loadbang; #X obj 0 20 msg patate poil , quick brown fox , lazy dog , 42; #X obj 0 100 s junk; #X connect 0 0 1 0; #X connect 1 0 2 0;
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada