One signal controlling the volume of another | Sidechain Follower

Started by wvnl, October 13, 2024, 11:15:13 AM

Previous topic - Next topic

wvnl

Hi, I'm fairly fresh to all this but I've been working on a pedal design, and I'm keen to get some ideas on this part.

What I'm doing: Currently the pedal generates a couple of additional signals which get summed with the guitar signal.
These signals are continuous/fixed volume, and I'm adding a "dynamic" mode where they follow the dynamics of the guitar.

After looking through various noise gate, volume detector, and envelope follower designs I put together this - it combines an amp stage, bridge rectifier and an opto-coupling transistor:



Here's where I'd like ideas: the final stage is affecting the gain/biasing of the transistor. It works but as it gets quieter it gets very grainy/gated. It's actually kind of cool sounding but I'd like something much smoother.
I know one approach is the DIY vactrol, heatshrink tubing an LED & LDR together, but I felt like that might not be so reliable/consistent if at some point I wanted to make multiple of these (? not sure).

EDIT: the env follower is actually not working like I thought it was, it's pushing a square wave through. I have to revisit stuff but I'd still appreciate any ideas!

ElectricDruid

Welcome!

I'd have a look at the diode choice for the bridge. 1N5818 is a heavy-duty rectifier diode, and here you're not building a power supply and trying to rectifiy an AC supply into a DC one - you're just trying to turn an AC *signal* into a DC one! I'd replace them with 1N4148 or 1N914 for starters and see whether that improves things. Germanium diodes would be better still, but they're hard to get these days and often faked, soI don't think it's worth it. With the gain you have in the amp stage, it shouldn't matter much anyway.

HTH,
Tom

wvnl

I fixed the envelope follower, I realise the bridge rectifier was not the right type of thing for this. Now there's none of the guitar signal spilling through, but the transistor graininess remains.



Ah thanks Tom! yeah I did try 1N4148s when I was first building it actually and they worked well - I was mostly tinkering by ear at that point and liked the 1N5818 but yeah I since realised the diode configuration wasn't right anyway so I'll experiment some more!

ElectricDruid

The change between the first schematic and the second is from a fullwave (bridge) rectifier to a halfwave rectifier. The second one will perform worse than the first one in terms of ripple, but has the advantage of reducing the diode-drop losses from "two diodes" (about 1.2V) to "one diode" (about 0.6V) which is probably why you're hearing an improvement.


wvnl

Hmm yeah it would be nice to return to the full wave rectifier, but I don't think I ever had it hooked up right. When I unplugged the 2nd signal (using white noise) I realised I was getting lots of the guitar signal come through.
I put together a simulation on circuitJS and I could see it wasn't rectifying correctly. With the 2nd version it was at least rectifying. Testing on the breadboard I'm not getting the spill anymore.

Diode selection doesn't seem to make much noticeable difference but I have the 1N4148s in now and I'll stick with those

PRR

Quote from: ElectricDruid on October 13, 2024, 07:09:11 PMfrom a fullwave (bridge) rectifier to a halfwave rectifier.

No, the second version gets both sides of the wave. C3 catches the negative peak and C4 slowly integrates that with positive peaks. It is not something I would do but....

I wonder where the opto-transistor biases to. The 10k in the collector seems pointless, and the 220r in the emitter is so much lower I'd fear clipping everything. And if output ever exceeds 20mV-50mV it will have large distortion.

  • SUPPORTER

Rob Strand

Quote from: wvnl on October 13, 2024, 06:55:41 PMNow there's none of the guitar signal spilling through, but the transistor graininess remains.
Doing gain control with a transistor/opto like that isn't linear so the output isn't just a gain controlled version of the input.    You might get it to work over a narrow range of control  That's why you see JFETs, and OTA's used for gain control.

Another shortcoming is the when the control signal changes is modulates the output so the gain control signal gets into the audio.

If your signals were flat-topped like square-waves then you can use much simpler gain control.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

wvnl

Thanks!
Quote from: PRR on October 13, 2024, 08:23:40 PMI wonder where the opto-transistor biases to.
Every example I could find using the 4N35 just has a 10k on either the collector or emitter. I since removed the collector resistor and swapped the emitter resistor with a 100k trim pot. Sweeping the pot, there's no sweet spot, it affects both gain and release time.

Quote from: Rob Strand on October 13, 2024, 11:25:49 PMDoing gain control with a transistor/opto like that isn't linear so the output isn't just a gain controlled version of the input.
Yeah this lines up with what I'm experiencing - if I remove the control signal entirely and just put a potentiometer to 9v going into the opto, it fully cleans up at higher voltage and sounds unbiased/gated at low voltage.

I think at this point, now that I understand slightly better, I'll revisit some more tested full wave rectifier schematics and look at alternatives for the opto.

Any examples of JFETs or OTAs being used for this kind of gain control would be great!
Any preferred rectifiers would be great also

antonis

Quote from: ElectricDruid on October 13, 2024, 07:09:11 PMThe second one has the advantage of reducing the diode-drop losses from "two diodes" (about 1.2V) to "one diode" (about 0.6V)

"Two diodes drop" for 1N5818 equals to "One diode drop" for 1N4148.. :icon_wink:
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

