Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rishabh Gupta
purr-data
Commits
f8ffd610
Commit
f8ffd610
authored
Aug 20, 2014
by
Ivica Bukvic
Browse files
*more updates to ds tutorials and demos
parent
8e40348a
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/00.under.construction.pd
View file @
f8ffd610
This diff is collapsed.
Click to expand it.
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/01.intro.pd
View file @
f8ffd610
#N struct foo float x float y;
#N canvas
-9
19 565 491 10;
#N canvas
0
19 565 491 10;
#X scalar foo 96 105 \;;
#N canvas 429 132 808 465 welcome-animation 0;
#X obj 877 107 bng 54 250 50 0 empty empty empty 17 7 0 10 -262144
...
...
@@ -133,8 +133,6 @@
#X obj 311 66 draw rect -40 -50 200 90;
#X obj 189 -26 struct foo float x float y;
#X obj 189 4 loadbang;
#X msg 311 35 stroke-dasharray 10 4 \, stroke-width 4 \, stroke gray
;
#N canvas 433 184 450 300 welcome-text 0;
#N canvas 71 237 450 300 w 0;
#X obj 40 215 draw path m 93.8047 87.029 c 0 1.17187 0.859375 2.05078
...
...
@@ -635,10 +633,12 @@ c -0.21485 -0.05859 -0.41016 -0.9375 -0.41016 -1.21094;
#X restore 37 97 group exclamation-point;
#X restore 189 66 group welcome-text;
#X msg 189 37 fill black;
#X connect 2 0 3 0;
#X msg 311 35 stroke-dasharray 10 4 \, stroke-width 4 \, stroke gray
\, fill "";
#X connect 2 0 5 0;
#X connect 3 0 0 0;
#X connect 5 0 4 0;
#X connect 2 0 4 0;
#X connect 4 0 3 0;
#X connect 5 0 0 0;
#X restore 339 39 pd welcome-struct;
#X text 0 1 New Drawing Commands: Intro;
#X text 0 1 ___________________________;
...
...
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/04.attributes.pd
View file @
f8ffd610
...
...
@@ -18,7 +18,6 @@ object attributes are supported in Pd. But the basic ones are.;
object and a scalar created from them. Let's send a message to make
the rectangle more interesting.;
#X msg 53 252 fill red;
#X msg 123 252 fill white;
#X text 53 229 Click a message box to change the "fill" attribute:
;
#X text 53 394 As you can see \, the "fill" message changes the fill
...
...
@@ -40,7 +39,8 @@ the fourth argument specifying opacity.;
using a [loadbang] message. Notice that attributes will be the same
for all scalars created from this [struct]. Later you will see how
to set attributes to be different for each scalar.;
#X msg 123 252 fill green;
#X connect 9 0 6 0;
#X connect 1
0
0
6
0;
#X connect 17 0
18
0;
#X connect 1
8
0 6 0;
#X connect 1
6
0
17
0;
#X connect 17 0
6
0;
#X connect 1
9
0 6 0;
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/05.more.attributes.pd
View file @
f8ffd610
#N struct drawtut-attr-cont float x float y;
#N canvas 0 19 638 678 10;
#X obj 93 5
6
3 draw rect 0 0 50 50;
#X msg 93
9
2 fill red;
#X obj 93 5
8
3 draw rect 0 0 50 50;
#X msg 93
11
2 fill red;
#X text 0 1 New Drawing Commands: attributes (continued);
#X text 0 1 ____________________________________________;
#X text 53 23 There are quite a few attributes we can control to change
the appearance of a shape:;
#X obj 53 57 struct drawtut-attr-cont float x float y;
#X scalar drawtut-attr-cont 24 283 \;;
#X text 200
9
2 fill color. 1 symbol \, 3 floats (rgb) \, or 4 floats
#X text 200
11
2 fill color. 1 symbol \, 3 floats (rgb) \, or 4 floats
(rgba);
#X text 200 1
5
0 opacity for fill color. float in range 0-1;
#X msg 100 1
4
9 fill-opacity \$1;
#X text 200 1
7
6 fill-rule for overlapping polygons. 0 = nonzero \,
#X text 200 1
7
0 opacity for fill color. float in range 0-1;
#X msg 100 1
6
9 fill-opacity \$1;
#X text 200 1
9
6 fill-rule for overlapping polygons. 0 = nonzero \,
1 = evenodd;
#X floatatom 113 2
0
1 5 0 0 0 - - -, f 5;
#X floatatom 120 2
4
6 5 0 0 0 - - -, f 5;
#X msg 113 2
2
3 rx \$1;
#X msg 120 2
7
0 ry \$1;
#X text 160 2
2
3 x value for rounded rectangle corner;
#X text 164 2
7
1 y value for rounded rectangle corner;
#X text 214
29
7 stroke color. 1 symbol \, 3 floats (rgb) \, or 4 floats
#X floatatom 113 2
2
1 5 0 0 0 - - -, f 5;
#X floatatom 120 2
6
6 5 0 0 0 - - -, f 5;
#X msg 113 2
4
3 rx \$1;
#X msg 120 2
9
0 ry \$1;
#X text 160 2
4
3 x value for rounded rectangle corner;
#X text 164 2
9
1 y value for rounded rectangle corner;
#X text 214
31
7 stroke color. 1 symbol \, 3 floats (rgb) \, or 4 floats
(rgba);
#X text 274 3
2
4 list of numbers to specify dash lengths;
#X msg 140 3
5
1 stroke-linecap 0;
#X text 254 3
5
1 for ends of open subpaths. 0 = butt \, 1 = round \,
#X text 274 3
4
4 list of numbers to specify dash lengths;
#X msg 140 3
7
1 stroke-linecap 0;
#X text 254 3
7
1 for ends of open subpaths. 0 = butt \, 1 = round \,
2 = square;
#X text 264 3
7
9 shape of path corners. 0 = miter \, 1 = round \, 2
#X text 264 3
9
9 shape of path corners. 0 = miter \, 1 = round \, 2
= bevel;
#X text 286 4
0
5 limit miter length;
#X text 286 4
3
2 opacity for the stroke. float in range 0-1;
#X text 286 4
5
8 width of the stroke.;
#X msg 146 3
7
8 stroke-linejoin 0;
#X msg 151 4
0
5 stroke-miterlimit 0;
#X msg 155 4
3
2 stroke-opacity 0.4;
#X text 286 5
3
6 affine transformation on the object.;
#X msg 158 4
5
9 stroke-width 10;
#X floatatom 161
49
1 5 0 0 0 - - -, f 5;
#X msg 161 5
3
6 transform skewx \$1;
#X obj 161 5
1
2 * 0.01;
#X text 275
58
0 Read more about svg attributes here:;
#X obj 275 6
0
1 pddp/pddplink http://www.w3.org/TR/SVG11/painting.html
#X text 286 4
2
5 limit miter length;
#X text 286 4
5
2 opacity for the stroke. float in range 0-1;
#X text 286 4
7
8 width of the stroke.;
#X msg 146 3
9
8 stroke-linejoin 0;
#X msg 151 4
2
5 stroke-miterlimit 0;
#X msg 155 4
5
2 stroke-opacity 0.4;
#X text 286 5
5
6 affine transformation on the object.;
#X msg 158 4
7
9 stroke-width 10;
#X floatatom 161
51
1 5 0 0 0 - - -, f 5;
#X msg 161 5
5
6 transform skewx \$1;
#X obj 161 5
3
2 * 0.01;
#X text 275
60
0 Read more about svg attributes here:;
#X obj 275 6
2
1 pddp/pddplink http://www.w3.org/TR/SVG11/painting.html
;
#X msg 107 1
7
6 fill-rule 0;
#X msg 134 3
2
4 stroke-dasharray 5 10;
#X msg 127
29
7 stroke purple;
#X obj 127 1
2
1 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1
60
0 1;
#X text 107 1
2
1 0;
#X text 268 1
2
1 1;
#X msg 107 1
9
6 fill-rule 0;
#X msg 134 3
4
4 stroke-dasharray 5 10;
#X msg 127
31
7 stroke purple;
#X obj 127 1
4
1 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X text 107 1
4
1 0;
#X text 268 1
4
1 1;
#X text 25 348 (scalar);
#X obj 93 85 loadbang;
#X connect 1 0 0 0;
#X connect 9 0 0 0;
#X connect 11 0 13 0;
...
...
@@ -68,3 +69,4 @@ the appearance of a shape:;
#X connect 36 0 0 0;
#X connect 37 0 0 0;
#X connect 38 0 9 0;
#X connect 42 0 1 0;
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/08.circle.pd
View file @
f8ffd610
#N struct drawtut-circle float x float y;
#N canvas 0 19 638 554 10;
#X msg
5
3 117 stroke blue;
#X msg
14
3 117 stroke blue;
#X text 52 484 Lines are only a single stroke. They don't have any
inner area to fill \, so none of the messages like "fill" or "fill-rule"
have any effect.;
...
...
@@ -10,7 +10,7 @@ have any effect.;
#X obj 53 57 struct drawtut-circle float x float y;
#X scalar drawtut-circle 157 283 \;;
#X text 248 270 <- a circle;
#X msg
142
117 fill yellow;
#X msg
53
117 fill yellow;
#X msg 228 117 stroke-width \$1;
#X floatatom 228 93 5 0 0 0 - - -, f 5;
#X obj 53 153 draw circle 0 0 80;
...
...
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/09.ellipse.pd
View file @
f8ffd610
#N struct drawtut-ellipse float x float y;
#N canvas 0 19 509 498 10;
#X msg
53
117 stroke blue;
#X msg
142
117 fill yellow;
#X msg
141
117 stroke blue;
#X msg
54
117 fill yellow;
#X msg 228 117 stroke-width \$1;
#X floatatom 228 93 5 0 0 0 - - -, f 5;
#X obj 53 153 draw ellipse 0 0 86 42;
...
...
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/10.polyline.pd
View file @
f8ffd610
...
...
@@ -27,6 +27,7 @@ the [draw] object quite powerful.;
#X msg 53 137 stroke purple;
#X msg 142 137 fill gray;
#X msg 228 95 10;
#X obj 53 103 loadbang;
#X connect 0 0 6 0;
#X connect 1 0 0 0;
#X connect 9 0 14 0;
...
...
@@ -37,3 +38,4 @@ the [draw] object quite powerful.;
#X connect 15 0 6 0;
#X connect 16 0 6 0;
#X connect 17 0 1 0;
#X connect 18 0 15 0;
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/14.group.pd
View file @
f8ffd610
...
...
@@ -19,17 +19,17 @@ of individually.;
#X obj 35 26 loadbang;
#X msg 35 47 fill blue;
#X obj 35 210 loadbang;
#X msg 35 231 stroke-width 10;
#X obj 35 101 loadbang;
#X msg 35 122 stroke darkgreen \, stroke-width 10;
#X msg 49 148 fill white;
#X msg 35 122 stroke darkgreen \, stroke-width 10 \, fill "";
#X msg 35 231 stroke-width 10 \, stroke black;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X connect 5 0
6
0;
#X connect 6 0
2
0;
#X connect 7 0
8
0;
#X connect 5 0
9
0;
#X connect 6 0
8
0;
#X connect 7 0
1
0;
#X connect 8 0 1 0;
#X connect 9 0
1
0;
#X connect 9 0
2
0;
#X restore 434 236 group;
#X text 53 263 The [group] object is essentially just a subpatch with
an inlet. You can send it all the same messages that you can send to
...
...
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/15.events.pd
View file @
f8ffd610
...
...
@@ -5,8 +5,8 @@
#X text 0 1 New Drawing Commands: mouse events;
#X text 53 43 When the user mouses over or clicks a scalar a message
gets sent to the outlet of the corresponding [struct] object.;
#X obj 3
7
3 87 loadbang;
#X msg 3
7
3 108 fill blue;
#X obj 3
4
3 87 loadbang;
#X msg 3
4
3 108 fill blue;
#X text 53 430 The following events are reported:;
#X text 53 490 click - clicking the scalar in "Run mode";
#X text 53 550 enter - moving the mouse over a scalar;
...
...
@@ -20,9 +20,9 @@ shape or value;
#X obj 53 138 list split 1;
#X obj 63 113 print;
#X obj 53 87 struct drawtut-events float x float y;
#X msg
41
1 200 fill white;
#X msg
38
1 200 fill white;
#X text 149 261 <- Click and move the mouse over these shapes;
#X obj 3
7
3 157 loadbang;
#X obj 3
4
3 157 loadbang;
#X text 149 299 Notice that when you move from the circle's border
to its center \, you generate a "leave" event. This is because the
circle has no fill color. Once you set a fill color-- even white--
...
...
@@ -31,14 +31,14 @@ then the middle will count as part of the shape.;
event \, which will register a click for anything inside the scalar's
bounding box (i.e. \, the selection rectangle that appears when you
select it in edit-mode.;
#X obj 3
7
3 129 draw rect 0 0 60 60;
#X
msg
3
7
3
178 stroke-width 20
;
#X
obj
3
7
3
221 draw circle 30 120 25
;
#X obj 3
4
3 129 draw rect 0 0 60 60;
#X
obj
3
4
3
221 draw circle 30 120 25
;
#X
msg
3
4
3
178 stroke-width 20 \, stroke black \, fill ""
;
#X connect 4 0 5 0;
#X connect 5 0 23 0;
#X connect 15 0 14 0;
#X connect 17 0 15 0;
#X connect 17 0 16 0;
#X connect 18 0 2
5
0;
#X connect 20 0 2
4
0;
#X connect 2
4
0 2
5
0;
#X connect 18 0 2
4
0;
#X connect 20 0 2
5
0;
#X connect 2
5
0 2
4
0;
pd/doc/4.data.structures/pd-l2ork/ds-tutorials/16.animation.pd
View file @
f8ffd610
#N struct drawtut-animation float x float y;
#N canvas
-9
19 537 571 10;
#X scalar drawtut-animation 47 30
6
\;;
#X obj 47 27
1
draw rect 0 0 40 40;
#X obj 47 13
5
struct drawtut-animation float x float y;
#N canvas
0
19 537 571 10;
#X scalar drawtut-animation 47 30
9
\;;
#X obj 47 27
9
draw rect 0 0 40 40;
#X obj 47 13
1
struct drawtut-animation float x float y;
#X text 0 1 New Drawing Commands: animation;
#X text 1 1 _______________________________;
#X text 47 2
6
The svg specification has some handy attributes which
#X text 47 2
5
The svg specification has some handy attributes which
can be used to animate the transition between values for other attributes.
Unfortunately the new [draw] commands don't currently support those
attributes.;
#X text 47 8
6
However \, if you can do the same thing using some of
#X text 47 8
2
However \, if you can do the same thing using some of
Pd's core objects. For example \, with [line] you can create a ramp
between values.;
#X obj 47 16
6
tgl 23 0 empty empty empty 17 7 0 10 -4034 -1 -1 0 1
#X obj 47 16
8
tgl 23 0 empty empty empty 17 7 0 10 -4034 -1 -1 0 1
;
#X obj 47 193 * 255;
#X msg 47 212 \$1 500;
#X text 171 271 <- use the 2nd argument to set the "grain" rate;
#X text 47 358 This is less efficient than svg's animation interface.
#X msg 47 220 \$1 500;
#X text 171 279 <- use the 2nd argument to set the "grain" rate;
#X text 47 371 This is less efficient than svg's animation interface.
Here \, Pd must send a message for each change in value during the
ramp. However \, you can use the 2nd argument to [line] to tell it
how many milliseconds it should wait before outputting a ramp value.
Use the objects below to convert between "grain" rate and frames-per-second.
;
#X floatatom 50 45
1
5 0 0 0 - - -, f 5;
#X msg 50 4
72
1000 \$1;
#X obj 50
493
/;
#X floatatom 50 5
14
5 0 0 1 - - -, f 5;
#X obj 47 2
32
line 0 33.333;
#X text 112 45
0
<-- If you want to convert grain-rate to fps \, type
#X floatatom 50 45
9
5 0 0 0 - - -, f 5;
#X msg 50 4
80
1000 \$1;
#X obj 50
501
/;
#X floatatom 50 5
22
5 0 0 1 - - -, f 5;
#X obj 47 2
40
line 0 33.333;
#X text 112 45
8
<-- If you want to convert grain-rate to fps \, type
the grain-rate in the box and read out the answer in the bottom box.
On the other hand if you want to convert fps to grain-rate simply think
your desire at the patch and Pd will automatically do the conversion
in the other direction!;
#X text 112 516 How does it know?;
#X msg 47 252 fill \$1 \$1 \$1;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 16 0;
#X text 112 524 How does it know?;
#X msg 47 260 fill \$1 \$1 \$1;
#X obj 47 198 * 255;
#X connect 7 0 19 0;
#X connect 8 0 15 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 1
4
0 1
5
0;
#X connect 1
6
0 1
9
0;
#X connect 19 0
1
0;
#X connect 1
5
0 1
8
0;
#X connect 1
8
0 1 0;
#X connect 19 0
8
0;
pd/doc/4.data.structures/pd-l2ork/sprite-game/game.pd
View file @
f8ffd610
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment