[PD] scores with datastructure

Frank Barknecht fbar at footils.org
Mon Mar 27 14:40:53 CEST 2006


Hallo,
Frank Barknecht hat gesagt: // Frank Barknecht wrote:

> patco hat gesagt: // patco wrote:
> 
> > --- Frank Barknecht <fbar at footils.org> a écrit :
> > 
> > > I think it would be interesting to have a more general struct
> > > definition for notes instead of one defintion for each possible note
> > > type like half, quarter, dotted etc.
... 
> > > Flags would be a candidate for an array, too. Depending on the length
> > > of the "flags" array, we would get 1/16, 1/32,... notes.
> > 
> > Flags also need "y spacing".
> 
> A similar trick as above could be used, I believe.

It can. I now did a very general note stuct, which is only still missing
dots. It's attached. 

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 402 308 562 412 10;
#N canvas 466 377 567 534 note 0;
#X obj 22 94 drawpolygon 0 1 stem-x 0 stem-x stem-y;
#X obj 21 15 struct note float x float y float filled float stem-x
float stem-y float numflags array flags flag;
#X obj 21 125 plot -v numflags flags 0 0 stem-x stem-y 0;
#X obj 21 58 filledcurve filled 0 1 -4 0 0 -3 4 0 0 3;
#N canvas 303 239 826 603 note-properties 0;
#X obj 601 132 pointer;
#X msg 601 110 traverse \$1 \, bang;
#X obj 601 87 symbol;
#X obj 198 156 setsize note flags;
#X obj 37 296 until;
#X obj 38 239 clip 0 4;
#X obj 37 264 t f b;
#X msg 78 295 0;
#X obj 37 322 f 0;
#X obj 66 322 + 1;
#X obj 172 450 element note flags;
#X obj 37 348 t f f;
#X obj 37 387 * 4;
#X obj 37 440 pack 0 5;
#X obj 37 480 set flag y direction;
#X msg 75 416 5;
#X msg 107 415 -5;
#X obj 176 258 moses;
#X obj 176 232 get note stem-y;
#X obj 176 209 pointer;
#X floatatom 278 296 5 0 0 0 - - -;
#X obj 260 341 set note stem-x;
#X msg 214 296 4;
#X msg 243 296 -4;
#X obj 154 102 get note numflags;
#X obj 154 79 pointer;
#X obj 512 250 s \$0-last-note;
#X obj 360 315 r \$0-last-note;
#X obj 293 424 r \$0-last-note;
#X obj 198 57 r \$0-last-note;
#X obj 319 129 r \$0-last-note;
#X obj 220 182 r \$0-last-note;
#X obj 96 26 r \$0-update-note;
#X obj 96 55 t b b b b;
#X obj 154 126 t f b f;
#X obj 479 26 inlet;
#X obj 417 261 outlet;
#X obj 482 220 t b a;
#X obj 482 281 s \$0-update-note;
#X obj 482 162 append note x y filled stem-y numflags;
#X obj 479 59 route pointer-to;
#X connect 0 0 39 5;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 8 0;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
#X connect 6 1 7 0;
#X connect 7 0 8 1;
#X connect 8 0 9 0;
#X connect 8 0 11 0;
#X connect 9 0 8 1;
#X connect 10 0 14 2;
#X connect 11 0 12 0;
#X connect 11 1 10 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 15 0 13 1;
#X connect 16 0 13 1;
#X connect 17 0 15 0;
#X connect 17 0 22 0;
#X connect 17 1 16 0;
#X connect 17 1 23 0;
#X connect 18 0 17 0;
#X connect 19 0 18 0;
#X connect 20 0 21 0;
#X connect 22 0 12 1;
#X connect 22 0 21 0;
#X connect 23 0 12 1;
#X connect 23 0 21 0;
#X connect 24 0 34 0;
#X connect 25 0 24 0;
#X connect 27 0 21 1;
#X connect 28 0 10 1;
#X connect 29 0 25 1;
#X connect 30 0 3 1;
#X connect 31 0 19 1;
#X connect 32 0 33 0;
#X connect 33 3 25 0;
#X connect 34 0 5 0;
#X connect 34 1 19 0;
#X connect 34 2 3 0;
#X connect 35 0 40 0;
#X connect 37 0 38 0;
#X connect 37 1 26 0;
#X connect 39 0 36 0;
#X connect 39 0 37 0;
#X connect 40 0 2 0;
#X connect 40 1 39 0;
#X restore 57 228 pd note-properties;
#X text 16 158 Note: -v is broken in pd-0.39 \, display won't update
until the score subpatch is refreshed e.g. by "vis 0 \, vis 1";
#X obj 59 378 hradio 15 1 0 5 empty empty number_of_flags 0 -6 0 8
-262144 -1 -1 4;
#X obj 85 296 set note stem-y;
#X floatatom 55 251 5 0 0 0 - - -;
#X obj 88 419 set note numflags;
#X obj 55 273 t b f;
#X obj 185 264 r \$0-last-note;
#X obj 202 380 r \$0-last-note;
#X obj 55 319 s \$0-update-note;
#X obj 59 400 t b f;
#X obj 59 446 s \$0-update-note;
#X obj 63 506 set note filled;
#X msg 63 484 0;
#X msg 91 483 999;
#X obj 163 483 r \$0-last-note;
#X text 220 226 x \, y \, filled \, stem-y \, numflags;
#X msg 57 205 pointer-to pd-mydisplay \, 200 100 0 -20 2;
#X connect 6 0 14 0;
#X connect 8 0 10 0;
#X connect 10 0 13 0;
#X connect 10 1 7 0;
#X connect 11 0 7 1;
#X connect 12 0 9 1;
#X connect 14 0 15 0;
#X connect 14 1 9 0;
#X connect 17 0 16 0;
#X connect 18 0 16 0;
#X connect 19 0 16 1;
#X connect 21 0 4 0;
#X restore 221 58 pd note;
#N canvas 0 0 797 605 flag 0;
#X obj 648 251 pointer;
#X msg 648 229 traverse \$1 \, bang;
#X obj 648 206 symbol;
#X obj 404 195 route point;
#X obj 401 279 append flag y;
#X msg 405 169 point pd-display \, 30;
#X obj 81 65 struct flag float y float direction;
#X text 354 62 direction should be 5 or -5;
#X obj 83 119 drawpolygon 0 2 0 0 6 direction;
#X connect 0 0 4 1;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 3 1 4 0;
#X connect 5 0 3 0;
#X restore 219 85 pd flag;
#N canvas 0 0 450 300 mydisplay 1;
#X restore 219 190 pd mydisplay;
#X msg 219 135 clear;
#X obj 219 159 s pd-mydisplay;
#X text 78 58 Stuff happens here:;
#X connect 3 0 4 0;


More information about the Pd-list mailing list