Skip to content

Maker: Fix note() function#14332

Merged
islemaster merged 1 commit intostagingfrom
maker-fix-note
Apr 12, 2017
Merged

Maker: Fix note() function#14332
islemaster merged 1 commit intostagingfrom
maker-fix-note

Conversation

@islemaster
Copy link
Contributor

Override johnny-five's Piezo.prototype.note because it's playing the wrong frequencies, at least in Maker Toolkit. I think this is a bug in their component and I'm working on getting it fixed upstream. In the meantime it's fairly easy to patch in a fix in our wrapper.

Bug easily repro'd in this app, in which all three buttons should play an A4 (440Hz) but calling note('A4') obviously plays a different pitch.

Override johnny-five's Piezo.prototype.note because it's playing the wrong frequencies.
/**
* We override johnny-five's note() function because there seems to be a bug
* where it computes the frequency incorrectly.
* If that bug gets fixed, we should be able to remove this patch.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might be nice to mention here that we'll also want to remove the tests for the patch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually might leave the tests - I've been adding unit tests in our project covering behaviors we particularly care about from Johnny-Five.

@islemaster islemaster merged commit 3f15941 into staging Apr 12, 2017
@islemaster islemaster deleted the maker-fix-note branch April 12, 2017 16:09
@rwaldron
Copy link

Hi! Let's get things fixed! :D

cc @lyzadanger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants