[PD] [datastruct] calculations inside drawing instructions

Bernhard Neugebauer bernhard.neugebauer at student.kug.ac.at
Fri Apr 8 16:10:02 CEST 2005

>>> federico <xaero at inwind.it> 05.04.05 18.48 >>>
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]


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


I don t know an easier way to do this than to define
[drawpolygon 700 2 0 0 a -100 x1 s x2 0]
and to compute
somewhere else in the patch.

Perhaps you want to compare your solution to the datastruct  adsr
envelope which is in Frank Barknecht s data structures tutorial:
it s file 18-tut.pd, and you have to have grob-library.pd open


More information about the Pd-list mailing list