[PD] Local "variable" names question + messages

JaReK myszewsk at cse.Buffalo.EDU
Mon Aug 19 04:28:02 CEST 2002

Hello. I'm working on a composition project that uses probability (markov
chains) approach + more stuff.

I was trying to build a 'generic' object that would consist of 3 tables
(arrays actually) which hold (pitch #, velocity #, duration #).

Suppose I name this object (patch)   'pattern'

Now, when I create new project (new pd patch), I can insert the newly
created object using the    'pattern p1' 'pattern p2'  etc technique.

To make sure that the table names in each 'pattern' instantiated do not
conflict, I used the $1 technique as part of array names.  ($1-pitch,
$1-velocity etc).  Now, when I set up all the 'patterns' and play things
work fine.

Problem is, how to store what I did set up, esp. taking into consideration
that there may be 15 patterns instantiated.

I attempted to write to files the contents of arrays using the message
however, when I reference $1-pitch.txt inside a message box (as a
filename I wish to write to), there's a
problem. $1 no longer pertains to the name I gave to the 'paattern', it
pertains to the message context itself (I'm not exactly sure to what).

Is there a way to get around this context issue? How to pass the the
message box the name of patch this message box resides in?

I'm trying to build
a generic object that I may reuse. Of course, quick fix is to make all
array names distinct numerically (array1 array2 etc) - however - in a long
term, that solution is not very professional (headache).

thanx for suggestions

  "Only two things are infinite, the universe and human stupidity, and I'm
			  not sure about the former."

			     - Albert Einstein

More information about the Pd-list mailing list