[PD] [datastruct] calculations inside drawing instructions

federico xaero at inwind.it
Tue Apr 5 18:48:05 CEST 2005

after getting to work the array version of my multipoint-envelope, i 
want to create a classic ADSR envelope, without using arrays.

i created a datastruct with fields: x, y, a, d, s, r
it is drawed with:
[drawpolygon 700 2  0 0  a -100  d s  r 0]

but this is wrong, because if you set attack=90 and decay=20, you get a 
weird line, that is not the classic ADSR envelope rapresentation.

in the fact, the X/Y pairs to draw the polygon, should be:

{0,0} {a,-100} {a+d,s} {a+d+r,0}

(i used brackets to group points)
but it seems that is not possible to put calculations inside drawing 
so, how this task can be accomplished?

i think it is a good idea begin a thread to talk about what 
datastructures miss, because it is a lot important to have the 
possibility to do calculations inside those drawing instructions.
(another clamorous example is setting limits/constraints on dstruct's 
fields, i.e. not allowing negative numbers)
i hope there is someone interested in this discussion,
cause i'm starting to love datastructures exactly in the moment i 
discover what they miss. isn't this fun? :D

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dstruct_adsr.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20050405/188ea4a8/attachment.txt>

More information about the Pd-list mailing list