Commit f8ffd610 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*more updates to ds tutorials and demos

parent 8e40348a
#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 ___________________________;
......
......@@ -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 10 0 6 0;
#X connect 17 0 18 0;
#X connect 18 0 6 0;
#X connect 16 0 17 0;
#X connect 17 0 6 0;
#X connect 19 0 6 0;
#N struct drawtut-attr-cont float x float y;
#N canvas 0 19 638 678 10;
#X obj 93 563 draw rect 0 0 50 50;
#X msg 93 92 fill red;
#X obj 93 583 draw rect 0 0 50 50;
#X msg 93 112 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 92 fill color. 1 symbol \, 3 floats (rgb) \, or 4 floats
#X text 200 112 fill color. 1 symbol \, 3 floats (rgb) \, or 4 floats
(rgba);
#X text 200 150 opacity for fill color. float in range 0-1;
#X msg 100 149 fill-opacity \$1;
#X text 200 176 fill-rule for overlapping polygons. 0 = nonzero \,
#X text 200 170 opacity for fill color. float in range 0-1;
#X msg 100 169 fill-opacity \$1;
#X text 200 196 fill-rule for overlapping polygons. 0 = nonzero \,
1 = evenodd;
#X floatatom 113 201 5 0 0 0 - - -, f 5;
#X floatatom 120 246 5 0 0 0 - - -, f 5;
#X msg 113 223 rx \$1;
#X msg 120 270 ry \$1;
#X text 160 223 x value for rounded rectangle corner;
#X text 164 271 y value for rounded rectangle corner;
#X text 214 297 stroke color. 1 symbol \, 3 floats (rgb) \, or 4 floats
#X floatatom 113 221 5 0 0 0 - - -, f 5;
#X floatatom 120 266 5 0 0 0 - - -, f 5;
#X msg 113 243 rx \$1;
#X msg 120 290 ry \$1;
#X text 160 243 x value for rounded rectangle corner;
#X text 164 291 y value for rounded rectangle corner;
#X text 214 317 stroke color. 1 symbol \, 3 floats (rgb) \, or 4 floats
(rgba);
#X text 274 324 list of numbers to specify dash lengths;
#X msg 140 351 stroke-linecap 0;
#X text 254 351 for ends of open subpaths. 0 = butt \, 1 = round \,
#X text 274 344 list of numbers to specify dash lengths;
#X msg 140 371 stroke-linecap 0;
#X text 254 371 for ends of open subpaths. 0 = butt \, 1 = round \,
2 = square;
#X text 264 379 shape of path corners. 0 = miter \, 1 = round \, 2
#X text 264 399 shape of path corners. 0 = miter \, 1 = round \, 2
= bevel;
#X text 286 405 limit miter length;
#X text 286 432 opacity for the stroke. float in range 0-1;
#X text 286 458 width of the stroke.;
#X msg 146 378 stroke-linejoin 0;
#X msg 151 405 stroke-miterlimit 0;
#X msg 155 432 stroke-opacity 0.4;
#X text 286 536 affine transformation on the object.;
#X msg 158 459 stroke-width 10;
#X floatatom 161 491 5 0 0 0 - - -, f 5;
#X msg 161 536 transform skewx \$1;
#X obj 161 512 * 0.01;
#X text 275 580 Read more about svg attributes here:;
#X obj 275 601 pddp/pddplink http://www.w3.org/TR/SVG11/painting.html
#X text 286 425 limit miter length;
#X text 286 452 opacity for the stroke. float in range 0-1;
#X text 286 478 width of the stroke.;
#X msg 146 398 stroke-linejoin 0;
#X msg 151 425 stroke-miterlimit 0;
#X msg 155 452 stroke-opacity 0.4;
#X text 286 556 affine transformation on the object.;
#X msg 158 479 stroke-width 10;
#X floatatom 161 511 5 0 0 0 - - -, f 5;
#X msg 161 556 transform skewx \$1;
#X obj 161 532 * 0.01;
#X text 275 600 Read more about svg attributes here:;
#X obj 275 621 pddp/pddplink http://www.w3.org/TR/SVG11/painting.html
;
#X msg 107 176 fill-rule 0;
#X msg 134 324 stroke-dasharray 5 10;
#X msg 127 297 stroke purple;
#X obj 127 121 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 600 1;
#X text 107 121 0;
#X text 268 121 1;
#X msg 107 196 fill-rule 0;
#X msg 134 344 stroke-dasharray 5 10;
#X msg 127 317 stroke purple;
#X obj 127 141 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X text 107 141 0;
#X text 268 141 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;
#N struct drawtut-circle float x float y;
#N canvas 0 19 638 554 10;
#X msg 53 117 stroke blue;
#X msg 143 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;
......
#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;
......
......@@ -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;
......@@ -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
......
......@@ -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 373 87 loadbang;
#X msg 373 108 fill blue;
#X obj 343 87 loadbang;
#X msg 343 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 411 200 fill white;
#X msg 381 200 fill white;
#X text 149 261 <- Click and move the mouse over these shapes;
#X obj 373 157 loadbang;
#X obj 343 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 373 129 draw rect 0 0 60 60;
#X msg 373 178 stroke-width 20;
#X obj 373 221 draw circle 30 120 25;
#X obj 343 129 draw rect 0 0 60 60;
#X obj 343 221 draw circle 30 120 25;
#X msg 343 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 25 0;
#X connect 20 0 24 0;
#X connect 24 0 25 0;
#X connect 18 0 24 0;
#X connect 20 0 25 0;
#X connect 25 0 24 0;
#N struct drawtut-animation float x float y;
#N canvas -9 19 537 571 10;
#X scalar drawtut-animation 47 306 \;;
#X obj 47 271 draw rect 0 0 40 40;
#X obj 47 135 struct drawtut-animation float x float y;
#N canvas 0 19 537 571 10;
#X scalar drawtut-animation 47 309 \;;
#X obj 47 279 draw rect 0 0 40 40;
#X obj 47 131 struct drawtut-animation float x float y;
#X text 0 1 New Drawing Commands: animation;
#X text 1 1 _______________________________;
#X text 47 26 The svg specification has some handy attributes which
#X text 47 25 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 86 However \, if you can do the same thing using some of
#X text 47 82 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 166 tgl 23 0 empty empty empty 17 7 0 10 -4034 -1 -1 0 1
#X obj 47 168 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 451 5 0 0 0 - - -, f 5;
#X msg 50 472 1000 \$1;
#X obj 50 493 /;
#X floatatom 50 514 5 0 0 1 - - -, f 5;
#X obj 47 232 line 0 33.333;
#X text 112 450 <-- If you want to convert grain-rate to fps \, type
#X floatatom 50 459 5 0 0 0 - - -, f 5;
#X msg 50 480 1000 \$1;
#X obj 50 501 /;
#X floatatom 50 522 5 0 0 1 - - -, f 5;
#X obj 47 240 line 0 33.333;
#X text 112 458 <-- 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 14 0 15 0;
#X connect 16 0 19 0;
#X connect 19 0 1 0;
#X connect 15 0 18 0;
#X connect 18 0 1 0;
#X connect 19 0 8 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment