Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Frank Barknecht Do You RjDj.me? _ ______footils.org__
done....now...where's that handshake?! :D
On 25 Nov 2008, at 22:10, Frank Barknecht wrote:
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Frank Barknecht Do You RjDj.me? _
______footils.org__ <pd-exam-01.pd>_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Is this one? Or is there something shorter?
Mike
On Tue, Nov 25, 2008 at 4:10 PM, Frank Barknecht fbar@footils.org wrote:
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
actually, I just checked my answer again, and when the list has two elements, it outputs a list of three elements on subsequent runs, as the 100 was still part of the list...
Is this one more accurate?
Mike
On Tue, Nov 25, 2008 at 4:25 PM, Mike McGonagle mjmogo@gmail.com wrote:
Is this one? Or is there something shorter?
Mike
On Tue, Nov 25, 2008 at 4:10 PM, Frank Barknecht fbar@footils.org wrote:
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal. —Yehudi Menuhin (1916–1999), musician
Frank Barknecht a écrit :
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N canvas 499 263 626 380 10; #X floatatom 142 286 5 0 0 0 - - -; #X floatatom 75 286 5 0 0 0 - - -; #X msg 75 122 1 2; #X obj 75 235 unpack 0 0; #X msg 116 151 3; #X text 166 151 but this should set the number boxes to "3" and "100". ; #X text 112 121 this should set the number boxes to "1" and "2".; #X text 42 29 Assignment 1:; #X text 67 58 Print the second element from a list. If there is no second element in the list because the list is too short , send 100 instead.; #X obj 142 314 print Second_Element; #N canvas 0 0 450 300 ???????? 0; #X obj 89 47 inlet; #X obj 89 240 outlet; #X text 178 52 Fill in this part.; #X obj 88 78 t a b; #X obj 89 105 unpack f f; #X msg 139 134 100; #X obj 88 159 pack f f; #X connect 0 0 3 0; #X connect 3 0 4 0; #X connect 3 1 5 0; #X connect 4 0 6 0; #X connect 4 1 6 1; #X connect 5 0 6 1; #X connect 6 0 1 0; #X restore 75 193 pd ????????; #X text 176 193 <== fill in this part.; #X connect 0 0 9 0; #X connect 2 0 10 0; #X connect 3 0 1 0; #X connect 3 1 0 0; #X connect 4 0 10 0; #X connect 10 0 3 0;
not really working at best. replace 1 2 with 1 2 4 and 3 with 3 7 ...
Best
S.
cyrille henry a écrit :
Frank Barknecht a écrit :
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;) Ciao
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
Frank Barknecht a écrit :
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
not really working at best. replace 1 2 with 1 2 4 and 3 with 3 7 ...
Oh, that would be a different assignment, like: replace a missing third element in a list.
Ciao
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were here just as example. anyway, that was fun playing.
Best
S.
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were here just as example. anyway, that was fun playing.
You're right in that the length of the list in the assignment is an arbitrary choice and ideally a solution would extend to larger lists as well. But any solution would have to be adapted to a certain list length. I guess at least, but maybe someone proves me wrong? ;)
Frank
Hallo,
inspired by Sylvain attached is an extended assignment for extra points. ;)
Frank
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were here just as example. anyway, that was fun playing.
You're right in that the length of the list in the assignment is an arbitrary choice and ideally a solution would extend to larger lists as well. But any solution would have to be adapted to a certain list length. I guess at least, but maybe someone proves me wrong? ;)
Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Here's mine...
Mike
On Tue, Nov 25, 2008 at 5:22 PM, Frank Barknecht fbar@footils.org wrote:
Hallo,
inspired by Sylvain attached is an extended assignment for extra points. ;)
Ciao
Frank
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were here just as example. anyway, that was fun playing.
You're right in that the length of the list in the assignment is an arbitrary choice and ideally a solution would extend to larger lists as well. But any solution would have to be adapted to a certain list length. I guess at least, but maybe someone proves me wrong? ;)
Ciao
Frank
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
Yep, i want the extra points :))) ++
Jack
Le 26 nov. 08 à 00:22, Frank Barknecht a écrit :
Hallo,
inspired by Sylvain attached is an extended assignment for extra
points. ;)Ciao
Frank
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were
here just as example. anyway, that was fun playing.You're right in that the length of the list in the assignment is an arbitrary choice and ideally a solution would extend to larger
lists as well. But any solution would have to be adapted to a certain list length. I guess at least, but maybe someone proves me wrong? ;)Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
<pd-exam-02.pd>
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Sorry, missed all the points on the first assignment. Here's my contribution.
On Tue, Nov 25, 2008 at 6:22 PM, Frank Barknecht fbar@footils.org wrote:
Hallo,
inspired by Sylvain attached is an extended assignment for extra points. ;)
-- ./MiS
Hallo, Michal Seta hat gesagt: // Michal Seta wrote:
Sorry, missed all the points on the first assignment. Here's my contribution.
I think, yours is a pretty cool, original and elegant solution!
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Hallo, Michal Seta hat gesagt: // Michal Seta wrote:
Sorry, missed all the points on the first assignment. Here's my contribution.
I think, yours is a pretty cool, original and elegant solution!
So cool in fact, that it's now part of [list]-abs, where I called it [list-pad]. It's in the SVN but also attached. Thanks a lot.
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
So cool in fact, that it's now part of [list]-abs, where I called it [list-pad]. It's in the SVN but also attached. Thanks a lot.
It occured to me that the crossconnecting in the first attempt was a bit silly, so the version that's in SVN now uses a more tradional approach with a cold right inlet to set padding values and no right outlet.
Frank
hmmm, how about
[inlet]
|
[t a b]
| / |
| [200] [300] [400]
| | | |
[pack 0 0 0 0]
|
[outlet]
It's a pity that pack is not settable...
gr~~~
Am 26.11.2008 um 00:22 schrieb Frank Barknecht:
Hallo,
inspired by Sylvain attached is an extended assignment for extra
points. ;)Ciao
Frank
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were here
just as example. anyway, that was fun playing.You're right in that the length of the list in the assignment is an arbitrary choice and ideally a solution would extend to larger
lists as well. But any solution would have to be adapted to a certain list length. I guess at least, but maybe someone proves me wrong? ;)Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
<pd-exam-02.pd>_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 11/26/08, Thomas Grill gr@grrrr.org wrote:
hmmm, how about
[inlet] | [t a b] | / |
| [200] [300] [400] | | | | [pack 0 0 0 0] | [outlet]It's a pity that pack is not settable...
If I understand you correctly on this, Thomas, if it were "settable", wouldn't each use of that [pack] reset the values that it would use for the defaults? I thought that was the whole point of the problem?
Mike
gr~~~
Am 26.11.2008 um 00:22 schrieb Frank Barknecht:
Hallo,
inspired by Sylvain attached is an extended assignment for extra points. ;)
Ciao
Frank
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were here just as example. anyway, that was fun playing.
You're right in that the length of the list in the assignment is an arbitrary choice and ideally a solution would extend to larger lists as well. But any solution would have to be adapted to a certain list length. I guess at least, but maybe someone proves me wrong? ;)
Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
<pd-exam-02.pd>_______________________________________________
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
Am 26.11.2008 um 09:20 schrieb Mike McGonagle:
On 11/26/08, Thomas Grill gr@grrrr.org wrote:
hmmm, how about
[inlet] | [t a b] | / |
| [200] [300] [400] | | | | [pack 0 0 0 0] | [outlet]It's a pity that pack is not settable...
If I understand you correctly on this, Thomas, if it were "settable", wouldn't each use of that [pack] reset the values that it would use for the defaults? I thought that was the whole point of the problem?
i meant that if one could use a [set 0 200 300 400( message for pack,
that would be shorter than three individual default numbers 200,300,400.
gr~~~
Ah, thanks for the explanation...
Mike
On 11/26/08, Thomas Grill gr@grrrr.org wrote:
Am 26.11.2008 um 09:20 schrieb Mike McGonagle:
On 11/26/08, Thomas Grill gr@grrrr.org wrote:
hmmm, how about
[inlet] | [t a b] | / |
| [200] [300] [400] | | | | [pack 0 0 0 0] | [outlet]It's a pity that pack is not settable...
If I understand you correctly on this, Thomas, if it were "settable", wouldn't each use of that [pack] reset the values that it would use for the defaults? I thought that was the whole point of the problem?
i meant that if one could use a [set 0 200 300 400( message for pack, that would be shorter than three individual default numbers 200,300,400. gr~~~
an other attemp (near the one i sent before) ++
Jack
Le 26 nov. 08 à 00:22, Frank Barknecht a écrit :
Hallo,
inspired by Sylvain attached is an extended assignment for extra
points. ;)Ciao
Frank
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
ok, well sorry. I just take the assignment as it, where you wrote "a list" and "too short". Thought you were making teh statement general, and lists were
here just as example. anyway, that was fun playing.You're right in that the length of the list in the assignment is an arbitrary choice and ideally a solution would extend to larger
lists as well. But any solution would have to be adapted to a certain list length. I guess at least, but maybe someone proves me wrong? ;)Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
<pd-exam-02.pd>
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Hey all,
I was trying to do this dynamically with the lowest possible amount of objects and I found a surprising behavior of [list split]:
Connecting a patchcord back from the second outlet of [list split] to its first inlet puts out all elements of a list in reversed order of the first outlet.
I know that's neither effective nor the right way to patch in Pd, but perhaps someone can explain that?
cheers, Martin
Am 26.11.2008 um 14:47 schrieb Martin Schied:
Hey all,
I was trying to do this dynamically with the lowest possible amount
of objects and I found a surprising behavior of [list split]:Connecting a patchcord back from the second outlet of [list split]
to its first inlet puts out all elements of a list in reversed
order of the first outlet.I know that's neither effective nor the right way to patch in Pd,
but perhaps someone can explain that?
it's surely a consequence of "depth first" (see pd help examples)...
the message output from the second outlet retriggers and alters the
state of the "list split" before the message is output from the first
outlet. I guess that quite a number of pd objects are not re-entrant
(including most of mine).
gr~~~
Thomas Grill wrote:
Am 26.11.2008 um 14:47 schrieb Martin Schied:
Hey all,
I was trying to do this dynamically with the lowest possible amount of objects and I found a surprising behavior of [list split]:
Connecting a patchcord back from the second outlet of [list split] to its first inlet puts out all elements of a list in reversed order of the first outlet.
I know that's neither effective nor the right way to patch in Pd, but perhaps someone can explain that?
it's surely a consequence of "depth first" (see pd help examples)... the message output from the second outlet retriggers and alters the state of the "list split" before the message is output from the first outlet. I guess that quite a number of pd objects are not re-entrant (including most of mine). gr~~~
Yeah, that's a real good example for depth first (and also for recursive functions on lists)! If you change the outlets oft the [t a a] also the order of the printed list switches from reversed to not reversed. Good to know!
cheers, Martin
Missed the start, but great thread ppl!
a.
On Tue, 25 Nov 2008 23:47:56 +0100 Frank Barknecht fbar@footils.org wrote:
Hallo, Sylvain Le Beux hat gesagt: // Sylvain Le Beux wrote:
not really working at best. replace 1 2 with 1 2 4 and 3 with 3 7 ...
Oh, that would be a different assignment, like: replace a missing third element in a list.
Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
wow, that's a pretty solution you got here.
cyrille henry wrote:
Frank Barknecht a écrit :
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;) Ciao
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
Frank Barknecht a écrit :
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
ok, here's mine, simplfied as possible
#N canvas 654 394 626 380 10; #X floatatom 142 286 5 0 0 0 - - -; #X floatatom 75 286 5 0 0 0 - - -; #X obj 75 235 unpack 0 0; #X text 166 151 but this should set the number boxes to "3" and "100". ; #X text 112 121 this should set the number boxes to "1" and "2".; #X text 42 29 Assignment 1:; #X text 67 58 Print the second element from a list. If there is no second element in the list because the list is too short , send 100 instead.; #X obj 142 314 print Second_Element; #N canvas 668 36 450 300 ???????? 1; #X obj 89 47 inlet; #X obj 40 230 outlet; #X msg 171 90 100; #X text 203 3 Fill in this part.; #X obj 132 191 spigot; #X obj 73 131 zl len; #X obj 40 185 spigot; #X obj 73 159 > 1; #X obj 132 117 zl join; #X obj 89 74 t l l b; #X obj 165 160 == 1; #X connect 0 0 9 0; #X connect 2 0 8 1; #X connect 4 0 1 0; #X connect 5 0 7 0; #X connect 5 0 10 0; #X connect 6 0 1 0; #X connect 7 0 6 1; #X connect 8 0 4 0; #X connect 9 0 6 0; #X connect 9 0 8 0; #X connect 9 1 5 0; #X connect 9 2 2 0; #X connect 10 0 4 1; #X restore 75 193 pd ????????; #X text 176 193 <== fill in this part.; #X msg 75 122 1 2; #X msg 116 151 3; #X connect 0 0 7 0; #X connect 2 0 1 0; #X connect 2 1 0 0; #X connect 8 0 2 0; #X connect 10 0 8 0; #X connect 11 0 8 0;
hey frank,
[inlet] | [list split 2] | / | [pack 0 100] | / | / | / | / | / | / | / | / |/ [outlet]
m.
Frank Barknecht wrote:
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Marius,
Wasn't quite sure if this would work, so I implemented it, and found that, maybe do to this "ascii" version, that the [pack 0 100] should be connected to the right outlet of the [list split 2]... This appears to be the shortest implementation.
Just mention this so others would recognize this...
I attached that version...
On Tue, Nov 25, 2008 at 4:39 PM, Marius Schebella marius.schebella@gmail.com wrote:
hey frank,
[inlet] | [list split 2] | / | [pack 0 100] | / | / | / | / | / | / | / | / |/ [outlet]
m.
Frank Barknecht wrote:
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
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
i haven't looked at the others... maybe it's a duplicate already... gr~~
[inlet] | [route list] | | | [pack 0 100] | / [outlet]
Am 25.11.2008 um 23:10 schrieb Frank Barknecht:
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Frank Barknecht Do You RjDj.me? _
______footils.org__ <pd-exam-01.pd>_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Thomas Grill wrote:
i haven't looked at the others... maybe it's a duplicate already... gr~~
[inlet] | [route list] | | | [pack 0 100] | / [outlet]
nice!! so I guess you should think of the the next "little wise assignment" for tomorrow. except frank can top this and shake hands with himself... happy handshaking. marius.
Hallo, Marius Schebella hat gesagt: // Marius Schebella wrote:
nice!! so I guess you should think of the the next "little wise assignment" for tomorrow. except frank can top this and shake hands with himself...
Of course I can't participate in my own exam. ;)
The idea for this task actually comes from real life patching:
I recently had to patch this little idiom myself (or rather the harder one from the new Exam 02) when doing a sample player which accepts lists composed of:
<table-name> <gain> <speed> <start position> <duration>
I wanted to provide defaults for all parameters except the table-name: gain=1, speed=1, start=0, duration=0 (for "play all").
Frank Barknecht
Based on the same patch i send before (ex. 2). I know this not the shortest solution :) ++
Jack
Le 25 nov. 08 à 23:10, Frank Barknecht a écrit :
Hallo,
attached is a little assignment for aspiring Pd users. The most elegant (e.g. shortest) solution gets a free handshake! ;)
Ciao
Frank Barknecht Do You RjDj.me? _
______footils.org__<pd- exam-01.pd>_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list