[PD] Strange "bug" with table behaviour

Burton Samograd kruhft at shaw.ca
Tue Jun 18 12:53:06 CEST 2002


Miller (or anyone else with more time to find this bug..ahem...feature 
:),

I ran into quite a frustrating bug when designing my step sequencer.  
I'm currently running pd-0.35-test26 on linux.  I was using the table 
object so i could create local arrays for each sequencer using $1.  But 
it seems that when the patch is saved, it saves the array name in the 
patch file (ie. if you gave an argument test to the subpatch, the array 
$1_array would be saved as test_array instead of $1_array).

The problem was that when I tried testing with 2 patches the array 
wasn't being created for each instance since it had already been 
created by the patch before it was saved (does that make any sense???) 
so i would get "test_array multiply defined" messages whenever i would 
try to write to it.

I then remembered an email i read a while back saying that pd now 
allows $1's in array names so i tried that and it worked like a charm.  
My problem is solved but I thought i would inform you of this 
behaviour, or if you already knew it existed, maybe you could enlighten 
me on why it is done that way...

Although I don't know the details of the internal structure of the 
program compeletely, I would think that when saving the table object 
should somehow hide the array so the name isn't written to the file, 
since i assume that on loading the table creates the array if it 
doesn't already exist...

So there's a couple of my $0.02 on the subject.

burton samograd



More information about the Pd-list mailing list