[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}
--------------------------------

Hello,

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
x1=a+d
x2=a+d+r
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:
http://puredata.info/community/projects/convention04/lectures/tk-barknecht/tut.tgz
it s file 18-tut.pd, and you have to have grob-library.pd open

Bye
Bernhard




More information about the Pd-list mailing list