Implement pitch.getEnharmonic().#249
Implement pitch.getEnharmonic().#249gregchapman-dev wants to merge 2 commits intocuthbertLab:masterfrom
Conversation
mscuthbert
left a comment
There was a problem hiding this comment.
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.
mscuthbert
left a comment
There was a problem hiding this comment.
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.