how to extract gates from an envelope

Started by loss1234, June 13, 2008, 10:14:30 PM

Previous topic - Next topic

loss1234

It doesnt seem to hard to get an envelope out of a signal. yu just rectify it and filter it (right?) and deal with ripple.

but how to then best turn that into a time based signal (a gate)? should i be trying to use a comparator?

the only schematics i have seen that do this have little explanation so i am not quite sure how to go about it. but there are TONS of schematics which show how to get the envelope part.

any info appreciated

thanks

Nasse

I have seen words like comparator and re-triggerable monostables
  • SUPPORTER

R.G.

Geofex. Note processing.

You run the envelope and a fixed threshold into a comparator. The output of the comparator is the gate.
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.

Paul Perry (Frostwave)

Both Nasse & RG are right, but unless the comparator (in RGs case) has some hysteresis, it's going to jump around.

R.G.

You're right Paul.

The hysteresis needs to be there, but needs to be both small (so as to not miss part of the beginning of the note) and large (so as to not chop off the end of the note). It needs to be medium to avoid chopping on ripple.

Generating a gate from a guitar signal is much like playing guitar - it's the easiest instrument to play poorly and the hardest instrument to play well.
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.

loss1234

can you guys explain hysteresis a bit more? I Have already read that article on note processing On geofx.
i just got a book by penfold on opamps and i am hoping it will explain comparators a bit more. right now, if i remember correctly, a comparator is an opamp where one side is tied to a value (a threshold) and one side to to the input. is there negative feedback? and how does hysteresis fit in?

i have it printed out for reference. i only wish it had more specific examples of values, schematics,etc. great resource though!!!


thanks


StephenGiles

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

selectortone

#7
The best way I can describe hysteresis is to use a central heating thermostat as an example.

It has a built in 'dead-zone' so that when the temperature is hovering around the set point the relay isn't chattering on and off all the time.

The dead-zone is the gap between the thermostat switching 'on' when the temperature is rising and the temperature switching 'off' when the temperature is falling.

With no dead zone the relays in the thermostat would wear out very quickly.

Paul Perry (Frostwave)

One explanation of hysteresis: http://www.ee.ttu.edu/lab/robot/hyster.htm

It looks frightening - but just consider the cases where the op amp has a + output, and where it has a - output.
You can see that it takes an appreciable change in the input voltage to flip it one way or the other. That's where the hysteresis comes from.

Another explanation: http://www.allaboutcircuits.com/vol_3/chpt_8/12.html

loss1234

stephen-i know those EH circuits are a wealth of information but sadly for those of us who arent too good at figuring out which section does what, it can be hard to extract the information.

can you be more specific about which sections use hysteresis? (or which ic numbers?)

i wish somebody  (hint hint) would write up a brief explanation of what each section of the EH guitar synth does, this would then make it easier to either take bits of it and test them on the breadboard, or build the whole thing but have knowledge for troubleshooting of what each part does. I know from all the times you have championed that circuit that there must be A WEALTH of circuit snippets going on in there. the biggest task is figuring out what each snippet does.

anyway, thanks as always to you and to everyone for your insight and help!!


StephenGiles

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

R.G.

Think about toggle switches. When you push the handle of a toggle switch slowly, it gets to one point a little past center, then it snaps to the other position. When you now flip it back the other way, you have to push it past where it flipped to the current state.

Hysteresis is an electronic snap action so that instead of dithering around in the middle, the circuit snaps all the way into the next state.

Consider a comparator. A comparator has a + input and a - input as well as an output. If I hold the - input at some voltage and move the + input around, the output goes up (i.e. positive) when the + input is at a higher voltage than the - one. But what happens if the + and - are almost exactly equal?

That's how we run opamps, almost exactly equal. The output can run from one extreme of the power supply to the other on very little change in voltage. We don't want a comparator wandering around in the middle like an opamp. In fact, some comparators do that, oscillating like mad if you don't use hysteresis. We want a comparator to have either a fully + or fully - output.

So we take the output of the comparator through a largish resistor back to the + input, and a small resistor between the + input and whatever it senses. When the output of the comparator is high, it pulls the + input just a little higher than the voltage being sensed by the voltage divider action of those resistors. When the output of the comparator is low, it pulls it a little extra low. So the + and - voltages being sensed have to be pushed a little bit "over center" to make the output change. When the output changes, it also changes the threshold through the resistors so that the reverse operation has to go a little "over center". This cleans things up so the comparator output flashes through the middle point so fast it can't oscillate, and you get a clean on or off.
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.

StephenGiles

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

loss1234

THANKS STEPHEN!

lots of good stuff in there


i will be printing as soon as i get more paper!

loss1234

Ok so here is a question...one of the coolest looking sections of that clark synth is the 4046 CHORDER section BUT it uses a top down octave generator chip AYI 0212

since these chips are impossible to get a hold of, is there any way around that chip? could you simulate its functions with some other chip/chips???

thanks so much

Mark Hammer

The circuitry you'll be driving starts out with one basic question:  Is there a note, or is there NOT a note?  The gate pulse answers that question by being on (YES, there is a note) or being off (Go back to sleep, there is no note).  In a sense, the envelope signal ought to be derived after the gate, since the human question-asker would normally say: "Oh, I see there is a note.  How loud is it?".  IN this instance, though, the logic is reversed.  The circuit determines that there IS a note, only after it has determined the loudness of the note.

Why?  Because the guitar signal source has a great deal of variation to it.  Some of that variation could be hum whose level varies as you turn around to face towards or away from source of EMI.  Some of it could be glisses of your fingers against wound strings as you move up the fingerboard to get ready for a different chord in another location.  Some of it could be mechanical or electronic noise of other sorts and sources.  The point is that the circuitry determines the presence of a note, in binary fashion, by using amplitude to differentiate between intended signal sources, and unintended ones.  If the amplitude rises high enough, then it must be a valid note.  If the amplitude does not rise high enough, then it may be a false alarm.

Because the goal is to have something which can respond in a predictable and coherent fashion, the bias in the circuit (in the sense of "judgment", not voltage bias) favours minimizing false positives rather than false negatives.  In other words, it is content to let lightly picked notes remain undetected, so long as nothing like finger glisses gets misinterpreted as a note.

Now I would be foolish indeed to assume that the envelope signal used for determining the presence of a note is perfect.  There WILL be ripple.  When the envelope is well above or well below the critical comparator threshold, there is little or no chance that it will mislead the circuit into thinking that a note is present oir has ended.  The problem arises when the envelope signal starts to move, and remain, in the region of the critical threshold during the decay phase.  That minimal ripple can push the envelope signal momentarily above or below the threshold.  Hence the need for hysterisis.  In a sense, the tradeoff is that the less ripple in the envelope, the less likelihood of falsely interpreting note presence-absence, and the more ripple, the greater the need to have some lag (which is more or less what the hysterisis does) built into the comparison process.  What it does is essentially get the comparator circuit to take a brief moment to be sure about detecting an event that it "thinks" has happened.  From the other perspective, introducing greater certainty in note detection, by minimizing ripple as much as possible, will often introduce a certain amount of lag in the envelope signal itself, such that the detecting circuitry doesn't know there is a note picked until a few milliseconds after the note has started.

Obviously, while there may be some intelligence in the person designing the4 circuit, there is none in the circuit itself, so kindly excuse my  anthropomorphic description.  I just wanted to use a metaphor that felt familiar.

loss1234

thanks mark

i have been playing around today with comparators hooked up to simple rectifier circuits.

also looking into building the electrax synth and so far that has given me lots of ideas. i think i need to be really realistic about my goals though....

but as its fathers day, no real work done today

thanks all

printing this all out