3 ms·
I think it is more a pitch thing. Playing the scale up from C, the F sounds off. Not sure why. My first guess was it was a sample just playing at different spee
by issa 4y ago
I think it is more a pitch thing. Playing the scale up from C, the F sounds off. Not sure why. My first guess was it was a sample just playing at different speeds and that was causing some issues.
- moosedev 4y agoYou have a better ear than you think! I tried it again (and actually tried all the notes this time...) and the F is definitely flat. It's particularly noticeable in the 5th octave (i.e. if you play C5 D5 E5 F5), but all the F's appear to have the issue. I verified (by ear) against Pianoteq set to equal temperament. The other notes sound OK. The A and B might be a tiny bit flat too but my ear isn't good enough, and if they're flat they're nowhere near as far off as the F. OP, how are you specifying notes/pitches to the synthesizer?
- jnkkkk 4y agoI implemented the synthesizer from scratch. Honestly I'm not super familair with digital synthesizer theory and for the implementation, mostly I referred to this article https://keithwhor.com/music/ https://keithwhor.com/music/ The code of my implementation is at https://github.com/JNKKKK/pianochord.io/blob/master/src/libs/audiosynth.ts https://github.com/JNKKKK/pianochord.io/blob/master/src/libs... I guess it't not a good choice to implement that part on my own, since there are many good libraries out there, like tone.js. I will probably deprecate my own synthesizer implementation and use tone.js.
- moosedev 4y agoYour F, defined on line 26 [0], is 3Hz off according to this reference table[1]. 346.23 should be 349.23. Just a typo? All credit to @issa's ear. And yes, while you'd be unlikely to have encountered this bug if you were just telling a good existing synth to play an F, it's cool that you implemented the synth from scratch! Whether it's a good choice depends on the project goals. [0] https://github.com/JNKKKK/pianochord.io/blob/master/src/libs/audiosynth.ts#L26 https://github.com/JNKKKK/pianochord.io/blob/master/src/libs... [1] https://pages.mtu.edu/~suits/notefreqs.html https://pages.mtu.edu/~suits/notefreqs.html
- jnkkkk 4y agoAh! Nice catch!! I didn't even notice that. My expectation for this project is focusing mainly on the music theory part and visualization. So I guess using a good existing synth will make my life eaiser. Thanks again!
- issa 4y agoha. Full disclosure, I spent a decade as a professional musician and another decade as an audio engineer at a recording studio. I've just always had terrible pitch. Grew up completely tone deaf, but managed to train myself to hear notes eventually over the years. These days I'm very out of practice, but I could tell SOMETHING sounded funny. In case this didn't come through, the site is amazing!