I am trying to build/design a circuit for a midi controller that takes a signal from a transducer being struck and that then triggers a midi controller (which is a separate piece of hardware I've purchased) to fire a message to the computer.
To boil this all down more simply.... I need a circuit that will sample a variable amount of voltage, in say, a 10ms time window, then will "take" the peak voltage and produce a perfect (or nearly so) square wave that is output to the controller.
This is the key part I need a straight up and straight down signal that lasts, say 5ms. After that I need the capacitor c1 to discharge briefly so it is reset to 0V.
I have taken the circuit linked below and mocked it up in LTSpice and have done quite a bit of experimenting.
http://schematics.dapj.com/2005/01/simple-sample-and-hold.html
I am using a 555 timer to "throw the switch" on the 4066 such that the capacitor c1 is sampling for 10 ms and then allows that peak voltage to be "seen" for 5ms by midi controller (the output on the right).
The heart of the problem is that I get a nice clean on/off signal but the c1 capacitor stays charged. e.g. say my peak signal is 5v on one sample but the next time the input signal could only 1V; so the capacitor needs to be reset between samples.
It is not a simple as putting a resistor in there to slowly drain off the cap because that gives me a nice "on" square wave but it will slope down on the right side of the signal as it "slowly" discharges to 0V. i.e. it is not a square wave.
So basically I am hoping to find a clever way that when the 555 pulse drops to 0V, and thus turns off the 4066 "switch", that I can briefly short the capacitor c1 to ground before it starts taking on a charge again.
My thought was perhaps I can charge up another capacitor when the 555 signal is high and then use that capacitor in some way that when the 555 signal goes low, I can short that c1 capacitor to ground briefly (which is however long it takes this "new" capacitor to discharge).
I can't seem to find an elegant way of making this work without introducing using of another 4066 switch and another 555 timer. It seems like there has to be a simpler way of doing this....
I've been beating my head against the wall for a week now and I would appreciate any advice or suggestions!
Thanks....
To boil this all down more simply.... I need a circuit that will sample a variable amount of voltage, in say, a 10ms time window, then will "take" the peak voltage and produce a perfect (or nearly so) square wave that is output to the controller.
This is the key part I need a straight up and straight down signal that lasts, say 5ms. After that I need the capacitor c1 to discharge briefly so it is reset to 0V.
I have taken the circuit linked below and mocked it up in LTSpice and have done quite a bit of experimenting.
http://schematics.dapj.com/2005/01/simple-sample-and-hold.html
I am using a 555 timer to "throw the switch" on the 4066 such that the capacitor c1 is sampling for 10 ms and then allows that peak voltage to be "seen" for 5ms by midi controller (the output on the right).
The heart of the problem is that I get a nice clean on/off signal but the c1 capacitor stays charged. e.g. say my peak signal is 5v on one sample but the next time the input signal could only 1V; so the capacitor needs to be reset between samples.
It is not a simple as putting a resistor in there to slowly drain off the cap because that gives me a nice "on" square wave but it will slope down on the right side of the signal as it "slowly" discharges to 0V. i.e. it is not a square wave.
So basically I am hoping to find a clever way that when the 555 pulse drops to 0V, and thus turns off the 4066 "switch", that I can briefly short the capacitor c1 to ground before it starts taking on a charge again.
My thought was perhaps I can charge up another capacitor when the 555 signal is high and then use that capacitor in some way that when the 555 signal goes low, I can short that c1 capacitor to ground briefly (which is however long it takes this "new" capacitor to discharge).
I can't seem to find an elegant way of making this work without introducing using of another 4066 switch and another 555 timer. It seems like there has to be a simpler way of doing this....
I've been beating my head against the wall for a week now and I would appreciate any advice or suggestions!
Thanks....