Rob Strand

Quote from: wvnl on October 14, 2024, 04:34:41 AMYeah this lines up with what I'm experiencing - if I remove the control signal entirely and just put a potentiometer to 9v going into the opto, it fully cleans up at higher voltage and sounds unbiased/gated at low voltage.

I think at this point, now that I understand slightly better, I'll revisit some more tested full wave rectifier schematics and look at alternatives for the opto

Well you might be able to pass a small current through the opto LED so the transistor is just on (or on enough to sound OK.)     Can't say if it will be enough.

Next would be to play with the 1k on the opto LED to limit the on current of the transistor.

After that would be getting the control to appear even by adding diodes.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

amptramp

You might need a 1495 or 1496 analog multiplier as the gain changing element with differential optoisolators driving the bottom transistors.  The dynamic range is limited but you should be able to achieve good control.  There are other DC level adjusted audio attenuators used as volume controls that might do what you want.

R.G.

At a more fundamental level, you're dealing with special cases of two functions in effects and signal processing, those being (...duuh) deriving a voltage proportional to the signal volume, and amplitude modulating a signal.

There are gotchas in these functions, as they are not easy to do with discrete silicon devices. Full wave rectifier circuits lose a diode drop to the diodes unless you mess with trickle biasing or the signal is so big that a diode drop doesn't matter, as Rob and others note. As Rob also notes, a bipolar junction transistor is a clumsy volume modulating device. It works, but it's highly prone to cross modulation and to work well with low distortion needs a signal down in the range of 20-50 mv.

As Amptramp notes, the 1496 will do the VCA function. I've always found the 1496 to be tricky to use, and go to OTAs like the LM13700. Nearly all VCAs use the current-to-gain nature of an emitter-biased differential pair and then a diffamp afterwards to convert back to a single ended signal. The 1496 does this. OTAs do this, but case it up in a nicer package so you can feed a current in to modulate the gain. Most analog synth VCAs did the same thing, just with different surrounding circuits to fit the signal levels.

It's too bad that the NE571 and SE571 chips are so hard to find. These chips are a dual signal-to-voltage converter and dual VCA. They were made for implementing compressors, but deliberately had the signals brought out so they could do other signal processing tasks. I have a dim memory of a sidechain modulator like you're proposing in the app notes. It's dim, because I haven't looked at the app note in probably a decade. I think one of these chips would do what you want - twice.

If I had to do what you're proposing, I would use a two-opamp full wave rectifier/averager to get the signal level without losing a diode drop to the diodes. One more opamp than you're using gets you this. I would probably use an LM13700 for the VCA, and a third opamp to convert the averaged signal level to a linear current feed to the bias current input on the OTA. That sounds complicated, but it's really two 16 pin chips and associated Rs and Cs. It should be possible to get this into a 1" by 1.5" pcb area. Or if I only needed one for me and one for my band mate, I'd go flog the surplus markets for an NE/SE571.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

wvnl

Thank you all for the great info, this has given me plenty to research!

Yeah I'd definitely like to revisit the amp/rectifier stage, the 2 opamp setup is one that I poked at before but I'll take another stab at it.

For the kind of signals I'm generating I think I might be able to get away with a certain amount of clumsy - I'm looking up JFET VCAs currently. I don't have any JFET yet so I've knocked something up temporarily just using an additional BJT stage, where the opto-transistor now just outputs control voltage instead of signal, and it's already a huge improvement. It's sounding much cleaner and I gained separation between ripple control and release time. I'll see if a JFET and full wave rectifier gets me there.

But I'm also keen to look into the OTAs mentioned - this started as a final small feature to a mostly finished pedal, but now I've spent the time on it I'd like to explore it more.

amptramp

Any time you are controlling an audio signal with a control voltage, you have to set the time constants for control voltage attack and release times.  Most applications use fast attack and slow release but you may want to play around with the time constants for each.  The fullwave rectifier guarantees that you wont get a different effect when you pick the string upwards compared to downwards, so it is a necessity for most applications.

You may even try the analog synth ADSR envelope of attack - decay - sustain - release where the decay defines the overshoot of the control voltage and the sustain may be done by various means involving fuzz / distortion / overdrive or compressors and limiters.

R.G.

One of my favorite schemes I never fully implemented was a multichannel fade. This started with listening to a Beatles song where they were trading licks with different guitar tones. I envisioned having a couple or several channels of effects pedals with different tone qualities in the channel, and fading back and forth between tones.
I envisioned this a as a logic circuit with four (or more...) footswitches. Whacking a footswitch makes the setup fade over to that loop. Kind of like a loop selector, but with fading, not instant switching. No biggie, conceptually. A footswitch circuit watching for which footswitch was pressed, then a logic "1" for "OK, this channel is active now." The faders/VCAs get moderately complex. There's a voltage controlled attenuator/amplifier per channel, and some analog circuits, one per channel, that controls fade-in/attack and fade-out times per channel, with a control on those time constants.
My personal mania is that this would be a really fun thing to do when your guitar is front and center.

Shoot, I can't stop designing. Each channel ought to have two footswitches - one for fade to the next selected channel, one for instant switch. Sigh - so many designs, so little time.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.