Stupid idea for stupid (optical) compressor

Started by Top Top, March 01, 2011, 04:03:21 AM

Previous topic - Next topic

Top Top



So this cobbles together a few circuits.

1) A 386/simple percussive envelope generator "envelope follower." The 386 amp is basically the datasheet example, or a ruby minus the buffer.
2) Buffers/Gain stages.

I've got this going on my breadboard, and it works. It can do some really obvious pumping compression as well as more subtle overall gain reduction stuff. I've tested it with guitar and drums and stuff. It sounds better with anything but guitar, where any distortion becomes a lot more obvious.

At the moment there are four controls -

1) input gain (which is interactive with the next control in a way in that it drives how bright the LED will get and thus the amount of gain reduction)
2) Compression amount (decides how much of the signal is allowed to get dumped to the LDR, and as a result, dumped off)
3) Decay (is this the right term? Sets how long the compression envelope will be - long times equals longer/smoother compression, short time = more pumping)
4) Recovery gain

Basic idea - input goes to gain stage - gain stage is split off to a buffer for the audio path, and a 386 for the envelope path.

After the buffer, the audio gets routed to an LDR to ground, and a gain stage for the output.

The 386/envelope generator lights an LED, which drops the resistance on the LDR to ground, dropping audio volume level.

The buffer on the audio side keeps the signal from getting back-attenuated at the 386's input (which would interfere with the compression control and the amount of compression available in general).

What's left of the audio signal after getting dumped off goes to the final gain stage, which brings the overall level back up.

I left the "buffer" and gain stages generic in the diagram. Could be opamps or discreet. I am useing JFET buffers and gain stages, but only because I have an irrational aversion to opamps.

That big fat cap keeps the whole thing from clicking/distorting when the 386 really gets moving. That becomes an issue when you put big caps like those in the envelope generator section.




I know there are things that are probably very stupid about this design, which is why I present it to you - tear it apart.



Questions:

1) If I used some other method of pumping up the envelope generator, could I avoid needing that big cap? Would an opamp or transistor design provide enough current to pump the envelope caps full of current long enough to make a decent envelope?

2) Is the whole envelope section just stupid? Is there an equally simple way of doing it that will provide long decay times?

3) My gain stages tend to distort a little bit at their upper limits. I am essentially using Tim E's JFET "utility boost" in that section. I have no idea what the gain of that circuit actually is. Should I just give in and use opamps? It can be set to acceptable levels, but needs tweaking to get right.


Gurner

#1
Hmmm...in my opinion, this implementation attemtps to effect 'signal' size in the same way as the tiny tremolo - ie on the face of it, you're trying to use an LDR as a POT - but a pot is a potential divider & has three legs (one being the output),whereas an LDR only has two legs.

Cutting to the chase of what's going on  here, what you're actually doing is altering the load that your 'buffer' stage output 'sees' - so with that 250k control pot turned fully to the left the LDR is going to swing between it's dark  light resistance (100ks) & it bright light resistance (a few k) ...this will vary the signal magnitude a little (depending on your choice of buffer), but it's a peculiar way to try and affect a signal's magnitude (if for example you buffer could tolerate a heavy load, then it's quite possible the signal would not change in level at all)

It's perhaps worth underlining again (as I've just mentioned in the tiny tremolo thread)....an LDR is not a pot (ie a potential divider with three connection) - it's a variable resistor (with just two connectors)....therefore an LDR can't be used like a pot on its own....it need to be used in a configuration where it replaces a component with just two connections (ie a std two legged resistor!)

To improve your circuit a little - ie ensure the signal varies in magnitude with LED brifghtness - make the LDR part of a potential divider chain....ie have the feed into your final variable gain stage come from the junction between the ldr & the control pot.

Other comments are - you need a resistor between the 386 out and the cap - and at first glance,  those diodes don't look right to me (where did you take that diode arrangement from?)

in my opinion, you need to buffer the DC on the 500uf cap because the LED is going to load the cap too much. Your 1M decay will have negligible  effect as it's in parallel with the RED led (it might not look like it is - but that's becuase of how you've drawn it out - but it is) -  the forward resistance of the LED will be very low, so really that fixed 1k resistor after the led is acting as your (very fast!) decay.

Top Top

You were correct about the diode in the envelope section. The one from ground up should have been before the one in line with the cap. I corrected it in the original post now.

That part of the schem is based a synthesizer circuit for a simple percussive envelope generator that I have seen floating around. I am not sure the exact origin, but I think it was used in some old polysynth or maybe an analog drum machine. I've used variations on that circuit in a lot of things. The only thing I have really changed is changing the caps from 10uF to the values you see.

The decay DOES in fact work. You can see the decay reflected in the LED and also in the sound of the compressor. At lowest settings, it is a very fast decay before resetting, and at higher settings, it is a much smoother/slower envelope following type of thing.



Ok... as for the comments about the use of the LDR. This particular one, I believe gets above 1M in the dark, just FYI.

One thing I am sorry I should have put into the diagram is a 10K resistor between the buffer and gain stage, also now fixed. That probably does change things a bit in terms of what you were thinking about the circuit, but that is interesting what you suggest about putting the pot between the input to the gain stage and the LDR.

Now, what I will say about the LDR in there is it does work. Whether it works according to good design or electronic understanding might be another issue, but it DOES work. The compression amount pot also DOES work, and over the whole range, in varying degrees of usefulness depending on the level of the input signal and other settings.

As far as what I understand about the flow of the current is at that junction (the pot/LDR in series, and the 10K before the gain stage), the current has an "option," and will chose whatever option presents the least resistance. When the LDR falls low enough, it starts to move in that direction (towards ground), and the amount of signal that will go to the final gain stage is diminished.

Now, I don't know if I am 100% right about that working the way I think it should... but what I do know is that in this circuit, the brighter that little LED gets, the less of the signal that goes to the final gain stage. It definitely works as a compressor, though it is slow to get sharp peaks on things like drums (but that is common with optical compressors).

artifus

Quote from: Gurner on March 01, 2011, 05:03:27 AM
those diodes don't look right to me (where did you take that diode arrangement from?)
Dod 440

got a similar arrangement on breadboard at the mo. started with 386, now on 741 - toptop, we seem to be on parallel lines of thought recently!

also, am reminded of this: Ultra Simple Bass Guitar Compressor

Gurner

#4
Quote from: Top Top on March 01, 2011, 05:44:34 AMNow, what I will say about the LDR in there is it does work. Whether it works according to good design or electronic understanding might be another issue, but it DOES work. The compression amount pot also DOES work, and over the whole range, in varying degrees of usefulness depending on the level of the input signal and other settings.

I never said it wouldn't compress, but....you could have a whole lot more compression going on if implemented in a different manner. I don't want to come across as negative & I applaud you rolling your sleeves up & having a pop!

Again, as you've drawn it, the LDR is merely acting like a variable load to your buffer opamp - you're obviously getting results of sorts, but - being blunt/candid - it's not the optimum way to approach getting the most compression (& for so many stages/components)

Quote from: Top Top on March 01, 2011, 05:44:34 AM
The decay DOES in fact work. You can see the decay reflected in the LED and also in the sound of the compressor. At lowest settings, it is a very fast decay before resetting, and at higher settings, it is a much smoother/slower envelope following type of thing.

Re the decay control - again, I never said it wouldn't work, but the decay control is likely to be small (that's why I said neglible), have a look at this Eagle schem I've just knocked up of your cct extract & see if  if it helps underline the problem


