Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upEffects w inheritance #178
Conversation
jvntf
added some commits
Jun 12, 2017
This comment has been minimized.
This comment has been minimized.
this is looking good! Is it still in progress? |
jvntf
changed the title
Effects w inheritance (WIP)
Effects w inheritance
Jun 20, 2017
This comment has been minimized.
This comment has been minimized.
not in progress! But I have used continued to use |
therewasaguy
approved these changes
Jun 20, 2017
looks great, I'm going to merge this but I left a comment about documentation—let's figure out a plan to preserve documentation for children of p5.Effect so that users know they have |
@@ -1,4 +1,4 @@ | |||
/*! p5.sound.js v0.3.3 2017-06-06 */ |
This comment has been minimized.
This comment has been minimized.
therewasaguy
Jun 20, 2017
Member
For the next PR, let's hold off on adding the lib to commits—it'll make it easier to review because we can just focus on the src/
and test/
files.
|
||
this.input = this.ac.createGain(); | ||
this.output = this.ac.createGain(); | ||
p5.Effect.call(this); |
This comment has been minimized.
This comment has been minimized.
therewasaguy
Jun 20, 2017
Member
p5.Effect
works because of the order of app.js, but it's safer not to depend on that and to instead require dependencies explicitly. Try to use Effect
, since that's what we required on line 6. Same goes for Filter
, if you feel like cleaning up the lines that refer to p5.Filter
(if you don't get to it in this PR, I will be happy to)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
this.input.disconnect(); | ||
this.output.disconnect(); | ||
Effect.prototype.dispose.apply(this); | ||
|
||
this._split.disconnect(); | ||
this._leftFilter.disconnect(); | ||
this._rightFilter.disconnect(); |
This comment has been minimized.
This comment has been minimized.
therewasaguy
Jun 20, 2017
Member
these are p5.Filters, so we should call dispose instead of disconnect to dispose of all its resources/references
this._leftFilter.dispose();
this._rightFilter.dispose();
This comment has been minimized.
This comment has been minimized.
// * @method connect | ||
// * @param {Object} unit | ||
// */ | ||
// p5.Distortion.prototype.connect = function(unit) { |
This comment has been minimized.
This comment has been minimized.
therewasaguy
Jun 20, 2017
Member
hmm, we should probably keep documentation like this within each class/module, even though the methods are covered in p5.Effect module. These documentation blocks determine what shows up on https://p5js.org/reference/#/p5.Distortion methods section.
Another way to handle it might be to create documentation for p5.Effect, and then each class that inherits from p5.Effect includes a link in the documentation saying "inherits methods from p5.Effect".
}; | ||
|
||
/** | ||
* Send output to a p5.sound or web audio object |
jvntf commentedJun 13, 2017
done: delay, reverb, distortion