'From Squeak3.7 of ''4 September 2004'' [latest update: #5988] on 15 September 2004 at 10:29:41 am'! "Change Set: Envelope-removeshowOnDisplay Date: 13 September 2004 Author: tim@sumeru.stanford.edu Whilst investigating some (ab)uses of Display I noticed some methods needing removal/cleanup in Envelope"! !Envelope class methodsFor: 'instance creation' stamp: 'tpr 9/13/2004 12:00'! example "Envelope example" | p | p _ Array with: 0@0 with: 100@1.0 with: 250@0.7 with: 400@1.0 with: 500@0. ^ (self points: p loopStart: 2 loopEnd: 4) sustainEnd: 1200. ! ! !Envelope class methodsFor: 'instance creation' stamp: 'tpr 9/13/2004 12:00'! exponentialDecay: multiplier "(Envelope exponentialDecay: 0.95) " | mSecsPerStep pList t v last | mSecsPerStep _ 10. ((multiplier > 0.0) and: [multiplier < 1.0]) ifFalse: [self error: 'multiplier must be greater than 0.0 and less than 1.0']. pList _ OrderedCollection new. pList add: 0@0.0. last _ 0.0. v _ 1.0. t _ 10. [v > 0.01] whileTrue: [ (v - last) abs > 0.02 ifTrue: [ "only record substatial changes" pList add: t@v. last _ v]. t _ t + mSecsPerStep. v _ v * multiplier]. pList add: (t + mSecsPerStep)@0.0. ^ self points: pList asArray loopStart: pList size loopEnd: pList size ! ! Envelope removeSelector: #showOnDisplay!