[PD] newbie: Feedback and questions

Frank Barknecht fbar at footils.org
Thu Nov 30 18:19:07 CET 2006


Hallo,
David F. Place hat gesagt: // David F. Place wrote:

> The patch implements a tone generator for Pythagorean tuning with 
> syntonic comma offsets.  I hope it will help my renaissance flute 
> consort to learn to play in just intonation in the style of Zarlino.  
> So, it has to be usable by non-electronic music people.    It does what 
> I want.  I would appreciate if anyone could review it for style and 
> understanding.  I suspect that I have done some unnecessary things do to 
> my imperfect understanding
> 
> One thing in particular that it does in a way I don't like is setting 
> the note name.  I would prefer to pass the note name as an argument to 
> the noteSelector abstraction instead of having that bit of [set( and 
> [send] circuitry off to the side of the noteSelector, but I couldn't 
> figure out how.

Now I could look at your patch, very nice work and a great idea to
start with. The solution to your "set note name"-question isn't too
hard:

Besides numbers you can also pass symbols as argument, so you could
call noteSelector like this: [noteSelector 32 27 F-Natural $0]. Then
"$3" inside the abstraction would be replaced by "F-Natural". However
of course you cannot use a [f F-Natural] as that is illegal, you need
to use [symbol F-Natural] instead. Connect a message [set $1(
afterwards and send it to "$0-note" or rather [s $4-note] if you pass
$0 as fourth argument. 

Btw: A generic container for both float- and symbol-arguments is [list
append] like this: [list append $3] here is equivalent to [symbol $3],
but if $3 would hold a number, [list append $3] would be equivalent to
[f $3], because [list] automatically converts single-element lists in
a smart way to float- or symbol-messages.

I have one criticism to make as well. Long term pd-list readers will
already guess what's coming now: Sooner or later you may run into
problems with the execution order in your patch because you didn't use
a single [trigger] object in almost all of your abstractions. (Only
two triggers are used, which you copied from the examples.)

Triggers are important to use wherever you have "fanning" connections,
that is, more than one patch-cord running out of a single object. The
order, in which the messages are transported along each of these
patchcords, is *undefined* in Pd! You may consider it as randomly
(even when in reality it isn't).

You have a lot of these, for example every bng-object in your patch is
source for several patch cords. This may work now because you're lucky
and the connections actually fire in the correct order by coincidence,
but as soon as you edit the patch a bit more and re-connect stuff, it
*will* break. Promised. 

Attached patch illustrates one of the ways your patches will break.

So you really should make yourself familiar with the way, execution
order in Pd works and with the trigger-object and replace all fanning
connections with correct triggers. 

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 456 37 702 402 10;
#X obj 387 129 tgl 15 0 empty empty +6_dB 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 387 226 +;
#X obj 387 153 t f f;
#X floatatom 387 262 5 0 0 0 - - -;
#X obj 52 146 tgl 15 0 empty empty +6_dB 0 -6 0 8 -262144 -1 -1 1 1
;
#X floatatom 52 205 5 0 0 0 - - -;
#X obj 126 148 tgl 15 0 empty empty +6_dB 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 126 185 +;
#X floatatom 127 205 5 0 0 0 - - -;
#X text 34 97 Guess first \, then click:;
#X obj 52 183 +;
#X text 286 63 tigger (short "t") outputs from right to left. Almost
all (builtin) objects evaluate from right to left \, too.;
#X obj 633 331 t b b;
#X msg 633 310 bang;
#X obj 633 351 timer;
#X floatatom 633 373 5 0 0 0 - - -;
#X text 474 340 [timer] doesn't:;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X connect 2 1 1 1;
#X connect 4 0 10 0;
#X connect 4 0 10 1;
#X connect 6 0 7 1;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 10 0 5 0;
#X connect 12 0 14 0;
#X connect 12 1 14 1;
#X connect 13 0 12 0;
#X connect 14 0 15 0;


More information about the Pd-list mailing list