<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Agreed.  </div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Only if you're not using an MCU with PWM built in, I'd suggest using PDM (just reverse the bits from the counter to the comparator).  Moves any noise as you change the output voltage higher in frequency.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> Synth-diy <synth-diy-bounces@synth-diy.org> on behalf of Sean Ellis via Synth-diy <synth-diy@synth-diy.org><br>
<b>Sent:</b> 20 June 2024 09:56<br>
<b>To:</b> Scott Bernardi <scottbernardi55@gmail.com>; mskala@northcoastsynthesis.com <mskala@northcoastsynthesis.com><br>
<b>Cc:</b> SDIY List <synth-diy@synth-diy.org><br>
<b>Subject:</b> Re: [sdiy] Quantizer with Arduino, ADS1115 and MCP4725</span>
<div> </div>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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 style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="x_appendonsend"></div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="direction: ltr; display: inline-block; width: 98%;">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> Synth-diy <synth-diy-bounces@synth-diy.org> on behalf of Matthew Skala via Synth-diy <synth-diy@synth-diy.org><br>
<b>Sent:</b> Thursday, 20 June 2024 4:20 AM<br>
<b>To:</b> Scott Bernardi <scottbernardi55@gmail.com><br>
<b>Cc:</b> SDIY List <synth-diy@synth-diy.org><br>
<b>Subject:</b> Re: [sdiy] Quantizer with Arduino, ADS1115 and MCP4725</span>
<div> </div>
</div>
<div style="direction: ltr; font-size: 11pt;">On Wed, 19 Jun 2024, Scott Bernardi via Synth-diy wrote:<br>
> number of semitones. For example, a major scale would be<br>
> 0   2   4   5   7   9   11         semitones.<br>
> Minor would be<br>
> 0   2   3   5   7   9   10<br>
> The necessary binary counts would then be 512 times these.<br>
> Using the number of semitones for the scales is convenient, because then for<br>
> the 12 bit MCP4725 output, I would multiply by the bits per semitone value<br>
> of 32. Or another way to think of it is to throw away the 3 least<br>
> significant bits and the sign bit to go from 15 bits plus sign bit to 12<br>
> bits for the output.<br>
<br>
The MCP4725's output may be up to 14.5 counts off of a theoretical linear<br>
input-to-output function.  If full scale is 5.333V, that translates to<br>
0.02V or about 23 cents of pitch.  And that is how closely it approaches<br>
*some* linear function, not necessarily *the* linear function you want it<br>
to be.  Gain error 2% and offset 0.75% are possible according to the data<br>
sheet.  If I'm correctly understanding how those are applied, it seems<br>
like in the worst case gain and offset could add error of up to 0.14V, 165<br>
cents (!), on a reference voltage of about 5V.<br>
<br>
If you want your pitch accuracy to be better than that, a simple "multiply<br>
semitones by X" calculation is not going to be good enough.  You have a<br>
bigger problem than just trying to make X be equal to 32.<br>
<br>
I think to get good results you're going to need to do some calibration:<br>
send different codes to the specific individual DAC chip you're using,<br>
measure the output, find the code you need to send for each desired<br>
output voltage, and then store those in a table and look them up when you<br>
want to get different voltages.  This needs to be done individually for<br>
every chip because the point is to compensate for the manufacturing<br>
variation among the chips.<br>
<br>
Similar issues may apply to the ADC, so you risk a garbage-in, garbage-out<br>
situation.<br>
<br>
And then if you're doing the work to calibrate individual steps, there's<br>
not much to be gained by pushing the power supply voltage, and I wouldn't.<br>
The 5.5V maximum spec really means "it's 5.0V with a safety margin," not<br>
"5.3V is perfectly okay and normal" and if you cut into that safety margin<br>
you may end up regretting doing so.<br>
<br>
--<br>
Matthew Skala<br>
North Coast Synthesis Ltd.<br>
________________________________________________________<br>
This is the Synth-diy mailing list<br>
Submit email to: Synth-diy@synth-diy.org<br>
View archive at: <a href="https://synth-diy.org/pipermail/synth-diy/" id="OWAabfe9eac-22e5-26f0-b996-406422db6928" class="x_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>
Check your settings at: <a href="https://synth-diy.org/mailman/listinfo/synth-diy" id="OWA4d44c6af-c078-133d-9db7-e9862a7a86db" class="x_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>
Selling or trading? Use marketplace@synth-diy.org</div>
</body>
</html>