Uno Synth project - Audio output questions

Hi!

I am developing a synth/sampler project based on the Arduino Uno r3. This is my first electronics project ever and because of that reason I have some questions which I can't find a definite answer for on internet.

The synth has two function. It has a tone generator using the ToneAC library. With code I have mimicked LFO and VCO functions, using potmeters I can adjust the frequency and LFO speed realtime. The other function is that I can trigger samples stored on a SD card using the TMRpcm library.

The device will be used in nightclubs on 20kW+ soundsystems. I am afraid I will damage the equipment with my device because I do not send a pure audio (AC?) signal.

Currently the flow is like this:

PWM output (pin 9, 10) -> voltage divider to 2.5v -> RC Low Pass Filter 15Khz -> LM386 amp with volume control -> mono jack output -> mixing desk -> amplifier -> speakers

(the TMRpcm and ToneAC library share the same pin (9), I have fixed this by disabling the TMRpcm when the ToneAC is playing and vice versa. The mono jack is wired as follow. pin 9 goes to plus side of mono jack output, pin 10 to negative side. The TMRpcm pin 9 also needs to go to plus side of mono jack output, and mono jack negative needs to go to ground. Because I disable the ToneAC at that time I consider port 10 grounded because it not generating any sound so there is no signal/voltage running out of it, aka the IO pin is set to LOW)

I am hoping that using the voltage divider I am within range of the Audio Line levels of a default mixers Line-IN (like Pioneer, Behringer, etc). The RC Low Pass Filter is used to filter of inaudible frequencies and clean up the sound a bit, the LM386 audio amp is used to amplify the signal and (hopefully) make it a real audio signal.

Because I lack a lot of knowledge in this field and because I do not own a oscilloscoop I can't say for sure if my output signal is harmful for the equipment and was hoping to get some guidance on my project on this forum.

The Arduino digital output as audio can be used in a toy or for hobby, or just for fun to tinker with.

Please do not use it with professional equipment or a real audience. I don't care how many equipment you will damage, I care about the people. Even with filters it will never be safe to use it in this way. Do not even try it.

Get a professional synthesizer.
There are a lot synthesizer under 400 dollars, that are mainly made to have fun, search for "Waldorf Streichfett string synthesizer" or "Roland TB-3 Touch Bassline bas-synthesizer" or what about this cheap one : Korg Kaossilator Dynamic Phrase Synthesizer #1 - YouTube

Thanks for your response. As a musician and soundsystem operator/DJ I know those synthesisers.

Not the response I am looking for though, can you explain why it would be bad for the audience? The Arduino synth will go through a mixer which will pass an EQ which passes a crossover amp & limiter before going to the main amps.

The only thing I can imagine is that the output volume of the Arduino synth is WAY louder than normal, which is one of the problems I need to fix with the voltage divers icw LM386 amp. And even though if that happens the limiter will kick in. I've tested my current circuit/setup on my analogue 12 channel mixer which is connected to active powered YAMAHA HS80M speakers. I am very pleased with the quality of the sound, but as I said, because I am a novice I can't say if the signal could be potentially damaging for the equipment.

Besides that, the lowest frequency you can play with the synth is 100hz and the highest frequency is 3100hz.

So thanks for thinking with me but I am looking for a different answer :wink:

You should ask someone else for a different answer :-*

Making good audio equipment is very hard, and has to deal with many things. You probably know that better then me, since I'm not an audio-guy. For example when the power is turned on, the Arduino could generate a big pop. Or if your sketch is wrong, it could generate a 15kHz headache causing annoying tone.
What if someone complains or even sues you. What are you gonna say ? I made something myself, but I didn't know what I was doing ?

You wrote that this is your first electronics project, so I strongly suggest something with less impact.
Perhaps a wearable led strip while you are performing :

The Arduino is not very good with audio, but there are a number of shields for audio and midi.
It is also possible to use the Arduino on its own, for example that TMRpcm library, you use.
Did you try the Mozzi library ? Mozzi

Thanks for the extra information; i've tackled those problems you described, ive been working on it for 3 months now. Currently the only person who is gonna use the synth is myself on my own equipment.

That Mozzi library looks insane, thanks! Definitly gonna check that out.

Just let me narrow my primary question

When using my synth on a DJ mixer which is connected to an amplifier which drives speakers. Can sending the PWM generated tones damage the equipment?

As to your original question: The GND of the Arduino could be connected via the USB to the computer. So you can not use a pin as ground for the audio.

The toneAC generates two opposite signals at pin 9 and 10, but you can use just one signal as well. They are the same signals (one is the inverse signal of the other).

Both the toneAC and TMRpcm library use TIMER1. The toneAC has an alternative library to use TIMER2, but the website tells that toneAC2 is inferior: Google Code Archive - Long-term storage for Google Code Project Hosting.
I think the TMRpcm has a define "USE_TIMER2" to use TIMER2, but that limits the use : Advanced Features · TMRh20/TMRpcm Wiki · GitHub

The TMRpcm takes over the complete Arduino in order to make it work. So perhaps making both libraries work at the same time is not possible. Each library reduces the quality when using TIMER2.
So my suggesting is, to keep it using as it is. Forget pin 10, just leave it open. Use only pin 9. Connect the jack negative to the Arduino GND.

About the PWM generated tones. That question is confusing for me. The toneAC generates a square wave output. You have to be sure not to let it clip any amplifier, but stay in the safe area. For the TMRpcm library, I can't find in the documentation or the code what the base frequency of the PWM signal is or how it is used. I assume that your 15kHz low-pass filter is enough to filter that.

About the PWM generated tones. That question is confusing for me. The toneAC generates a square wave output. You have to be sure not to let it clip any amplifier, but stay in the safe area. For the TMRpcm library, I can't find in the documentation or the code what the base frequency of the PWM signal is or how it is used. I assume that your 15kHz low-pass filter is enough to filter that.

It could be that I am looking for possible problems where there are none. What I am thinking about is that a full audio signal is a sinus waveform which goes to negative volt to positive volts right? PWM is only positive volts, no negative. So when you play that through a speaker the driver will behave differently.

Also, my lack of knowledge and terminology makes this harder for me to comprehend haha, I will get there slowly but at the mean time I am lacking the knowledge and skill, therefor this project, combining 2 things I love, soundsystems and synthersizers :slight_smile:

Thanks for thinking with me Peter_n, also thanks for the Mozzi library link, thats exactly something I was looking for. I do think that there will be no possibilties for damage to the equipment IF the synth does indeed behave as I intend and the output signal is not clipped.

Yes, PWM is 0-5V output.
Pass that thru a 10uF capacitor, it looks like +/-2.5V AC signal.
Run thru a resistor divider and bring it down to +/- 1V (line level) for feeding into audio amps & stuff.
Search for my post "piano tones micros" where I created 13 outputs that were mixed, divided down and AC coupled to feed into self-powered computer desktop speaker, with youtube video so you can hear it. Schematic is posted also. Youtube is not opening for me or I'd post a link to the video for you.

Here's the post
http://forum.arduino.cc/index.php?topic=179761.15

Yes, PWM is 0-5V output.
Pass that thru a 10uF capacitor, it looks like +/-2.5V AC signal.
Run thru a resistor divider and bring it down to +/- 1V (line level) for feeding into audio amps & stuff.

THIS is exactly the answer I needed! Thanks!