Does Mozzi work on the Due?

823 views
Skip to first unread message

Bret Truchan

unread,
Aug 4, 2013, 12:53:42 PM8/4/13
to mozzi...@googlegroups.com
Hello everyone,

Does Mozzi work on the Due?  I was able to incorporate the low pass filter into one of my sketches based on http://rcarduino.blogspot.com/2012/11/quick-and-dirty-synth-for-arduino-due.html, but I wasn't able to get any of the Mozzi sketches to compile.  The compile errors were mostly issues with the Arduino Due not being able to include the necessary Mozzi files, even after I had added them to the sketch.  I also tried plunking all of the Mozzi files into my project folder, and that didn't work either.

Thanks!
- Bret

Michael Shiloh

unread,
Aug 4, 2013, 1:25:11 PM8/4/13
to mozzi...@googlegroups.com
Hi Bret,

I'm hardly an expert but I had some issues with the library, which might
be what you are experiencing:

I wonder if the library is loaded properly. You may have to rename the
library to remove the hyphens. You should have received a warning.

If you did not receive a warning, the library may be in the wrong place.
Where did you put the library?

Michael
--
Michael Shiloh
teachmetomake.com/wordpress
KA6RCQ

Educational Materials coordinator at Arduino.cc
Electronics, Robotics, Digital Fabrication, and Arduino educator
California College of the Arts
San Francisco Art Institute
San Francisco State University

Bret Truchan

unread,
Aug 4, 2013, 5:00:02 PM8/4/13
to mozzi...@googlegroups.com

Hi Michael,

I just started from scratch to see if it would make a difference.  I reinstalled the Arduino software and put it in a folder called "arduino" on my C: drive.  I downloaded Mozzi an unzipped it to my desktop.  Then, in the Arduino 1.5.2 software, selected "import library" and selected Mozzi.  When that happens, the arduino editor inserts a blank line.  (When I import other libraries, it usually inserts an include at the top.)  When I tried to load in the Sinewav demo and compile it, I get the following error:



"fatal error: MozziGuys.h: No such file or directory.

The library indeed doesn't seem to be loaded properly, but I'm not sure where I should put it.  Any advice would be much appreciated.

Cheers,

Bret

Michael Shiloh

unread,
Aug 4, 2013, 5:07:55 PM8/4/13
to mozzi...@googlegroups.com
(I just now realized that you are using 1.5 for Due support. I had
issues getting Mozzi to work with 1.5 which might not be resolved. Let
me check.)

Apart from that, I think you haven't installed the library properly:

#1 don't unzip mozzi. when you install the library Arduino will unzip it
for you

#2 select "import library" and then select "add library". i think you
forgot the "add library" step.

try that and let me know

On 08/04/2013 02:00 PM, Bret Truchan wrote:
>
>
> Hi Michael,
>
> I just started from scratch to see if it would make a difference. I
> reinstalled the Arduino software and put it in a folder called "arduino" on
> my C: drive. I downloaded Mozzi an unzipped it to my desktop. Then, in
> the Arduino 1.5.2 software, selected "import library" and selected Mozzi.
> When that happens, the arduino editor inserts a blank line. (When I import
> other libraries, it usually inserts an include at the top.) When I tried
> to load in the Sinewav demo and compile it, I get the following error:
>
>
> <https://lh3.googleusercontent.com/-lExpBVFcnP0/Uf6_ypgSCFI/AAAAAAAAAC4/YZl3eh4XDXQ/s1600/mozzi_test.png>
>> KA6RCQ <http://teachmetomake.com/wordpressKA6RCQ>

Bret Truchan

unread,
Aug 4, 2013, 5:53:32 PM8/4/13
to mozzi...@googlegroups.com
Hi Michael,

Thanks so much for the support.  I'm still having some issues, but I found out a bit more about my setup.  I found out that Mozzi had been installed in my sketchbook folder.  I decided to run a test.  I modified my arduino preferences and set my sketchbook location to C:\arduino\sketchbook.  Then, I restarted the Arduino IDE and created a new sketch called "test".  That worked.  Next, I double checked to make sure that Mozzi was not listed under the Import Library.. menu.  Finally, I selected Sketch / Import Library / Add Library... and I selected the Mozzi.zip file.  This added a C:\arduino\sketchbook\libraries folder and a C:\arduino\sketchbook\libraries\Mozzi folder to my sketchbook folder.  In other words:

C:\arduino\sketchbook\test
C:\arduino\sketchbook\test\test.ino
C:\arduino\sketchbook\libraries
C:\arduino\sketchbook\libraries\Mozzi
C:\arduino\sketchbook\libraries\Mozzi\MozziGuts.h
C:\arduino\sketchbook\libraries\Mozzi\MozziGuts.cpp
C:\arduino\sketchbook\libraries\Mozzi\ .. etc... (all the mozzy files)

I restarted the Arduino IDE by loading my test.ino sketch.  Now, however, Mozzi does not show up under Sketch / Import Library:


I'm a bit stuck now.  How odd!

Thanks,

Bret

Michael Shiloh

unread,
Aug 4, 2013, 7:23:12 PM8/4/13
to mozzi...@googlegroups.com
Happy to help as best I can.

Sometime recently Arduino allowed you to have libraries in your
sketchbook folder, so that part is expected.

Not sure why Mozzi doesn't show up in your import options.

Mozzi has many examples (in examples->Mozzi). Can you compile any of them?

If so, try saving one of the examples in your sketchbook as a new file
(save as) and try compiling that.

Michael

On 08/04/2013 02:53 PM, Bret Truchan wrote:
> Hi Michael,
>
> Thanks so much for the support. I'm still having some issues, but I found
> out a bit more about my setup. I found out that Mozzi had been installed
> in my sketchbook folder. I decided to run a test. I modified my arduino
> preferences and set my sketchbook location to C:\arduino\sketchbook. Then,
> I restarted the Arduino IDE and created a new sketch called "test". That
> worked. Next, I double checked to make sure that Mozzi was not listed
> under the Import Library.. menu. Finally, I selected Sketch / Import
> Library / Add Library... and I selected the Mozzi.zip file. This added a
> C:\arduino\sketchbook\libraries folder and a
> C:\arduino\sketchbook\libraries\Mozzi folder to my sketchbook folder. In
> other words:
>
> C:\arduino\sketchbook\test
> C:\arduino\sketchbook\test\test.ino
> C:\arduino\sketchbook\libraries
> C:\arduino\sketchbook\libraries\Mozzi
> C:\arduino\sketchbook\libraries\Mozzi\MozziGuts.h
> C:\arduino\sketchbook\libraries\Mozzi\MozziGuts.cpp
> C:\arduino\sketchbook\libraries\Mozzi\ .. etc... (all the mozzy files)
>
> I restarted the Arduino IDE by loading my test.ino sketch. Now, however,
> Mozzi does not show up under Sketch / Import Library:
>
>
> <https://lh4.googleusercontent.com/-vEN4UaJPDjc/Uf7MovoXfII/AAAAAAAAADM/f7bH6_13nAM/s1600/mozzi2.png>

Bret Truchan

unread,
Aug 4, 2013, 8:06:13 PM8/4/13
to mozzi...@googlegroups.com
No, I don't seem to be able to compile any of the examples.  I continue to get the "Fatal error: MozziGuts.h: No such file or directory. 

Ah, I may have stumbled upon something interesting though.  I ran a bunch of tests.  My library folder that populates the Sketch / Import Library is

C:\arduino\hardware\arduino\sam\libraries

If I copy the Mozzi folder from C:\arduino\sketchbook\libraries\Mozzi to C:\arduino\hardware\arduino\sam\libraries\Mozzi, nothing shows up in Skietch / Import Library.  However(!),  If I put an empty folder named "Mozzi" into C:\arduino\hardware\arduino\sam\libraries, then I DO see Mozzi listed as a library under Sketch / Import Library.  It's as if something in the Mozzy folder is spooking the Arduino IDE.  I'm thinking pirate ghosts from the 1400s, but I've thought that before and been wrong.

Any ideas?

Thanks again,
Bret

Mr Sensorium

unread,
Aug 5, 2013, 6:00:27 AM8/5/13
to mozzi...@googlegroups.com
Hi,
Sorry to say, Mozzi isn't ported to the Due.  It would be a substantial step to move to the 32 bit ARM Cortex processors - in fact a lot of the optimisations in Mozzi would become irrelevant and limiting.  Pity I didn't start the project a year or two later than I did (or know more about what I was doing), as it would have made much more sense doing it for the newer processors in the first place. 
Funny!  Not really.
Not sure about the trouble with the IDE finding the files - have you tried compiling for one of the boards Mozzi works on? 
These are the ones listed in Mozzi's README.md which have been tested (mostly 328 processors, but  not all):
Arduino Uno 
Arduino Duemilanove 
Arduino Nano 
Arduino Pro Mini 
Arduino Leonardo
Arduino Mega 
Freetronics EtherMega 
Ardweeny 
Boarduino
Teensy2 
Teensy2++ 

Tim

Bret Truchan

unread,
Aug 5, 2013, 7:59:24 PM8/5/13
to mozzi...@googlegroups.com
No worries Tim!  Maybe I'll have to make a feeble attempt at my own audio library for the Due.  :-)  I appreciate the support.

Cheers,
- Bret

Mr Sensorium

unread,
Sep 30, 2013, 10:04:05 AM9/30/13
to mozzi...@googlegroups.com
Not sure if anyone's still interested in this, but I'm trying a rather embarrassing donation campaign on the Mozzi site to see if there's enough support for me to spend the time to get Mozzi going on Due or Teensy 3.0.  So far, after about 2 weeks, the only person who donated was my sister, so I'm assuming there's not much interest after all!
I might as well mention that Mozzi is an independent project, I'm not part of an institution and I don't get paid for any of the time I've spent on it so far.

Tim

Dan Snazelle

unread,
Sep 30, 2013, 10:14:10 AM9/30/13
to mozzi...@googlegroups.com
I'm interested !!

Where can I donate??

Sent from my iPhone
--
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 post to this group, send an email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/7ab59671-56c8-4fcd-b9e8-9c316993f569%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Doctroid

unread,
Sep 30, 2013, 1:47:29 PM9/30/13
to mozzi...@googlegroups.com
Can't donate if I don't know about the campaign! This is the first I've heard of it.

I'm definitely interested in Mozzi on the Due.

Doctroid

unread,
Sep 30, 2013, 1:53:36 PM9/30/13
to mozzi...@googlegroups.com
On Monday, September 30, 2013 10:14:10 AM UTC-4, loss1234 wrote:
I'm interested !!

Where can I donate??


I just donated AU$20 for Due. This is the first time I've been to that page in months, so I didn't know about the donation campaign. Tim, talk it up!

Tim Barrass

unread,
Sep 30, 2013, 11:38:24 PM9/30/13
to mozzi...@googlegroups.com
Thanks a lot Richard!


--
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 post to this group, send an email to mozzi...@googlegroups.com.

Tim Barrass

unread,
Sep 30, 2013, 11:42:16 PM9/30/13
to mozzi...@googlegroups.com
Hey Dan.  How's your stuff going? 
There are donation links on the Mozzi home page - I was actually about to take them down and do some general complaining, but I guess I'll have to leave them there now that someone outside my immediate family's donated!
Cheers
Tim


Marije Baalman

unread,
Oct 1, 2013, 7:30:02 AM10/1/13
to mozzi...@googlegroups.com
Hiho,

I am quite interested in Mozzi on the Due or Teensy - and I'd also like
to contribute in terms of coding...

just starting to orientate myself in the guts of Mozzi, to see where
changes are needed.

sincerely,
Marije

Dan Snazelle

unread,
Oct 1, 2013, 9:02:12 AM10/1/13
to mozzi...@googlegroups.com, mozzi...@googlegroups.com
Hello again

My stuff is going well !

I just released the Snazzy FX Eurorack Ardcore ver. 2 and
The Ardcore expander 
(modular synthesizer Arduino compatible synth hardware modules)open source
With USB, a whole library of modular synth presets
And now with 10 trigger outs, Dac, reset button , bipolar inputs , cv ins, etc


ANYWAY

YOU SHOULD MOVE UP THE DONATE BUTTON !!

I just donated $20-I'd love it on Due!!

I still haven't used mozzi in any of my projects
Yet but i think I will someday
It's really well done !!
And I've told all the Ardcore users to check it out


Best

Dan

Sent from my iPhone

Tim Barrass

unread,
Oct 1, 2013, 11:24:09 PM10/1/13
to mozzi...@googlegroups.com
Hi Marije,

that's great if you want to contribute to the coding. 

I'd like to try to get the collaboration working in github, to co-ordinate and keep track of changes as well as to properly acknowledge contributions.  Václav Peloušek has also mentioned an improved ADSR object he's made which would be good to incorporate.  Do you have much experience collaborating using git?  I'm still learning as I go.  I'd really like to make the project more open and easier to collaborate, so it can grow with broader input.

I'm in the process of trying to simplify MozziGuts, add in-sketch configuration and improve the audio output quality.  It might be quite a big change in the code, so you might want to wait until that's sorted before bothering too much with the guts.  I'll try and give a clear description of the things which will need solving for the Due when the new code is settled.  Then it would be great to have any input, changes or suggestions.

OK bye
Tim



Tim Barrass

unread,
Oct 1, 2013, 11:33:57 PM10/1/13
to mozzi...@googlegroups.com
Thanks for the donation, Dan.  I looked up Snazzy FX and really enjoyed it.  Your effects remind me of Craig Anderton's music electronics in Guitar Player magazine in the late70s?/early80's and his books "Electronic projects for musicians" (version 1 and 2!), except you've taken it a long way, right around the bend.  Fantastic.

OK bye
Tim


Marije Baalman

unread,
Oct 2, 2013, 2:55:59 AM10/2/13
to mozzi...@googlegroups.com
Hi Tim,

On Wed, 2 Oct 2013 13:24:09 +1000
Tim Barrass <barra...@gmail.com> wrote:

> Hi Marije,
>
> that's great if you want to contribute to the coding.
>
> I'd like to try to get the collaboration working in github, to
> co-ordinate and keep track of changes as well as to properly
> acknowledge contributions. Václav Peloušek has also mentioned an
> improved ADSR object he's made which would be good to incorporate.
> Do you have much experience collaborating using git? I'm still
> learning as I go. I'd really like to make the project more open and
> easier to collaborate, so it can grow with broader input.

I'm not an expert in git, but have some experience with collaborating
via git, and github. There are some other projects where I maintain my
own fork of a project on github, and occasionally send pull requests to
the originating project.


> I'm in the process of trying to simplify MozziGuts, add in-sketch
> configuration and improve the audio output quality. It might be
> quite a big change in the code, so you might want to wait until
> that's sorted before bothering too much with the guts. I'll try and
> give a clear description of the things which will need solving for
> the Due when the new code is settled. Then it would be great to have
> any input, changes or suggestions.

Right now I am looking at the capabilities of the chip, and it seems
most interesting to implement the DSP stuff actually using the onboard
DSP, so I am actually starting with the functions for that, I think.
I also already have some basics there for setting the timer interrupt
and producing the PWM output - although in the longer run, we might
also want to use the i2s output for audio - still looking for an
appropriate chip to use for the DAC + amp.

Sincerely,
Marije

Dan Snazelle

unread,
Oct 2, 2013, 3:26:54 AM10/2/13
to mozzi...@googlegroups.com, mozzi...@googlegroups.com
I thought the DUE had a built in 12 bit DAC??

Sent from my iPhone
> --
> 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 post to this group, send an email to mozzi...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/20131002085559.01dcf238%40exometheus.

Marije Baalman

unread,
Oct 2, 2013, 3:42:36 AM10/2/13
to mozzi...@googlegroups.com
Hiho,

I'll be focusing on the Teensy3.0.

with the i2s you can get up to 24bit...

sincerely,
Marije

Dan Snazelle

unread,
Oct 2, 2013, 9:14:28 AM10/2/13
to mozzi...@googlegroups.com, mozzi...@googlegroups.com
Wow

I'll have to check that out !!

Sent from my iPhone
> To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/20131002094236.7824035e%40exometheus.

clone45a6

unread,
Jun 19, 2014, 10:26:13 PM6/19/14
to mozzi...@googlegroups.com
Hi Tim,

I've got the lowpass filter from LowPassFilter.h working on the Due using my own framework, but resonance causes a lot of nasty clipping and distortion.  I was wondering if anyone would be so kind as to peek at my code and see if they can immediately spot my problem.

The files are at:

https://github.com/clone45/EquationComposer/blob/master/LowPassFilter.h
https://github.com/clone45/EquationComposer/blob/master/ModuleLowpassFilter.cpp

Is the value passed into the Mozzi low-pass filter a fixed-point number?  The value that I'm passing in is a 12-bit unsigned int.  Again, the filter works great, but the resonance is all freaked out.

Cheers,

Bret



On Monday, August 5, 2013 3:00:27 AM UTC-7, Mr Sensorium wrote:

Mr Sensorium

unread,
Jun 20, 2014, 8:43:36 AM6/20/14
to mozzi...@googlegroups.com
Hi Bret,
I can't look closely into your code at the moment, and might not get back online for a while, but feel free to keep posting if you can wait for an answer...


>Is the value passed into the Mozzi low-pass filter a fixed-point number?
Which number? 
If you mean the signal input to the filter, it works with signals around 8 bits in magnitude, centred around 0, ie. a signed char, and doesn't really matter about fixed-point or not.  12 bits is OK, since it's an int parameter to the next() method, but watch the amplitude and make it centred around 0, not unsigned int. I've found that bad sounds can be reduced by lowering the level of the input signal - it might be worth experimenting with this.
If it's the resonance, it's an unsigned byte, and again worth experimenting, no fixed-point required.

You've probably already done this, but it's worth looking up the original sources which informed the filter, listed in the source file:
- resonant filter posted to musicdsp.org by Paul Kellett http://www.musicdsp.org/archive.php?classid=3#259
- fixed point version of the filter on "dave's blog of art and programming" http://www.pawfal.org/dave/blog/2011/09/

And of course you've seen the scant docs in my code and here: https://sensorium.github.io/Mozzi/doc/html/class_low_pass_filter.html

Hope you can get it going
Tim

Mr Sensorium

unread,
Jun 20, 2014, 3:32:15 PM6/20/14
to mozzi...@googlegroups.com
Another thought-
12 bit unsigned to 16 bit signed, centred on 0:
int adjusted_number = (int)(((long) twelve_bit - 4096) << 2);
Reply all
Reply to author
Forward
0 new messages