[Pd] Stack Overflow

Frank Barknecht fbar at footils.org
Fri Mar 24 21:54:16 CET 2006


Hallo,
Chuckk Hubbard hat gesagt: // Chuckk Hubbard wrote:

> I get this all the time.  It's a real problem, because in a longer
> score it usually means the first half of the score has had all its
> notes changed to a new reference pitch and the second half hasn't, and
> there's no way back from that but to reload the piece.
> 
> I have a "JInext" abstraction I made, which takes a bang or a next
> message, and finds the next $1 scalar in pd-score.  Because I have a
> vertical line on each beat, and octave marking lines, and tempo
> markers, plus notes, it has to skip past a lot of other templates.

You could implement the beat, octave etc. lines as arrays instead of
as single structs. 

Then even a long score with 1000 beat lines will just contain one
single "beatgrid" struct. And it's even much easier to patch.

An example is attached.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 334 205 735 428 10;
#N canvas 350 291 450 300 grid 1;
#X restore 107 95 pd grid;
#N canvas 0 0 450 300 beat 0;
#X obj 111 49 struct beat float y;
#X obj 110 99 drawpolygon 0 1 0 0 0 400;
#X restore 248 74 pd beat;
#N canvas 614 549 450 300 beatgrid 0;
#X obj 75 62 struct beatgrid float spacing array grid beat;
#X obj 75 126 plot grid 0 0 0 0 spacing;
#X text 79 154 invisible grid spaced "spacing" px apart;
#X restore 247 103 pd beatgrid;
#X obj 593 238 pointer;
#X msg 528 205 traverse pd-grid \, bang;
#X msg 423 71 bang;
#X obj 287 299 setsize beatgrid grid;
#X floatatom 288 269 5 0 0 0 - - -;
#X msg 529 123 \; pd-grid clear;
#X obj 430 264 append beatgrid spacing;
#X msg 430 238 50;
#X obj 426 93 t b b b;
#X connect 3 0 9 1;
#X connect 4 0 3 0;
#X connect 5 0 11 0;
#X connect 7 0 6 0;
#X connect 9 0 6 1;
#X connect 10 0 9 0;
#X connect 11 0 10 0;
#X connect 11 1 4 0;
#X connect 11 2 8 0;


More information about the Pd-list mailing list