New things in Mozzi

848 views
Skip to first unread message

tomco...@live.fr

unread,
Jan 25, 2021, 10:44:16 AM1/25/21
to Mozzi-users

Hi all,
Just to mention that a lot of work done by tfry-git has just been merged into Mozzi! The aim was to simplify and enhance the behavior of Mozzi over the different platform supported.
For details you can refer to the pull request discussion (https://github.com/sensorium/Mozzi/pull/98) but in short:
  • the AUDIO_RATE is now automatically adjusted by default depending on the platform (16k on AVR, 32k on more powerful platforms like STM32, ESP). This can be overriden in mozzi_config.h
  • an auto-scaling capability has been added, this allows to have the same code running on all platforms even if the number of outputted bits is different. Mozzi takes care of right/left shifting if necessary as long as you give it the number of bits of your output. As an example:
 int updateAudio(){ return oscil.next(); }
/* becomes */
AudioOutput_t updateAudio(){ return MonoOutput::from8Bit(oscil.next()); }
here we have indicated to Mozzi that the return value is 8 bits. If the platform is outputting 10, Mozzi will automatically shift the output in order to fill the 10 bits.

Note that this does not break any existing sketches in Mozzi (normally). This feature can be used, or not, depending on you. All the examples have been updated for this new paradigm
  • the EXTERNAL_AUDIO_OUTPUT capability has been improved to work on all platforms. For this case, you might need to configure Mozzi correctly (mozzi_config.h), including the number of bits your external hardware expects. It is likely that sketches using this capability are now broken, but should be easily fixed. The examples in Mozzi on this have been updated.
  • The porting of new platforms should now be way more easy as the changes in MozziGuts should be minor, all the platforms dependent details have been moved to specific files.
Have fun with Mozzi!

Gonzalo Sandoval

unread,
Mar 10, 2021, 8:06:55 PM3/10/21
to Mozzi-users
ohhh Great, thanks Tom.
I am researching the raspberry pi pico a new toy, it would be great to start a library for this wonderful microcontroller.

Gonzalo Sandoval
descarga (2).jfif

dan snazelle

unread,
Mar 10, 2021, 8:59:05 PM3/10/21
to mozzi...@googlegroups.com
This is amazing news 

Thanks for all your hard work 

Sent from my iPhone

On Jan 25, 2021, at 10:44 AM, tomco...@live.fr <tomco...@live.fr> wrote:


--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/a8953151-85c6-4d57-aa1f-458beda69baen%40googlegroups.com.

dtr....@gmail.com

unread,
May 18, 2021, 5:22:02 AM5/18/21
to Mozzi-users
Great!

Going into another round of ESP32+PT8211 development here and will be sure to give this a good test run.

Greetings, Dieter

Tarcisio León Drusin

unread,
Jun 1, 2021, 10:28:03 AM6/1/21
to Mozzi-users
Tom thanks to your work! I've been using mozzi for years now.
I downloaded this new version but I get a compilation error in IDE 1.0.5 r2.
In IDE 1.8.12 it compiles fine but the external DAC FMSynth example stutters.
I am using an Arduino UNO.

This is the compiation error that comes from 1.0.5 r2 IDE:

In file included from C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/Oscil.h:24,
                 from FMsynth.ino:26:
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h: In function 'T mozzi_pgm_read_wrapper(const T*)':
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:22: error: there are no arguments to 'static_assert' that depend on a template parameter, so a declaration of 'static_assert' must be available
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:22: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h: In function 'T mozzi_pgm_read_wrapper(const T*) [with T = double]':
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:35: error: 'static_assert' was not declared in this scope
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:38: error: expected primary-expression before '{' token
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:38: error: expected ';' before '{' token
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:38: error: expected `;' before '}' token
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:38: error: expected primary-expression before '.' token
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h: In function 'T mozzi_pgm_read_wrapper(const T*) [with T = uint64_t]':
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:38:   instantiated from here
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:22: error: 'static_assert' was not declared in this scope
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h: In function 'T mozzi_pgm_read_wrapper(const T*) [with T = signed char]':
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:48:   instantiated from 'T FLASH_OR_RAM_READ(T*) [with T = const signed char]'
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/Oscil.h:153:   instantiated from 'int8_t Oscil<NUM_TABLE_CELLS, UPDATE_RATE>::phMod(Q15n16) [with unsigned int NUM_TABLE_CELLS = 2048u, unsigned int UPDATE_RATE = 32768u]'
FMsynth.ino:114:   instantiated from here
C:\Program Files\Arduino-1.0.5-r2 (mozzi)\libraries\Mozzi/mozzi_pgmspace.h:22: error: 'static_assert' was not declared in this scope

Tarcisio León Drusin

unread,
Jun 1, 2021, 6:21:16 PM6/1/21
to Mozzi-users
For future reference, Tom said to me:
I think this is normal that you get a compilation error with 1.0.5: the latest changes of Mozzi made it incompatible with it I think.

tomco...@live.fr

unread,
Feb 10, 2023, 8:34:43 AM2/10/23
to Mozzi-users
Hi all,
Been quite a while since but Mozzi kept evolving! Here is a quick summary of the new things:

FIX
- some fixes have going on for Teensy 3 and STM32, both of them concerning ADC readings
- STM32 is now supported with the newest version of STM32_arduino

Port
- Teensy LC is now ported
- Teensy 4 are now ported
- RP2040 (Raspberry Pico) is now ported with both PWM output and native I2S
All of these also support the EXTERNAL_AUDIO_OUTPUT, which let you define the way to output the sound (for instance by using a SPI DAC).

New features
- a Wavefolder has been added
- the LowPassFilter has been quite worked on:
  - the resonance is now more consistant on the whole range
  - its parameters can now be on 16bits scale if needed. It can also work on bigger samples
  - other types of filters (HP, BP and Notch) has been derived from it. It is also possible to have one filter that output all the filter types with the MultiResonantFilter.

Under the hood
A lot of work also happened to make porting of new board easier. If you port something new, or test something that is not listed but works, let it know.


Have fun!
Reply all
Reply to author
Forward
0 new messages