<div dir="auto"><div>You could try and change the Mozzi library settings in the Arduino project so the PWM frequency matches that of the dsp chip. </div><div dir="auto">Maybe clock the Arduino from the crystal clock of the DSP to get them coherent with each other?</div><div dir="auto">Gerry</div><div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Thu, 20 Jul 2023, 15:53 Benjamin Tremblay via Synth-diy, <<a href="mailto:synth-diy@synth-diy.org">synth-diy@synth-diy.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-break:after-white-space"><div>I had this idea I would use one of my dusty old DSP-G1 synth-on-a-chip modules as a mono synth engine for the shell of my Muppet Babies EP-10 keyboard.</div><div>I desoldered the original CPU chip and used an Arduino Mega Pro (the tiny one) to scan the matrix. I can get decent-ish synth sounds of the DSP synth.</div><div><br></div><div>Then I got ambitious. I added the Mozzi library and put in a sample player to play back the legacy Casio VL-style rhythm sounds (po, pi, sha). <br>Everything in theory works. I can run Mozzi at a decent rate, scan the keyboard, and control the DSP chip with TTL-level MIDI. I chose Mozzi HIFI mode and it does sound a little better. I don’t want it to sound too good, it’s a Casio.</div><div><br></div><div>However, I am getting a loud high frequency tone when I try to mix the outputs of Mozzi PWM and the DSP G1 PWM. I suppose this is a beat frequency. It is present when both devices are idle. </div><div><br></div><div>Adding oversized lowpass capacitors (47nF) to the inputs of my opamp take the squeal down, but it’s still there.  Fading down either signal stops the squeal. </div><div><br></div><div>Is there anything I can do about this? Add individual buffers to both? Lower the gain on my opamp (I am using a 100K resistor in the loop and 15K mixer inputs capacitively coupled) ? The opamp is an LM324 running off the 5V supply, so I certainly can improve its power supply. </div><div><br></div><div>I am hoping I can get this combination to work and move onto refinement of the firmware. Otherwise I will just punt and use a Teensy. But that would be too easy.</div><div><br></div><div>The take-away from this seems to be, do not combine 2 different PWM audio sources running at 2 different clock speeds from 2 different MCUs. (Or don’t use PWM audio at all if you can avoid it!)</div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>Benjamin Tremblay</div><div><a href="mailto:btremblay@me.com" target="_blank" rel="noreferrer">btremblay@me.com</a></div><div>Carlisle, MA</div><div><br></div><div><br></div></div></div><br></div><br></div><br></div><br></div><br><br>
</div>
<br></div>_______________________________________________<br>
Synth-diy mailing list<br>
<a href="mailto:Synth-diy@synth-diy.org" target="_blank" rel="noreferrer">Synth-diy@synth-diy.org</a><br>
<a href="http://synth-diy.org/mailman/listinfo/synth-diy" rel="noreferrer noreferrer" target="_blank">http://synth-diy.org/mailman/listinfo/synth-diy</a><br>
Selling or trading? Use <a href="mailto:marketplace@synth-diy.org" target="_blank" rel="noreferrer">marketplace@synth-diy.org</a><br>
</blockquote></div></div></div>