@@ -87,16 +87,6 @@ define(function (require) {
87
87
this . _leftFilter . disconnect ( ) ;
88
88
this . _rightFilter . disconnect ( ) ;
89
89
90
- /**
91
- * Internal filter. Set to lowPass by default, but can be accessed directly.
92
- * See p5.Filter for methods. Or use the p5.Delay.filter() method to change
93
- * frequency and q.
94
- *
95
- * @property lowPass
96
- * @type {p5.Filter }
97
- */
98
- this . lowPass = this . _leftFilter ;
99
-
100
90
this . _leftFilter . biquad . frequency . setValueAtTime ( 1200 , this . ac . currentTime ) ;
101
91
this . _rightFilter . biquad . frequency . setValueAtTime ( 1200 , this . ac . currentTime ) ;
102
92
this . _leftFilter . biquad . Q . setValueAtTime ( 0.3 , this . ac . currentTime ) ;
@@ -298,4 +288,32 @@ define(function (require) {
298
288
this . output . disconnect ( ) ;
299
289
} ;
300
290
291
+ p5 . Delay . prototype . dispose = function ( ) {
292
+ // remove reference from soundArray
293
+ var index = p5sound . soundArray . indexOf ( this ) ;
294
+ p5sound . soundArray . splice ( index , 1 ) ;
295
+
296
+ this . input . disconnect ( ) ;
297
+ this . output . disconnect ( ) ;
298
+ this . _split . disconnect ( ) ;
299
+ this . _leftFilter . disconnect ( ) ;
300
+ this . _rightFilter . disconnect ( ) ;
301
+ this . _merge . disconnect ( ) ;
302
+ this . _leftGain . disconnect ( ) ;
303
+ this . _rightGain . disconnect ( ) ;
304
+ this . leftDelay . disconnect ( ) ;
305
+ this . rightDelay . disconnect ( ) ;
306
+
307
+ this . input = undefined ;
308
+ this . output = undefined ;
309
+ this . _split = undefined ;
310
+ this . _leftFilter = undefined ;
311
+ this . _rightFilter = undefined ;
312
+ this . _merge = undefined ;
313
+ this . _leftGain = undefined ;
314
+ this . _rightGain = undefined ;
315
+ this . leftDelay = undefined ;
316
+ this . rightDelay = undefined ;
317
+ }
318
+
301
319
} ) ;
0 commit comments