Exact frequencies of notes #664
-
Hi! Just found this beautiful lib when working on building my own (sort of) synth, but I was just wondering about the notes and their frequencies when using the sine wave generator. I've had problems myself generating waveforms in the correct pitch when dabbling with this on my own, generating some "interesting" wobbles when playing two notes at the same time for instance. I read an interesting article (can't find it again unfortunately) about a case study where the participants could perceive a difference in frequency down to about 0.3% in the mid-range audible frequencies. So, how exact are the frequencies generated for different notes? Are they down to below where you can hear if they're out of tune? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
That's an interesting question and I never looked into it. I just recently changed the frequency of the notes from integers to float, so it should be better then in the beginning of the project. I would also expect that it might depend on your selected generator implementation. The SineWaveGenerator should be the most exact, but not the fastest implementation because it relies on the sine() function. It would be cool if you could spend some time in analyzing this... |
Beta Was this translation helpful? Give feedback.
-
I'm already looking in to it, but got stuck on the first try :P I'm trying to use the Synthesizer to generate two sine waves at the same time, but for some reason when running the code below it still outputs a clean sine wave (no mix of two different ones) and also the frequency is about twice that of the last set note. I started poking around and my only guess is that since the
|
Beta Was this translation helpful? Give feedback.
-
Oh, I haven't looked at that class for a long time and there were many changes after I created it. I will have a look on Monday. |
Beta Was this translation helpful? Give feedback.
-
Sounds like this may be similar problem to what I had a few months ago.... see link below.... At that time I was trying with an ESP32 PICO KIT using the sound out on internal DAC pins 25 and 26....... never got a solution always get beats when playing 2 sounds that should sound in tune eg playing a sound and its octave or playing a sound and another one one say 4 times higher. |
Beta Was this translation helpful? Give feedback.
That's an interesting question and I never looked into it. I just recently changed the frequency of the notes from integers to float, so it should be better then in the beginning of the project. I would also expect that it might depend on your selected generator implementation.
The SineWaveGenerator should be the most exact, but not the fastest implementation because it relies on the sine() function.
It would be cool if you could spend some time in analyzing this...