News:

SMF for DIYStompboxes.com!

Main Menu

Guitar-to-Gate?

Started by 3080, January 04, 2011, 05:55:30 PM

Previous topic - Next topic

3080

I would try electricdruid's design: http://electricdruid.com/index.php?page=projects.envgen7
What would you recommend to convert the guitars signal to trigger the adsr generator?

Mark Hammer


Gurner

#2
If I'm reading this right, you want to use the guitar to trigger a PIC which will then generate an envelope? (presumably this PIC 'envelope' then controls another sound source?)

This will be a 'one shot' type setup up? (a bit like triggering your PIC, from say a drum)

If so, then you want the guitar 'trigger' to have as fast attack as possible & also be as square as possible ....you'll need a threshold, above which it triggers your PIC, therefore a comparator based circuit is the way to go - but with some hysteris to avoid double/false triggering around the threshold level.

jasperoosthoek

Could you take the gate circuit from a noise gate? Maybe the MXR Noise Gate: http://www.tonepad.com/project.asp?id=18
[DIYStompbox user name]@hotmail.com

Mark Hammer

Those usually aren't good enough.

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.

See http://geofex.com/Article_Folders/noteproc/noteproc.htm for some background, and the FXbus module 7 for some circuits.

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.

Gurner

I guess we need 3080 to tell us a little bit more about the end application, becuase reading the datasheet of the PIC he intends using - to my eyes at least - it looks as if the PIC generates an independent envelope (not derived from the guitar signal at all - but from control voltages on it input pins - one for Attack, Decay, Sustain & release)  whereas the circuits posted above are to extract the envelope from the guitar signal.

All that PIC needs is a trigger input (to trigger the envelope required with teh ADSR CV settings)

slacker

#8
Here you go this should do the job, it's based on the Electrax guitar synth which has been posted here a few times, and gives a gate and trigger out. I'm using it with a bipolar supply with my modular synth, so I've just hacked the schematic for a single supply, I think it's correct. I have used something similar with a single supply, but I'd have to find it to check exactly what I did.
The pot controls the sensitivity and the length of the gate. Some values will probably need tweaking and the outputs will need scaling to whatever the PIC is happy with.
Vref should be half whatever the supply is.

http://www.eskimo.plus.com/fxstuff/trigger.jpg

Gurner

#9
Quote from: slacker on January 05, 2011, 01:48:08 PM
Here you go this should do the job, it's based on the Electrax guitar synth which has been posted here a few times, and gives a gate and trigger out. I'm using it with a bipolar supply with my modular synth, so I've just hacked the schematic for a single supply, I think it's correct.

I'm not familiar with the circuit, but the left hand side of the 1k5 resistor in the first amp should definitely be connected to Vref (or at least have a large cap between it & ground - this is becuase the output of that  first opamp is sitting at Vref so you need to decouple the DC from ground in that potential divider feeding back to the -ve pin), in fact, I reckon all the grounds shown in your circuit should be at Vref *except* the pot 'R?' VRef is essentially your virtual ground, so therefore most connections that were previously showing connecting to true ground should be connected to VREF for a single supply version (apart from those like the Pot, which are setting a threshold voltage)

slacker

#10
Yeah you're right, the 1k5 resistor it should go to Vref, the bottom of the pot possible should too, I can't remember, the other ground connections are correct though. The middle bit is a comparator, the output is normally high, when the voltage on the inverting input goes above the threshold voltage set by the pot, the output goes low. The diode stops the cap discharging through the 100k resistor, so it can only discharge through the 470k resistor, the discharge rate is quite slow so small fluctuations in the input don't retrigger the circuit.
The "gate out" opamp just inverts the output to create a gate signal that stays high as long as the input remains above the threshold level. The "trigger output" opamp produces a short high pulse, each time the comparator goes low.

Gurner

#11
Quote from: slacker on January 05, 2011, 03:01:46 PM
Yeah you're right, the 1k5 resistor it should go to Vref, the bottom of the pot possible should too, I can't remember, the other ground connections are correct though.

Actually, I think the bottom of the pot needs to go to Vref, as do the 470K resistor & 220nf cap too (which are presently showing connected to true ground).

Again, the DC output of the first opamp stage is a Vref, so the follow on comparator needs to be referenced to Vref too (by way of connecting 470K resistor & 220nf cap to Vref *not* ground)

The voltage range on the cap will then be between Vref (no signal) & something a bit less than the supply voltage (strongest guitar signal) - to be an effective threshold for the comparator, the pot therefore needs to have Vref on the lower side & VCC (as it has) on the top.

Mark Hammer

Any guitar-gate circuit has two principle tasks: to be able to tell...reliably... when the note/strum has started, and to be able to tell...also reliably...when the note/strum has ended.  What that means is that any usable gate circuit is only as good as its envelope follower.  The DEVICE AMS-100 circuit is pretty darn good because of the use of the NE570 compander chip, but the king of them all is likely Harry Bissell's envelope follower.  Having played using it, I can say with great certainty that if you're feeding a circuit with a standard pickup, it doesn't get much better than this for something that quickly knows when the note has begun and ended, without false triggering.

And that is the fundamental (pardon the pun) problem with converting envelope extraction into a gate: there is enough fluctuation/ripple in the envelope signal that simply throwing it at a comparator, as in the circuit slacker showed, will get you a gate, but not necessarily one that doesn't end until you want it to end.

You can find Harry's design here: http://www.edn.com/article/490267-Envelope_follower_combines_fast_response_low_ripple.php

slacker

Thinking about it you're right, connecting the cap, resistor and pot to vref is better, because like you said it makes the full range of the pot useful.
If you connect the cap and 470k to ground, then at rest the inverting input of the comparator sits at about a third of the supply, the 100k, diode and 470k forming a voltage divider between vref and ground. With the pot to ground as well, this means the pot has a bit of a dead zone at the bottom.

Should give the OP something to work with anyway :)

Gurner

#14
Mark - I'd originally found that circuit during a 'festival of Google' towards educating myself about envelope followers about 18 months ago ...alas I forgot to bookmark it, but it kept coming into my head (I'm a bit sad like that), but could I hell find it! So big thumbs up for linking to it - the reason for wanting the article again (& it's a good 'un), is that I reckon the rather heavy component count (well, for an envelope follower at least), could be crushed by following Harry's concept but using three AD pins of a PIC instead.

personally, I'm normally happy enough with simple envelope follower (I'm anal when it comes to component count!), but the rub is - as you've touched upon, to get such a circuit to detect the end of a note rapido, it needs a low value resistor to discharge the cap sharpish (or a low value cap ), but this causes ripple. For those application where I need lower ripple, I full wave rectify the signal - for most of my needs that suffices

slacker

#15
Quote from: Mark Hammer on January 05, 2011, 03:47:15 PM
there is enough fluctuation/ripple in the envelope signal that simply throwing it at a comparator, as in the circuit slacker showed, will get you a gate, but not necessarily one that doesn't end until you want it to end.

Actually Mark, if anything you get the opposite problem with this, the smoothing and slow decay of the pre comparator filtering  plus the hysteresis in the comparator makes it pretty hard to falsely re-trigger. You have to play cleanly with a deliberate picking action if you want to trigger it every note, on the plus side this means you can do hammer ons and play legato without it re-triggering. I like this because you can set it to start say a slow filter sweep with a hard initial pick and then play an entire passage, without re-triggering the sweep. I get absolutely no re-triggering due to ripple as the note decays, even setting it so the gate lasts almost the full duration of the original note.
On mine I added a smaller cap than can be switched in place of the 200n, this makes it so I can trigger it every note playing normally, but with some risk of false triggering.

As an envelope follower, It's definitely not in the same league as Harry's circuit though.

Gurner

Just one afterthought...if feeding a PIC, make sure that trigger doesn't exceed 5V (a potential divider on the output if your supply is above 5V, or better still just us a 5v rail to rail opamp in slacker's circuit)

Mark Hammer

Quote from: slacker on January 05, 2011, 04:12:08 PM
Quote from: Mark Hammer on January 05, 2011, 03:47:15 PM
there is enough fluctuation/ripple in the envelope signal that simply throwing it at a comparator, as in the circuit slacker showed, will get you a gate, but not necessarily one that doesn't end until you want it to end.

Actually Mark, if anything you get the opposite problem with this, the smoothing and slow decay of the pre comparator filtering  plus the hysteresis in the comparator makes it pretty hard to falsely re-trigger. You have to play cleanly with a deliberate picking action if you want to trigger it every note, on the plus side this means you can do hammer ons and play legato without it re-triggering. I like this because you can set it to start say a slow filter sweep with a hard initial pick and then play an entire passage, without re-triggering the sweep. I get absolutely no re-triggering due to ripple as the note decays, even setting it so the gate lasts almost the full duration of the original note.
On mine I added a smaller cap than can be switched in place of the 200n, this makes it so I can trigger it every note playing normally, but with some risk of false triggering.

As an envelope follower, It's definitely not in the same league as Harry's circuit though.
Do keep in mind that it is ONLY an envelope follower, and the on/off aspect that generates a gate is still going to involve a comparator.  It's entirely up to you to set that threshold stringently or liberally.  The key thing, though, is to start with a responsive envelope follower, and this one nails it.

One of the things that could be done with a PIC, however, is adaptive gate threshold of some form, such that the threshold adjusts to the intensity of the note (as reflected in the envelope, whether read directly, and averaged, by a PIC's A/D inputs, or simply read from the analog envelope follower into the A/D), or perhaps the frequency with which new notes are introduced, or both, to achieve the "niche-gating" applications you imagine for guitar, like successfully negotiating hammer-ons or tapping, or maybe even slide.

StephenGiles

EH had this all done in the Microsynth surely?
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

Gurner

#19
Quote from: Mark Hammer on January 05, 2011, 04:51:54 PM
One of the things that could be done with a PIC, however, is adaptive gate threshold of some form, such that the threshold adjusts to the intensity of the note (as reflected in the envelope, whether read directly, and averaged, by a PIC's A/D inputs, or simply read from the analog envelope follower into the A/D), or perhaps the frequency with which new notes are introduced, or both, to achieve the "niche-gating" applications you imagine for guitar, like successfully negotiating hammer-ons or tapping, or maybe even slide.


I was thinking more along the lines of a PIC AD pin 'samples' the voltage level on the cap, then immediately afterwards another PIC pin switches in as 'output low' & discharges the voltage from the cap into the PIC (via say a  220 Ohm resistor in between)....this clears down the cap pretty damn sharpish, the 'discharge' PIC pin, then switches back to be an input pin, thereby allowing the cap to charge up ready for the next PIC AD sample.

Using this method it should be simple to have fast response yet with low ripple. (& with a very low component count - becuase most of the components are in the PIC!) .

The PIC can also be used as the comparator (either in software via having the code responding/acting upon the cap/threshold level) or via an actual hardware comparator that most PICS have onboard anyway.