(apologies for the spelling & grammar mistakes  in that diagram - I'm doing all this at a fair old lick!)


You're essentially using a 1M pot, but it's in parallel with a 1k resistor......with the 1M pot fully up, the cap will 'see' about 900 ohms...this will decrease towards zero at the other end of the pot travel - so you've effectively place a 900 Ohm variable resistor across the cap. What you want to control decay effectively is much more resistance 'swing' - that's why I said to buffer the LED.

BTW, the 10k resistor you've added in - not sure why? (what's it's purpose)



Top Top

@ artifus - that is interesting. I had NO idea that was from an effect. I do think something similar was also used in some synthesizers.

@ Gurner

About the decay -- Looking at what you drew there, I understand what you are saying... but on the other hand... the decay control works, and in a way that is very discernible, over I'd say around the first 1/4 turn of the pot (that is where it is most obvious). It seems that it does things over the entire range, but it could just be a trick of the mind beyond a certain point - longer decays are hard to hear in compression, but according to the rate of the varying of the brightness of the LED, it seemed to be doing something.

It definitely does something over more than just the tiny amount of a 1M pot that would cover the first 900ohms.

I am not sure why that would be... but it is... I will try putting a resistor in line somewhere to see if I notice a difference in the decay. Do you suggest between the 500uF cap and ground? Before the 100uF cap at the start of the envelope chain?



As for WHY the 10k resistor... I tried putting no resistor there and found the compression worked better when there was SOMETHING there. I tried 100K 1M, etc... 100K and 10K didn't have a drastic difference in sound, if I remember. I can't remember what 1M sounded like

As to why I had the idea at all... it might just be my misunderstanding, but I thought that the current would chose a path - between the 10k, or the LDR. When the LDR is higher, barely any of the signal would pass to ground, and would just "chose" to go through the 10k. When the LDR drops, with it being two resistors in parallel going in different directions (isn't this a "voltage divider?"), some of the signal starts to seep through to ground, but some still goes through the 10k to the gain stage. When the LDR gets down VERY low, ALL the signal would go to ground.

I am not sure what part of that I am misunderstanding, probably the whole thing.

Also, likewise, I am not trying to be negative or reactive... I want to improve this design as I am sure it is possible (want to make it, and myself, un-stupid), I am just clarifying what would appear to not work but does, and looking for the 'whys' in how to improve it, so I can learn from an adventure like this.

What I don't understand about putting the 250K pot between the LDR and the input to the gain stage (in place of the 10K resistor, essentially, right?) -- why is that drastically different from being between the 10K and the LDR? Either way, it is altering the resistance the current has in front of it to go down ONE of the two "options" at that fork in the road.

Gurner

#6
Quote from: Top Top on March 01, 2011, 06:27:05 AM

About the decay -- Looking at what you drew there, I understand what you are saying... but on the other hand... the decay control works, and in a way that is very discernible, over I'd say around the first 1/4 turn of the pot (that is where it is most obvious). It seems that it does things over the entire range, but it could just be a trick of the mind beyond a certain point - longer decays are hard to hear in compression, but according to the rate of the varying of the brightness of the LED, it seemed to be doing something.

It definitely does something over more than just the tiny amount of a 1M pot that would cover the first 900ohms.


No, you're picking me up wrong - I'm not saying that it's only the first 900 Ohms of the 1M pot that will have any effect - I'm saying that with the pot max....the cap only 'sees' 900 ohms of total resistance (not 1M), with the pot at min the cap sees zero ohms (btw - in this scenario, you're shorting the cap voltage straight to ground which is very bad, put another resitsor in series with your 1M pot to ground!)...the travel of the pot is essentially varying the resistance from 0 ohms to 900 ohms (you're not getting 1M of resistance travel)  - so the pot will have an affect all the way along it's travel, but only to the tune of between 0- 900 Ohms.....you really need the 500uf cap to see much larger resistances to lengthen the decay time.

Quote from: Top Top on March 01, 2011, 06:27:05 AM

As to why I had the idea at all... it might just be my misunderstanding, but I thought that the current would chose a path - between the 10k, or the LDR. When the LDR is higher, barely any of the signal would pass to ground, and would just "chose" to go through the 10k. When the LDR drops, with it being two resistors in parallel going in different directions (isn't this a "voltage divider?"), some of the signal starts to seep through to ground, but some still goes through the 10k to the gain stage. When the LDR gets down VERY low, ALL the signal would go to ground.

I am not sure what part of that I am misunderstanding, probably the whole thing.

You probably need to do a bit of of reading about opamp loads - ie AC signal current paths & the resulting outcome on the signal voltage.

Take the variable 250k resistor out of play for simplicity - ok, let's say you've 1V AC signal coming out of your buffer - if the LED is dark, the LDR will have a high resistance (fwiw, the LDR is your buffer 'load'), then the 1V AC will be dropped across the LDR ie 1V AC at the top, 0V at the bottom of the LDR. Ok, now if the LED is high, the LDR resistance will be low - guess what you've still 1V AC signal being dropped across the LDR - ie there's still 1V at the top & 0V at the bottom of the LDR ...it's now being dropped across a lower resistance (a heavier load on the buffer), but with only the LDR resistance 'in play' there's been NO actual effect on the signal voltage at all (assuming your buffer can handle the LDR load)...it's the current that has changed  ....it's not possible to compress a Voltage signal if the AC voltage signal doesn't change.

Quote from: Top Top on March 01, 2011, 06:27:05 AM

What I don't understand about putting the 250K pot between the LDR and the input to the gain stage (in place of the 10K resistor, essentially, right?) -- why is that drastically different from being between the 10K and the LDR? Either way, it is altering the resistance the current has in front of it to go down ONE of the two "options" at that fork in the road.

Becuase, as your circuit is drawn the main/significant opamp signal current path is from the output of the buffer through the 250k control pot, through the LDR to ground - by changing the junction at which you feed the final gain stage to that between the 250k control pot & the LDR, you've created a potential divider....now then as the current increases/decreses (by the LDR changing resistance), you'll get a potential divider action going on.....and the signal voltage will vary.

Top Top

#7
Quote from: Gurner on March 01, 2011, 06:49:19 AM
Quote from: Top Top on March 01, 2011, 06:27:05 AM

What I don't understand about putting the 250K pot between the LDR and the input to the gain stage (in place of the 10K resistor, essentially, right?) -- why is that drastically different from being between the 10K and the LDR? Either way, it is altering the resistance the current has in front of it to go down ONE of the two "options" at that fork in the road.

Becuase, as your circuit is drawn the main/significant opamp signal current path is from the output of the buffer through the 250k control pot, through the LDR to ground - by changing the junction at which you feed the final gain stage to that between the 250k control pot & the LDR, you've created a potential divider....now then as the current increases/decreses (by the LDR changing resistance), you'll get a potential divider action going on.....and the signal voltage will vary.

Ok... well I obviously have a lot yet to understand, but let me ask one last question. Why is the junction between the 10k resistor and the 250K pot/LDR as it is now NOT a potential divider. I guess what I am not understanding is why is the 250k variable resistor any different than a fixed 10K one, other than the obvious value and variability differences?

Or are you suggesting to configure the pot in a way different than just as a variable resistor in place of the 10k? Are you suggesting to have the wiper of the pot go to the LDR -> ground? and the other two pins go to the output of the buffer and input of the gain stage respectively? OR maybe the wiper to the gain stage and the other two pins the buffer output and the LDR, respectively, or some other combo?

Gurner

#8
Quote from: Top Top on March 01, 2011, 07:13:16 AM
Ok... well I obviously have a lot yet to understand, but let me ask one last question. Why is the junction between the 10k resistor and the 250K pot/LDR as it is now NOT a potential divider. I guess what I am not understanding is why is the 250k variable resistor any different than a fixed 10K one, other than the obvious value and variability differences?

Because the LDR is your buffer's main  'load' (first pic I could find with google images - http://www.maxim-ic.com/images/appnotes/1868/DI403Fig02.gif the 200 Ohm resistor is the load, but in your scenario it's your LDR). Your 10k resistor - which has even higher resistance following on - the other side of it (which is your finalgain  stage's input impedance) ...is going to have very little load on the buffer's output - and it's current through resistance that affect voltage swing.

Quote from: Top Top on March 01, 2011, 07:13:16 AM
Or are you suggesting to configure the pot in a way different than just as a variable resistor in place of the 10k? Are you suggesting to have the wiper of the pot go to the LDR -> ground? and the other two pins go to the output of the buffer and input of the gain stage respectively? OR maybe the wiper to the gain stage and the other two pins the buffer output and the LDR, respectively, or some other combo?

Please read my earlier replies again (it's all in there!) .....the control pot should form the first part of a potential divider, the LDR the second - the junction of these two should feed your final gain stage. Ok as I say, the LDR presents a varying load to the buffer, the current increases decreases according, but now the control pot & LDR have been arranged as a potential divider so the AC signal voltage will increases/decrease at their junction.


Top Top

Quote from: Gurner on March 01, 2011, 07:19:02 AM
Please read my earlier replies again (it's all in there!) .....the control pot should form the first part of a potential divider, the LDR the second - the junction of these two should feed your final gain stage. Ok as I say, the LDR presents a varying load to the buffer, the current increases decreases according, but now the control pot & LDR have been arranged as a potential divider so the AC signal voltage will increases/decrease at their junction.

I am sorry, but I think it is something I am still missing due to terminology that I'm not familiar with, and lack of visualization skills.

I will have to read up more on the normal configuration of a potential divider because I think that is the part that is tripping me up.

Gurner

#10
Last try, here's your equivalent cct...



the LDR is going to be very low vs the 10k resistor combined with the (fixed) input impedance of the follow on stage.

So, It's the LDR that's going to have all the influence wrt 'load' for the buffer's output.

Also the (fixed) 10k resistor forms a potential divider in conjunction with the (fixed)  input impedance of your final gain stage ...therefore in theory, the voltage signal should not waver there - becuase the current should be constant into that part of the circuit.


i'm suggesting this...



(bin the 10k resistor too.)

It functions as follows...input signal increases, resulting in more voltage on your 500uf cap, the LED gets brighter (but like I say the voltage on the cap should be buffered), the LDR resistance decreases, therefore more current flows throw the combined 250k resistor & LDR...therefore more AC signal voltage is dropped across the 250k variable resistor - & ultimately the signal is reduced onwards to the final stage. Now, if input signal decreases, the LED gets darker, the LDR resistance increases, less current flows through the 250k variable resistor & LDR, accordingly less signal voltage is dropped across the 250K, signal voltage is increased onwards to the last stage of your circuit....the result is a varying AC voltage at the LDR variable resistor junction.

To get maximum voltage swing (compression) effect at that junction, you need to 'match (spec) your variable resistor well with your LDR.

CynicalMan

I'm not trying to be negative, but why use a 386 when you could use a dual or quad op amp and use one for the envelope and the rest for gain stages? Also check out the demeter compulator on the other forum. It uses an ldr to ground for compression too iirc.

Johan

http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=3839&g2_serialNumber=2

if you do it the way that Gurner says and replace the 2k7 resistor underniegh the comp/limit switch in my old comp, with a pot as he has drawn it, you might even get away from the smooth "is it on" compression and get into "compression for effect" territory.
J
DON'T PANIC

Gurner

Quote from: Johan on March 01, 2011, 12:30:08 PM
http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=3839&g2_serialNumber=2

if you do it the way that Gurner says and replace the 2k7 resistor underniegh the comp/limit switch in my old comp, with a pot as he has drawn it, you might even get away from the smooth "is it on" compression and get into "compression for effect" territory.
J

Just to clarify...I'm not advocating any particular values (I used the values from the original schem at the top of this thread) ...just concepts!

Personally, if I was wanting to affect signal level using an LDR, I wouldn't go the route discussed further up, but use it where it's more related to it's function (a two legged variable resistance) & put it, say in a opamp feedback chain.

Johan

Quote from: Gurner on March 01, 2011, 02:53:58 PM
Quote from: Johan on March 01, 2011, 12:30:08 PM
http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=3839&g2_serialNumber=2

if you do it the way that Gurner says and replace the 2k7 resistor underniegh the comp/limit switch in my old comp, with a pot as he has drawn it, you might even get away from the smooth "is it on" compression and get into "compression for effect" territory.
J

Just to clarify...I'm not advocating any particular values (I used the values from the original schem at the top of this thread) ...just concepts!

Personally, if I was wanting to affect signal level using an LDR, I wouldn't go the route discussed further up, but use it where it's more related to it's function (a two legged variable resistance) & put it, say in a opamp feedback chain.

I realize that. I am just pointing out to what you suggest would look like in a shematic and points to a schematic very similar to what he wants to do. For guitarwork, my comp is too suptle in my opinion and better suited for bass. for guitar I personaly would go with the "Flatline", but this one is near his approach and might inspire ideas in the direction he has taken.
DON'T PANIC

Top Top

@ Gurner thanks very much for drawing that and for your patience. I NOW finally get it  :icon_lol:

Quote from: CynicalMan on March 01, 2011, 10:48:34 AM
I'm not trying to be negative, but why use a 386 when you could use a dual or quad op amp and use one for the envelope and the rest for gain stages? Also check out the demeter compulator on the other forum. It uses an ldr to ground for compression too iirc.

It doesn't say really intelligent compressor in the title, does it?  :icon_lol:

Mainly I was going about this in a way of doing things that I know works from experimentation. I wasn't really using any particular circuit as a reference for it. Most of the effects I have designed have been cmos synth-like sound mangler circuits and not along the lines of normal audio processing circuits. I know a 386 will charge that envelope generator circuit. I didn't know if an opamp would pump enough current through.

I have not even seen examples of other optical compressor circuits, as the most popular ones that I have seen around seem to be other designs. The next thing will probably be to convert the whole thing over to opamp, or cmos inverters forced into linear (which many people will love, I know :icon_biggrin:)

Quote from: Johan on March 01, 2011, 12:30:08 PM
http://www.aronnelson.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=3839&g2_serialNumber=2

if you do it the way that Gurner says and replace the 2k7 resistor underniegh the comp/limit switch in my old comp, with a pot as he has drawn it, you might even get away from the smooth "is it on" compression and get into "compression for effect" territory.
J

I do say, that even though my design is flawed, I am getting both "is it on" and "compression for effect" the way you see it now. If I wasn't getting anything at all out of the circuit, I wouldn't have felt confident enough to even post a block diagram.

Johan

Quote from: Top Top on March 01, 2011, 03:25:18 PM
... I am getting both "is it on" and "compression for effect" the way you see it now.

then.."Thumb's up"...I couldnt find the smily for that one.. ;D
DON'T PANIC

Top Top

Also meant to say though, thank you for giving me the reference of a schem to look at.