Controlling guitar volume with microcontroller

Started by JP19, July 01, 2022, 05:10:55 PM

Previous topic - Next topic

ElectricDruid

Quote from: idiot savant on July 22, 2022, 06:19:13 PM



I think it needs +4.5V going in to that 47K, assuming you want that 20dB of gain that is specified.

I don't think so, because the 0-5V gets inverted too. So we have 0V to -3.8V coming out. -3.8V is much too negative, so we need to push that up to -0.66V. That requires +3.2V offset, and a +3.2V offset at the output needs a -3.2V offset at the input.

Does that make sense? It's extremely easy to get tangled up with all these inversions...

mark2

Sorry if I missed something, but you're just trying to jump between preset volumes?

Why not 2 volume pots and a stomp switch to toggle between them?

idiot savant

Quote from: ElectricDruid on July 23, 2022, 07:16:52 AM
Quote from: idiot savant on July 22, 2022, 06:19:13 PM



I think it needs +4.5V going in to that 47K, assuming you want that 20dB of gain that is specified.

I don't think so, because the 0-5V gets inverted too. So we have 0V to -3.8V coming out. -3.8V is much too negative, so we need to push that up to -0.66V. That requires +3.2V offset, and a +3.2V offset at the output needs a -3.2V offset at the input.

Does that make sense? It's extremely easy to get tangled up with all these inversions...

It's drawn as a single supply.

As drawn 0V into this will make 9V at the output. Similarly, 5V into this will make 5.4V-ish at the output.

Here's a quick and dirty Falstad sim:

https://tinyurl.com/24trqhk3

You solution will absolutely work if it had:

1. A bipolar power supply
2. The non-inverting input referenced to 0V

However, OP states that he's using a single supply. The drawing also shows a single supply.

To be fair, I also highly recommend using a bipolar power supply. It would make things much simpler overall.

As drawn, there is no way for a single supply opamp stage to output voltage below ground. It can't work, unless I'm just way off base. If so, I sincerely apologize.

Further to this whole thread, the 2 points I'm concerned about:

1. Why is there need to reduce your available CV swing from 0-5V to less than that? I don't really see any practical reason to do so, offsetting is fine, but why reduce the CV?
2. You could get through this whole exercise, only to realize that the exponential response isn't ideal for a volume control. Hence, my suggesting a linear control circuit instead.

ElectricDruid

#23
Quote from: idiot savant on July 23, 2022, 03:59:33 PM
You solution will absolutely work if it had:

1. A bipolar power supply
2. The non-inverting input referenced to 0V

However, OP states that he's using a single supply. The drawing also shows a single supply.

To be fair, I also highly recommend using a bipolar power supply. It would make things much simpler overall.

As drawn, there is no way for a single supply opamp stage to output voltage below ground. It can't work, unless I'm just way off base. If so, I sincerely apologize.
No, you're totally right - there's a disconnect on that schematic between the given power supply voltages and the given CV voltages. *If* you assume a +/-4.5V supply, then the CV voltages are referenced from the midpoint and it all starts to work. If you assume "ground" is the lowest voltage point in the circuit, as drawn, then I completely agree, you're going to be in a world of pain!!

Quote
1. Why is there need to reduce your available CV swing from 0-5V to less than that? I don't really see any practical reason to do so, offsetting is fine, but why reduce the CV?
Because unless you use a more complicated circuit like the linearised-VCA you posted, the 2164's CV range is only -0.66V to 3.3V. That's not a 5V range, hence the need for the scaling.

Quote
2. You could get through this whole exercise, only to realize that the exponential response isn't ideal for a volume control. Hence, my suggesting a linear control circuit instead.
On the contrary, exponential control is *more* commonly used for volume control. Our ears hear "equal" amounts of sound in decibels (e.g. exponential). That's why we have log pots for volume, and why chips like this were designed with exponential V/dB responses for their original application in mixing desks.
Linear VCAs for volume turn up in analog synths a lot, but that's because analog envelope generators create an exponential attack and decay. If you run that to an exponential VCA, it sounds abrupt!!

idiot savant

Cool!

I definitely agree on your points.

Regarding the power situation, I have had success using simple charge pumps for making the bipolar supply when I've used the 2164 in various applications. It works quite happily at -5/0/+5 in my experience, though that's probably as low as I would go.


ElectricDruid

Quote from: idiot savant on July 23, 2022, 07:48:19 PM
Regarding the power situation, I have had success using simple charge pumps for making the bipolar supply when I've used the 2164 in various applications. It works quite happily at -5/0/+5 in my experience, though that's probably as low as I would go.

As far as I can see, the original SSM2164, the AS2164, and the SSI2164 datasheets all agree that +/-4V (so 8V supply) is the absolute minimum, which means a 9V supply is cutting it pretty fine, and your +/-5V as a "probably as low as I would go" sounds pretty sensible to me. 9V is still within spec, but it really *is* cutting it pretty fine.

Also good to know the charge pumps work for this chip.

Thanks,
Tom