Open PSLLSP opened 5 years ago
Hi I'm Ben from Meet Edison
Edison was designed to be an affordable computer science learning tool for students at the earlier stages of their journey into coding. While we have always aimed to make Edison a powerful tool with a wide range of capabilities, in lots of ways, the ‘guts’ of Edison are incredibly simple. It appears there is an issue in the firmware that is playing lower notes than expected
However, as the note played is simply 2 octaves lower, and is still the same musical note (c5 and c7 are both c). This is not a major bug and will not be added to our bug backlog
Additionally, this repository is not the best place to report bugs and issues. We do not continuously monitor this repository. For future bugs and issues, please send them directly to us, via our contact form: https://meetedison.com/edison-robot-support/contact-us/
Maybe that documentation is just not correct. I read again chapter related to Ed.PlayTone() and it has two formulas to calculate period, first parameter of PlayTone():
1) To convert a frequency into a period, divide the number 8,000,000 by the desired frequency. For example, to play a 1kHz (1000 cycles per second) sound: 8,000,000/1,000 = 8,000
2) To determine the period to use to exactly match the Ed.NOTE constants, divide the number 32,000,000 by the desired frequency of that musical note and use the result as the note input parameter.
Point 1) is at the begging and point 2) is at the end of the chapter. I tried to verify what is correct with Audacity software (audio editor), I used FFT filter and I think that first formula is correct and values for notes are really shifted.
Ed.PlayTone(note, duration) plays wrong tones. Ed.NOTE_x_y constants are wrong.
https://meetedison.com/content/EdPy-app-documentation-guide.pdf http://pages.mtu.edu/~suits/notefreqs.html
There is a formula in documentation how to calculate parameter tone from frequency. note = 8000000/freq, for freq 1kHz is calculated note 8000.
Ed.NOTE_C_7 has value 15289 and it should play frequency 2093Hz that is really C7. In the real, value 15289 plays frequency 523Hz, that is C5 (8000000/15289 is 253.25Hz).
I have no idea what is source of this confusion why C5 tone is marked as C7 tone.