Leading Edge Envelope Detector ideas please

Started by frequencycentral, December 28, 2008, 08:10:31 AM

Previous topic - Next topic

frequencycentral

From what I understand, these devices will produce a synth like decay regardless of the inputted note length. I'm intruiged by this idea but I need to look at a few schematic examples to get my head around it. I'm also curious as to how well they work ie. do you have to adapt your playing style, are there issues with false or failed triggering etc.

Any ideas or pointers?
http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

gez

#1
If I were designing such a circuit, I'd use a 'one shot' (timed pulse - google it and you should come across examples).  Then use a ramping circuit to set attack/decay.

CMOS 4098 might be worth a look at (it's a nice little chip).
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

StephenGiles

Quote from: frequencycentral on December 28, 2008, 08:10:31 AM
From what I understand, these devices will produce a synth like decay regardless of the inputted note length. I'm intruiged by this idea but I need to look at a few schematic examples to get my head around it. I'm also curious as to how well they work ie. do you have to adapt your playing style, are there issues with false or failed triggering etc.

Any ideas or pointers?

You may have noticed that I have been making noises in that direction for quite a while! Gez, I designed an envelope generator using a 4098 over 20 years ago so if I come across it I'll upload the circuit. My prime motivation has been to modify the EH Microsynth sweep generator so that it provides a peak to the sweep proportional to the strength of the note played with "a synth like decay regardless of the inputted note length" In fact the EH Crash Pad sweep generator might be easier to work with.
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

frequencycentral

http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

frequencycentral

http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

gez

The advantage of the 4098 is that it's re-triggerable and it's incredibly simple to setup.  Re-triggerable means it just adds time to the pulse if you get a little bit of ripple/blip within the time period, or if you're playing a flurry of notes (heaven forbid!)  Sounds more musical and behaves a little more like an envelope follower if you do this.  You also get anti-phase outputs (one up whilst the other is down) with this chip.  These can be used with an OTA ramper to set attack and decay times (separate pots, via diodes, to the Iabc pin) to shape the pulse.  I outlined an OTA ramper in a post once.  Only in the last year or two, IIR.  Can outline something in more detail if you're interested, but something's on the telly shortly so not now (well, it is Xmas).
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

frequencycentral

Quote from: StephenGiles on December 28, 2008, 11:41:43 AM
I designed an envelope generator using a 4098 over 20 years ago so if I come across it I'll upload the circuit.

Quote from: gez on December 28, 2008, 02:45:55 PM
Can outline something in more detail if you're interested, but something's on the telly shortly so not now (well, it is Xmas).

That would be great if you could gez and Stephen - no rush, I'm interested for the next envelope fliter I build, which won't be for a while. It's just something I thought I should research having just completed my "Funky MF" and finding that this type of function would be good to have.
http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

flo

#7
I'm interested also in this "OTA ramper" so if you find the time, please post about it.

The downside of using a 'one shot' is that you get a fixed attack that is not responsive to picking dynamics. Imo that is not what you want to use for instance on an auto-wah kind of filter circuit.
Or is the 'one shot' ON time made dependent on the picking strenght?

What I would like is:
- An attack phase that is responsive to picking dynamics. That means that the level/max-voltage the attack phase reaches is dependent on the picking strenght.
- An attack speed/time that be regulated. Best is if one can regulate how much the attack speed is dependent of picking strenght.
- A decay speed/time that can be regulated and is preferably independent of picking strenght.

Perhaps a cheap PIC microController with an analog input and PWM/analog output can be really good at this and is really versatile because then the behavior can be programmed and modified on demand. Instead of using pots for controlling it, one could provide a single button that goes through pre-programmed presets.

earthtonesaudio

Just want to chime in and say I'm interested in this also.  Sounds cool.

StephenGiles

"What I would like is:
- An attack phase that is responsive to picking dynamics. That means that the level/max-voltage the attack phase reaches is dependent on the picking strenght.
- An attack speed/time that be regulated. Best is if one can regulate how much the attack speed is dependent of picking strenght.
- A decay speed/time that can be regulated and is preferably independent of picking strenght."

Well, this is what I have been suggesting for more than a couple of years!!!
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

flo

#10
Sorry to hijack this thread ...

ADSR with PIC microController is already done by somebody of course:
http://www.electricdruid.net/index.php?page=projects.envgen7

I guess that if I put a rectified and filtered guitar signal as level to pin 7 "Level CV" the ADSR will be made dependent on picking strenght.

But a PIC16F684 is not so easy to get it seems, other PIC variants however are readily available like PIC16F648, PIC16F88 or PIC16F84.
Can anyone recommend perhaps which other PICs I can use?
Or to put it differently, what IO pins, A/D convertors, timers, PWM outputs and such does the ADSR application need? Then I can try the PIC selection tool of MicroChips and select another: http://www.microchip.com/maps/microcontroller.aspx

Can source code like that easily be ported to another PIC?

frequencycentral

Quote from: flo on December 29, 2008, 12:14:56 PM
Sorry to hijack this thread ...

Don't worry about the hijack!

But I'm looking for an analogue solution - PICs I find scary!
http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

flo

I understand.
I'm a programmer by profession so PIC uControllers are not scary for me.

To me PICs are great, cost effective and versatile for applications like this.
If somebody already wrote and debugged the program, its a simple job to put the program into the PIC, a programmer costs 30 dollars or so, and hook it up into the effect. It's just a "black box IC" to which to hook the inputs/outputs/control-pots.
Analoge solution is doable but quickly gets to complicated for relative simple control applications like a specialised LFO or ADSR.

gez

#13
This isn't quite what you were outlining as decay will only start once the signal drops below a certain amplitude.  You could wire up the 4098 as non-retriggerable and drive a comparator/Schmitt from an envelope follower, but I should think it would be prone to a ripple-like effect unless the threshold for triggering was set reasonable high (only initial attack triggers comparator/schmitt), or 'hold' time set very long:



As you can see it's only a sketch.  To get it to working-circuit stage is going to require a lot of reading of data sheets, plus tweaking with a scope.  I've used the individual units within the sketch, but not for this purpose so I make no guarantees as to how efficient it is at doing the job.  The above outlines how I would tackle the problem (many ways to skin a vegan sausage)

I'm assuming that the input signal is of varying amplitude (guitar or something similar).  It doesn't matter a jot that the schmitt continually triggers as the 4098 is set to be retriggerable (the pin connections need double checking, by the way).  The output goes high the moment a note is detected and it's only when the signal falls within the thresholds of the Schmitt that the timed pulse kicks off.  It needs to be kept short so that the decay kicks in as a note fades.  However, make it too short and any blips from the input signal (momentary triggers as the note dies down) will cause false-triggering.

Pulse shaping is carried out by the LM13700.  It's set up as a follower, only with a cap at the output of the OTA.  This ramps up/down the edges of the pulse at a rate decided by how much current is supplied to its Iabc pin.  The follower action means that once it reaches the magnitude of the original pulse, the output doesn't go on to hit rails (as happens with simple integrators).  By reducing the resistance of the range pot, you increase the signal at the input, in turn increasing the output signal (it's a follower, remember).  I kept the divider values equal when I used this circuit, but you'll probably hit the + output limit of the OTA before you hit the lower limit so you might want to mess about with values to compensate for this (I found it worked fine in my circuit).

The attack/decay pots I haven't tried before.  My concerns are:

1.  The chip might not be able to source the current needed if you make the pots and stop resistor too low in value (data sheet of the 4098 would tell you if it's feasible).  So, either buffer the outputs (inverters in parallel, or something like that) or keep resistance high and use a small value cap for the ramping. 

2.  During the swapping of the pots during switching, they'll be a minuscule period of time when no current is supplied to the Iabc pin.  In practice, the transition is so fast it would appear as a hairline on a scope (if you could see it at all).  This may, or may not, be a problem, in which case either a small value cap from Iabc to ground would be required, or a large value resistor from Iabc to V+ (the pots source current in parallel with this current).

Stephen's idea of making the sweep range proportional to amplitude could possibly be done using the other half of the LM13700.  Momentarily resetting an op-amp peak-detector as a note is detected then using the following peak voltage to source current to the OTA set up as a VCA.  This would only track a signal of increasing amplitude.  Once the peak voltage is reached, the filter remains hanging until retriggered.  In practice, the decay part of the sweep would kick in as a note faded, so I don't forsee that being a problem.  Besides, I don't see any other way of doing it, as you'd end up with ripple (might as well just use an envelope follower).
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

flo

I finally found a good local source in the Netherlands for the PIC16F684 so I can built the PIC ADSR (http://www.electricdruid.net/index.php?page=projects.envgen7).
http://www.voti.nl/winkel/catalog.html?PIC-16F684-DIP
EURO 2.80 = $4 (they are cheap!)

gez

Whoops, got some of the connections completely wrong for the 4098 (was going by memory).  Will correct them and re-post the sketch tomorrow (link should be the same).
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

StephenGiles

"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

gez

#17
I've corrected the sketch, though you might need to delete your cache of saved images to see it (the old image came up when I clicked on this thread to check if it had been changed).

Still best to check the data sheet, though (my memory is pretty bad).  :icon_rolleyes:

Edit: output waveform is only trapezoid (at least it should be if set up correctly).
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter