-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
RP2040 is out of tune #251
Comments
Looking more closely at the code, I think the problem comes from:
(from |
Probable way out: https://arduino-pico.readthedocs.io/en/latest/pwm.html (using the PWM Audio class) Note that it might remove the possibility to have an accurate |
Yes, that looks useful in its own right, but also, yes, we need to fix the timers anyway (for external timed). One approach to fixing could be to internally keep |
I am not sure I am following you on this. Whatever we do, the alarms on the RP2040 have a microsecond precision (only My plan so far is to reimplement the default output with PWM audio (which is DMA buffered and so on ;) !). I will try to keep the external timed as it is now, knowing that it is not on tune. |
Which, again, will be useful in it's own right, so by all means, do.
In effect, I'm aiming for the latter:
So we'll try to output the first sample at 30us, the second at 61, then 91, 122, etc, and sample no 100 at 3051us. In an ideal world we wouldn't have any jitter at all, but I do think this will be much less noticeable than being 1.6% off on the frequency. |
Making a small drone synth to play along, I noticed that a simple setup, based on a RP2040 with PWM output, seems to be out of tune (looks like something similar than #67 ).
Here are some measurements ("Sinewave" sketch, CPU speed: 133MHz (this does not seem to affect):
Looks fairly stable, hence the timer is probably off by that amount.
The text was updated successfully, but these errors were encountered: