Issues using Mozzi with DAC on Teensy 3.2

391 views
Skip to first unread message

MrManuHeel

unread,
Dec 29, 2016, 5:14:53 AM12/29/16
to Mozzi-users
Hi,
First of all, I must say that I'm somewhat new to Arduino (here Teensy) and electronics.

I'm working on a project to make an 8-bit synthesizer and sequencer out of a old organ, inspired by this : http://www.linusakesson.net/chipophone/index.php
This project is composed of 2 sub-projects, involving 2 micro-controllers : 1 Arduino does the mapping of inputs to MIDI (already done), the other gets this data and generates sound according to keys and buttons.
As I wanted to have multiple oscillators working at the same time, I chose to get a Teensy 3.2 to get more raw horsepower for the second sub-project.

My issue is that I've been trying for over a week to get MOZZI work on the DAC pin on the Teensy 3.2 but I can't get it done.
My Teensy 3.2 is powered by USB, and has one of its GROUND pin connected to the general ground of my organ via an 6.35mm Jack socket.
The DAC pin is connected to the output of my Jack socket.

I tried unsuccessfully to use the Sinewave example file from the Mozzi library.
All I get is a classical background noise from the Jack if I push the gain up to the maximum.
Interesting fact : if I don't try in my code to use Mozzi, the noise stays constant but, if I do, I hear a tiny "pop" when I start or stop the Teensy.

In order to get you informed :
- The Teensy works : I managed to get its LED blink as I wanted, modifying the base code.
- The wiring is valid : I tested it with a multimeter.
- The Jack output is correct : I used it with my Arduino from the other project with the tone() function.
- I tried with or without the #include <ADC.h> line, the library being correctly installed.
- I tried with or without pre-amplification from an external soundcard (Steinberg UR22), pushing the gain up to the maximum.

I know the Teensy 3.2 is not yet officially supported but the 3.2 should only be an overall update from the 3.1.

Has anybody experienced a similar issue or has ideas about mine ?

Thank you.

Tim Barrass

unread,
Dec 31, 2016, 2:32:21 AM12/31/16
to mozzi...@googlegroups.com
Hi MrManuHeel,

Mozzi should work OK on Teensy3.2 - it's possible that something has gone wrong in the most recent (draft) release.  I will be able to test it in a week or so.  Meanwhile, you could try an older release from the download page on github.

Tim

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/58350487-db38-4520-946d-80006dd227f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MrManuHeel

unread,
Dec 31, 2016, 4:24:21 AM12/31/16
to Mozzi-users
Hi Tim,

Thanks for the answer !

I won't have much time to dedicate to my project right now, so I will check this in a week also.
If you have news you can update me, otherwise I will test older releases.

Have a great New Year's Eve,
Manu.

MrManuHeel

unread,
Jan 13, 2017, 1:19:51 PM1/13/17
to Mozzi-users
Hi Tim & Mozzi users !

Do you have any update on my issues using Teensy 3.2 ?

Thank you,
Manuel.

Tim Barrass

unread,
Jan 13, 2017, 7:53:15 PM1/13/17
to mozzi...@googlegroups.com
Hi Manuel,

my Teensy died, so it will be a few more weeks until a new one arrives before I can test it.

Tim

--
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+unsubscribe@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/0be0fb15-ef74-4b8f-858b-a61ba7ad35b1%40googlegroups.com.

MrManuHeel

unread,
Feb 4, 2017, 5:48:03 AM2/4/17
to Mozzi-users
Hi Tim !

I continued my testing today with the same setup and could not find a way to make it work.
I tested Mozzi with version 1.0.3rc4, 1.0.3rc2 (original version of the post) and 1.0.2.
Nothing seem to work for me :/

Thank you for your time,
Manu.

MrManuHeel

unread,
Mar 4, 2017, 5:24:17 AM3/4/17
to Mozzi-users
Hi Tim!

Sorry to bother you again...
I tried simplifying my setup but nothing seem to work out for me :/

I attached some photos of it for you to get how I'm using the board.
My Teensy is powered by USB from my laptop, "connected" via the ground and DAC pin (in fact, the wires are just wrapped up to homemade pins...) to my jack, then I listen to it through headphones.

Anything new from your side?
Thanks,
Manu.
20170304_105113.jpg
20170304_105156.jpg
20170304_105215.jpg
20170304_105230.jpg

Tim Barrass

unread,
Mar 6, 2017, 6:35:04 PM3/6/17
to mozzi...@googlegroups.com
Hi Manu,

I just tested a Teensy3.2 here a minute ago, and it works.

> then I listen to it through headphones.
Are you using an amplifier, or just headphones straight from the Teensy?  You need an amp, if you're not using one already.

Tim

--
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+unsubscribe@googlegroups.com.

MrManuHeel

unread,
Mar 7, 2017, 5:22:13 AM3/7/17
to Mozzi-users
Hi !

So it looks like coming from my setup... good news, somehow.

As i wrote in my first post, I tested with directly with headphone or wiring up the output jack socket to an external sound card's preamplifier (Steinberg UR22), pushing the gain up to the maximum.
This amplified setup doesn't give me better results, only louder noise :P

I'll test again with the most amplified setup I can get, as my issue certainly is coming from my audio setup : the code is really raw from your templates and the Teensy has no reason not to work.

Thank you again for your dedication,
Manu.

Tim Barrass

unread,
Mar 7, 2017, 5:54:27 AM3/7/17
to mozzi...@googlegroups.com
Hi Manu,

>only louder noise
Aha.. one thing to consider is that the Teensy analog out is 12 bits, so if you try the Mozzi example Sinewave sketch, the level will use the full output range with this in updateAudio():

return aSin.next()<<4;  // shift 8 bit signal to 12 bits

I hope you get closer to a solution!

Tim

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

MrManuHeel

unread,
Mar 20, 2017, 6:24:47 AM3/20/17
to Mozzi-users
Hi Tim !

Thanks a lot for your help, I'm happy to tell you that it's working !
Thinking it was only a matter of 3 characters...

Correctly using 8bit over 12bits looks like working, but I'm surprised 12bits wasn't, as I had this line :
analogWriteResolution(12);
It's a shame I couldn't use those 12bits, or maybe I don't get it...

Anyway, my next steps are to work on the code and try to upgrade the setup to get a smoother filtered sound.
Thank you again !

Manu.
Reply all
Reply to author
Forward
0 new messages