Closed devongovett closed 12 years ago
Nope, you didn't miss anything, except that it could have some analog flavor to it as well, but that's your call. ;)
Answers:
OK, assuming the numbers after the note names are the octaves on a standard piano?
Yes, according to the MIDI numbering scheme: {A0: 27.5Hz, A4: 440Hz}
Alright, so this isn't totally done yet, but I thought I'd show a work in progress and get some feedback. Here's what I've got so far:
Obviously I'm still working on finding a place to put what octave of the note is being played as well as the volume here, but as you can see, the general idea is that the wheel of notes rotates so that the note being played is pointed at by the green arrow. When the note isn't in tune the arrow will look grayish instead of green and either the sharp or flat sign will light up in red to highlight which direction it is off in, and the difference from the actual pitch is shown by the rotation of the wheel (the arrow will point between notes). Obviously the actual frequency will be displayed in the digital screen at the bottom. The "pitch.js" text will probably not be there. :)
Questions:
Let me know what you think!
Alternatively, here's a version with a crack at showing the octave. I think volume isn't actually really necessary or that useful to show here, but octave is for most people who don't know the frequencies off hand. :)
Might be a little crowded... Thoughts?
Actually, if the UI is going to be like that, it's probably simplest if the only input it takes is the frequency. The rest are pretty easily derived from that, let's assume the note wheel's angle is in radians and at zero, it's C:
function getNote (frequency, reference) {
if (!frequency) return null;
reference = reference || 440;
return 69 + 12 * Math.log(frequency / reference) / Math.LN2;
}
function getAngle (midiNote) {
return midiTone ? Math.PI * (midiNote % 12) / 6 : 0;
}
function getOctave (midiNote) {
return ~~(midiNote / 12);
}
Widget mockup:
A repo for the demo.
To curious outsiders: don't worry, the repo will become open as soon as we release the Kraken!
404'ing for me too... Should we just put the UI in a folder on this repo?
The permissions should be fixed now!
OK, awesome. Pushed. Closing this issue now. Resume tracking on that repo.
Sorry about the wait on this. If I remember correctly, you need something that looks like one of those digital tuners that shows what note you're playing, the percentage error, and how loud you're playing. Did I miss anything?
Questions:
Let me know, and I'll get coding! :)