<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I've also done a quantiser based on PWM. I actually used two four-bit PWM outputs, one for the Octave voltage, and the other for the Semitones within the Octave. <div class="">This made the calibration very simple, but the biggest benefit was that the low resolution PWM meant the output frequency could be very high, making the filtering much easier. I think we had 250KHz as the PWM frequency.</div><div class="">PWM is inherently linear because it's based on a digital counter, so it actually works very well for generating Pitch CV outputs, as long as you don't need to do pitchbend and "get between" the notes - that kind of resolution is much more of an ask!</div><div class=""><br class=""></div><div class="">Tom</div><div class=""><br class=""><div class="">
<div>==================<br class="">       Electric Druid<br class="">Synth & Stompbox DIY<br class="">==================</div><div class=""><br class=""></div><br class="Apple-interchange-newline">

</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 20 Jun 2024, at 09:56, Sean Ellis via Synth-diy <<a href="mailto:synth-diy@synth-diy.org" class="">synth-diy@synth-diy.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I've been working on a quantizer that is using only PWM, it's light years ahead of the MCP DACs when it comes to accuracy. I've had both side by side and you can hear the difference without measuring, I would avoid those cheap DACs.</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br class=""></div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br class=""></div><div id="appendonsend" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br class=""></div><hr style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 891.796875px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""><b class="">From:</b> Synth-diy <<a href="mailto:synth-diy-bounces@synth-diy.org" class="">synth-diy-bounces@synth-diy.org</a>> on behalf of Matthew Skala via Synth-diy <<a href="mailto:synth-diy@synth-diy.org" class="">synth-diy@synth-diy.org</a>><br class=""><b class="">Sent:</b> Thursday, 20 June 2024 4:20 AM<br class=""><b class="">To:</b> Scott Bernardi <<a href="mailto:scottbernardi55@gmail.com" class="">scottbernardi55@gmail.com</a>><br class=""><b class="">Cc:</b> SDIY List <<a href="mailto:synth-diy@synth-diy.org" class="">synth-diy@synth-diy.org</a>><br class=""><b class="">Subject:</b> Re: [sdiy] Quantizer with Arduino, ADS1115 and MCP4725</span><div class=""> </div></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 11pt;" class="">On Wed, 19 Jun 2024, Scott Bernardi via Synth-diy wrote:<br class="">> number of semitones. For example, a major scale would be<br class="">> 0   2   4   5   7   9   11         semitones.<br class="">> Minor would be<br class="">> 0   2   3   5   7   9   10<br class="">> The necessary binary counts would then be 512 times these.<br class="">> Using the number of semitones for the scales is convenient, because then for<br class="">> the 12 bit MCP4725 output, I would multiply by the bits per semitone value<br class="">> of 32. Or another way to think of it is to throw away the 3 least<br class="">> significant bits and the sign bit to go from 15 bits plus sign bit to 12<br class="">> bits for the output.<br class=""><br class="">The MCP4725's output may be up to 14.5 counts off of a theoretical linear<br class="">input-to-output function.  If full scale is 5.333V, that translates to<br class="">0.02V or about 23 cents of pitch.  And that is how closely it approaches<br class="">*some* linear function, not necessarily *the* linear function you want it<br class="">to be.  Gain error 2% and offset 0.75% are possible according to the data<br class="">sheet.  If I'm correctly understanding how those are applied, it seems<br class="">like in the worst case gain and offset could add error of up to 0.14V, 165<br class="">cents (!), on a reference voltage of about 5V.<br class=""><br class="">If you want your pitch accuracy to be better than that, a simple "multiply<br class="">semitones by X" calculation is not going to be good enough.  You have a<br class="">bigger problem than just trying to make X be equal to 32.<br class=""><br class="">I think to get good results you're going to need to do some calibration:<br class="">send different codes to the specific individual DAC chip you're using,<br class="">measure the output, find the code you need to send for each desired<br class="">output voltage, and then store those in a table and look them up when you<br class="">want to get different voltages.  This needs to be done individually for<br class="">every chip because the point is to compensate for the manufacturing<br class="">variation among the chips.<br class=""><br class="">Similar issues may apply to the ADC, so you risk a garbage-in, garbage-out<br class="">situation.<br class=""><br class="">And then if you're doing the work to calibrate individual steps, there's<br class="">not much to be gained by pushing the power supply voltage, and I wouldn't.<br class="">The 5.5V maximum spec really means "it's 5.0V with a safety margin," not<br class="">"5.3V is perfectly okay and normal" and if you cut into that safety margin<br class="">you may end up regretting doing so.<br class=""><br class="">--<br class="">Matthew Skala<br class="">North Coast Synthesis Ltd.<br class="">________________________________________________________<br class="">This is the Synth-diy mailing list<br class="">Submit email to:<span class="Apple-converted-space"> </span><a href="mailto:Synth-diy@synth-diy.org" class="">Synth-diy@synth-diy.org</a><br class="">View archive at:<span class="Apple-converted-space"> </span><a href="https://synth-diy.org/pipermail/synth-diy/" id="OWAe0be0965-8bcc-085c-1a16-8e5023410253" class="OWAAutoLink" data-auth="NotApplicable">https://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsynth-diy.org%2Fpipermail%2Fsynth-diy%2F&data=05%7C02%7C%7C7b43573a2bc144535fa608dc90d032d0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638544471107082537%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=f26SnPwzIS8M%2F09apEFaydzf58vVzjOPF5RHas1u%2Bh0%3D&reserved=0</a><br class="">Check your settings at:<span class="Apple-converted-space"> </span><a href="https://synth-diy.org/mailman/listinfo/synth-diy" id="OWA1ad1d090-80eb-537f-b0c7-7c6a79cfb4f7" class="OWAAutoLink" data-auth="NotApplicable">https://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsynth-diy.org%2Fmailman%2Flistinfo%2Fsynth-diy&data=05%7C02%7C%7C7b43573a2bc144535fa608dc90d032d0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638544471107094044%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=Wt0xljiMj5pvzK21%2FishEddgUWrjpETlpEYmJqUJjUE%3D&reserved=0</a><br class="">Selling or trading? Use<span class="Apple-converted-space"> </span><a href="mailto:marketplace@synth-diy.org" class="">marketplace@synth-diy.org</a></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">________________________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">This is the Synth-diy mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Submit email to:<span class="Apple-converted-space"> </span></span><a href="mailto:Synth-diy@synth-diy.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Synth-diy@synth-diy.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">View archive at:<span class="Apple-converted-space"> </span></span><a href="https://synth-diy.org/pipermail/synth-diy/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://synth-diy.org/pipermail/synth-diy/</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Check your settings at:<span class="Apple-converted-space"> </span></span><a href="https://synth-diy.org/mailman/listinfo/synth-diy" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://synth-diy.org/mailman/listinfo/synth-diy</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Selling or trading? Use<span class="Apple-converted-space"> </span></span><a href="mailto:marketplace@synth-diy.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">marketplace@synth-diy.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote></div><br class=""></div></body></html>