#error Whoopsie, not LSHIFT defined for this audio rate. Please report and/or fix

37 views
Skip to first unread message

Vale Mono

unread,
Jul 20, 2025, 7:48:30 AMJul 20
to Mozzi-users
Hi everyone, I get the error reported in the title when I try to set the #define MOZZI_AUDIO_RATE parameter to 65536 or a value higher than 32768 with an external i2s dac (pcm5012) for arduino-pico (rp2040)

tomco...@live.fr

unread,
Jul 21, 2025, 4:35:19 AMJul 21
to Mozzi-users
Hi,
Indeed, there was a typo in the code that got corrected (see https://github.com/sensorium/Mozzi/pull/306) but the fix is not in the last release yet.
Three solutions depending on what you want to do:
 - switch to the development version of Mozzi, if you are familiar with git
 - implement the fix yourself in your copy of Mozzi, only one line: https://github.com/sensorium/Mozzi/pull/306/files
 - wait for the next version of Mozzi which I can try to publish soon (say, a couple of weeks) and fallback to 32k for now.

Thanks for pointing that out!
Tom

Vale Mono

unread,
Jul 21, 2025, 10:33:56 AMJul 21
to Mozzi-users
tankyou very much, the problem of Audio_rate is solved.

I wanted to ask, now that I can set audio_rate to 65536, how can I use it with one of the examples provided with the library, such as the Control_Gain example, since during compilation it tells me: 
exit status 1 Compilation error: narrowing conversion of '65536' from 'int' to 'short unsigned int' [-Wnarrowing].

Sorry, I'm a newbie. Thanks.

tomco...@live.fr

unread,
Jul 21, 2025, 11:07:07 AMJul 21
to Mozzi-users
Indeed, reproduced here.

This audio_rate has not been receiving a lot of testing, thanks for reporting this!!
I have open an issue here: https://github.com/sensorium/Mozzi/issues/313 and will try to have a look shortly.

You can use 32768 rate which has been way more tested until this is fixed! Switching to the new rate (once it is fixed) can be just done with one line of configuration. Note that 32k is already quite enough for most audio/music application

Thanks for the report!

Vale Mono

unread,
Jul 22, 2025, 11:54:34 AMJul 22
to Mozzi-users
Ok tankyou!!!
Reply all
Reply to author
Forward
0 new messages