-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement pitch.getEnharmonic(). #249
base: master
Are you sure you want to change the base?
Implement pitch.getEnharmonic(). #249
Conversation
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.
Hi Greg! Congrats on the first PR. Can you add a test to js_tests/module_tests/pitch (just follow the formula there) to make sure that it works as expected w/ both inPlace=True and not inPlace=True.
grunt test
is your friend to make sure that tests pass.
Thanks! Other comments below.
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.
Hi Greg. I think you misunderstood. We should return the new pitch if not inPlace or the original if inPlace. There is no point in returning "this" if all the manipulations were done to "p" instead
In _getEnharmonicHelper, p is self.clone(). Everything is done to p, which is then returned if not inPlace. If inPlace, everything is copied from p to self, which is then returned. I believe this works correctly. I actually prefer the pattern I used in getEnharmonic (post is either self or self.clone(), and you do everything to post, and return post); would you like that pattern in _getEnharmonicHelper? |
@mscuthbert Do you agree that _getEnharmonicHelper is actually correct? Or would you rather I follow getEnharmonic's pattern? |
Sorry not to reply -- I prefer your way of doing it. |
I can't tell for sure, do you want a change or not? |
No description provided.