Skip to content
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

Updated the soundLoop.interval #458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

parulpriyedarshani
Copy link
Contributor

Solves issue #313
Initialized the desiredInterval to zero and set the soundLoop interval of 0.

@parulpriyedarshani parulpriyedarshani changed the title Loop Updated the soundLoop.interval Apr 28, 2020
@parulpriyedarshani
Copy link
Contributor Author

parulpriyedarshani commented Apr 28, 2020

@therewasaguy Kindly, please review this PR.

Copy link
Member

@therewasaguy therewasaguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you! Just requesting some small changes.


let desiredInterval = 0;

SoundLoop._interval = max(desiredInterval, 0.01);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm, SoundLoop doesn't exist, instead we have a function called p5.SoundLoop that exists on the p5 object.

We don't want to set _interval on the class, but not on the instance (which is represented by this).

That is happening on line 66. So we should do this check on that line.

@@ -65,6 +65,12 @@ define(function (require) {

this._interval = interval || 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do the check on this line? this._interval = Math.max(interval, 0.01) ? And then, the question is how can we set the default? We could set the default in the constructor function on line 57, by saying interval = 1 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters

Base automatically changed from master to main March 5, 2021 02:53
Copy link
Contributor

@Abhijay007 Abhijay007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parulpriyedarshani the code is iterated a lot in the past year, I am not sure if the soundLoop.interval problem still exists or not, can you please look into this once? due to branch change it has some merge conflicts too that need to be addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants