-
-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replacement es5 functions to es6 classes feat p5.Oscillator #533
Conversation
src/app.js
Outdated
import './oscillator'; | ||
|
||
import Oscillator, { SinOsc, TriOsc, SawOsc, SqrOsc } from './oscillator'; | ||
console.log(Oscillator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(Oscillator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change will break the noise
and pulse
modules that assume p5.Oscillator already exists. Looks like that'll be fixed in an upcoming PR
src/oscillator.js
Outdated
// ========================== // | ||
|
||
// return sigChain(this, scale, thisChain, nextChain, Scale); | ||
class sigChain { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigChain
shouldn't be a class, since we're not calling it with the new
keyword, it can just remain a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling a method like add
that calls sigChain
results in
Uncaught TypeError: Cannot call a class as a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple small changes for this one
@therewasaguy made some changes , please have a look! |
@therewasaguy @kyle1james tests are smooth
need a review here ! thanks!