Mozzi 2.0

32 views
Skip to first unread message

tomco...@live.fr

unread,
Jun 11, 2024, 6:21:26 PMJun 11
to Mozzi-users
A new major version, a new mosquito genus!

Mozzi have undergone a fairly big overhaul! Before an automatic changelog, here is an overview of what has changed.

## Configuration at the sketch level

The biggest change (at least internally) concerns the way you can configure Mozzi.
Configuration of Mozzi (if desired) is now done in the user sketch itself. This removes the need to fiddle inside Mozzi's sources when using different configurations (EXTERNAL_AUDIO_OUTPUT, STEREO, etc…). For instance in order to use stereo, with an external DAC which timing is controlled by Mozzi, you just need to add:
```
#include "MozziConfigValues.h"  // for named option values
#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_EXTERNAL_TIMED
#define MOZZI_AUDIO_CHANNELS MOZZI_STEREO

#include <Mozzi.h> // note the change from MozziGuts.h, old fashion still works with a warning
```
at the top of your sketch. Refer to the examples and the documentation for more on this!


## Scaling of analog reads
In order to further improve the compatibility between platforms, the range of the analog reads (`mozziAnalogRead`) can be explicitly specified:
 - or at the sketch level with the config option: `define MOZZI_ANALOG_READ_RESOLUTION 10`
 - or/and for every analog reads, for instance: `mozziAnalogRead<10>(pin);`

Not doing this will fall back on the platform native range (just like Mozzi 1) but will issue a warning (and is not advised).

## New fixed point math

A new paradigm for fixed point math arithmetic has been added. This leverages on [FixMath](https://github.com/tomcombriat/FixMath) which has spawned from Mozzi's development. The goal of this library is to automatized, at the compiler level, the calculations of the range and precision needed for a fixed point type, making coding easier and overflows impossible. Mozzi's functions that were already using fixed point (old paradigm) have been adapted to this! The old way of using fixed point math is still available.

This becomes a requirement for installing Mozzi. If you install Mozzi via the library manager this should be automatically done.

More info on the [FixMath](https://github.com/tomcombriat/FixMath) page and in Mozzi's examples!



## Bugfix/improvements

 - the rate at which `updateControl()` was called was slightly off. This had only consequences in some very specific cases (#253) but is now corrected (#256)
 - the RP2040 (Raspberry Pico) was not on-tune, this is fixed (#254)
 - twi_nonblock only compiled when needed (#242)
 - some of the ways Mozzi functions internally have been rationalized and improved

## Compatibility
This release is *not* 100% source compatible to earlier versions of Mozzi. Most sketches will continue to compile, but with warnings. Some will need adjustments to keep working. See https://sensorium.github.io/Mozzi/learn/porting/ . If porting is not an option, install an earlier (1.x) version of Mozzi, or use the "Mozzi_1" branch in git.

## Change of licence
Mozzi has now changed to [LGPL](https://www.gnu.org/licenses/lgpl-3.0.en.html) license! (#240)


# Changelog
## What's Changed
* Mozzi 2.0 - Start config rework by @tfry-git in https://github.com/sensorium/Mozzi/pull/211
* Replaced unsigned long into uint32_t for Oscil. by @tomcombriat in https://github.com/sensorium/Mozzi/pull/221
* Devel/workflow updates by @tfry-git in https://github.com/sensorium/Mozzi/pull/227
* mozzi_midi as header only by @tomcombriat in https://github.com/sensorium/Mozzi/pull/222
* Single compilation unit / In-line configuration by @tfry-git in https://github.com/sensorium/Mozzi/pull/224
* Implementing auto Range for FixMath by @tomcombriat in https://github.com/sensorium/Mozzi/pull/233
* Draft: Mozzi 2.0 miscellanious small stuff by @tfry-git in https://github.com/sensorium/Mozzi/pull/230
* Devel/teensy by @tfry-git in https://github.com/sensorium/Mozzi/pull/235
* FixMath2.0 by @tomcombriat in https://github.com/sensorium/Mozzi/pull/212
* Removed FixMath from Mozzi's sources by @tomcombriat in https://github.com/sensorium/Mozzi/pull/238
* Scaling for analog reads by @tfry-git in https://github.com/sensorium/Mozzi/pull/239
* Switch to LPGL by @tfry-git in https://github.com/sensorium/Mozzi/pull/240
* Specializations of Mozzi classes for U/SFix by @tomcombriat in https://github.com/sensorium/Mozzi/pull/236
* Compile twi_nonblock only, when the header is included. by @tfry-git in https://github.com/sensorium/Mozzi/pull/242
* Fix/control rate by @tomcombriat in https://github.com/sensorium/Mozzi/pull/256
* RP2040 on tune by @tomcombriat in https://github.com/sensorium/Mozzi/pull/254
* Mozzi 2.0 master PR by @tfry-git in https://github.com/sensorium/Mozzi/pull/243


**Full Changelog**: https://github.com/sensorium/Mozzi/compare/1.1.2...v2.0.0

## What's Changed
* Mozzi 2.0 - Start config rework by @tfry-git in https://github.com/sensorium/Mozzi/pull/211
* Replaced unsigned long into uint32_t for Oscil. by @tomcombriat in https://github.com/sensorium/Mozzi/pull/221
* Devel/workflow updates by @tfry-git in https://github.com/sensorium/Mozzi/pull/227
* mozzi_midi as header only by @tomcombriat in https://github.com/sensorium/Mozzi/pull/222
* Single compilation unit / In-line configuration by @tfry-git in https://github.com/sensorium/Mozzi/pull/224
* Implementing auto Range for FixMath by @tomcombriat in https://github.com/sensorium/Mozzi/pull/233
* Draft: Mozzi 2.0 miscellanious small stuff by @tfry-git in https://github.com/sensorium/Mozzi/pull/230
* Devel/teensy by @tfry-git in https://github.com/sensorium/Mozzi/pull/235
* FixMath2.0 by @tomcombriat in https://github.com/sensorium/Mozzi/pull/212
* Removed FixMath from Mozzi's sources by @tomcombriat in https://github.com/sensorium/Mozzi/pull/238
* Scaling for analog reads by @tfry-git in https://github.com/sensorium/Mozzi/pull/239
* Switch to LPGL by @tfry-git in https://github.com/sensorium/Mozzi/pull/240
* Specializations of Mozzi classes for U/SFix by @tomcombriat in https://github.com/sensorium/Mozzi/pull/236
* Compile twi_nonblock only, when the header is included. by @tfry-git in https://github.com/sensorium/Mozzi/pull/242
* Fix/control rate by @tomcombriat in https://github.com/sensorium/Mozzi/pull/256
* RP2040 on tune by @tomcombriat in https://github.com/sensorium/Mozzi/pull/254
* Mozzi 2.0 master PR by @tfry-git in https://github.com/sensorium/Mozzi/pull/243


**Full Changelog**: https://github.com/sensorium/Mozzi/compare/1.1.2...v2.0.0

tomco...@live.fr

unread,
Jun 11, 2024, 6:22:53 PMJun 11
to Mozzi-users
More cleanly formatted info on Mozzi's website and Github!
Reply all
Reply to author
Forward
0 new messages