Hmm, avoid feature creep, you say, Tom. But feature creep is what drive me from analog envelope detectors to DSP in the first place. Maybe I'm gonna need a bigger boat ship chip. In the end at least few features will suffice for getting my feet wet and see where this thing goes.
All I meant by "avoid feature creep" is that you'll start thinking that it'd be a good idea to have an LFO on there too, so you could mix the envelope output with the LFO output. Or you could use the envelope to control the LFO rate. Or the LFO depth. See what I mean?! All of those are good ideas, but (at least on a simple chip) there won't be time. Either use a chip that can do all of that, or do it on separate chips. I've already got the StompLFO for most of the other stuff, so if I had a 0-5V output from an envelope follower chip, I could use it to control any/all of the StompLFO's parameters.
The idea was indeed to feed the chip with straight up audio but if sample rate is a problem, I could put an analog envelope detector with the fastest possible response up front and only use the DSP chip to slow the attack or decay or alter the curve profile.
No, no, definitely do the envelope detection on the chip! Otherwise where's the fun or benefit?!
For what I have in mind, quick response is not critical. Neither fast transients nor high frequencies need to be followed. Sampling the analog envelope at 1kHz would be overkill. 100Hz should suffice. If on the other hand I want to avoid the analog envelope detector, I would probably need something like 2-3kHz and a steep low pass filter before the input to avoid aliasing.
I don't agree. I don't think this is fast enough. I might be wrong. Not unlikely, in fact. But we're trying to follow the overall amplitude of the audio signal. While we can filter that and remove some harmonics and hash, that will mean that we tend to miss the initial peak where those elements probably dominate. If you're sampling at only 3KHz, you're going to need very harsh filters. And if you're going to all that trouble with lots of analog filtering to filter the signal so your processor can cope, you might as well do the envelope follower in the analog domino too, no?
The supposed advantage of a digital solution that we're going for here is simplicity, right? You stick some audio in, you get a nice envelope out. Ideally with a couple of adjustments too. Bingo!
Do you need to check all inputs on each pass with these things? Otherwise, check the pots should probably be done at a much lower rate than the audio/envelope in. More like 1-10Hz.
No, you don't need to check everything every time. But you need to check the audio regularly, or you're going to introduce weird variable-sample-rate effects into the signal you're trying to process. It's possible that doesn't matter but that's more than I can get my head around right now. It certainly sounds like it matters. Interested to hear views on that one.
So...if you're sampling the audio regularly, and you need enough time to get something else in between the audio samples, you choose the best ADC rate you can get (let's say 50KHz, for the sake of argument). So you sample Audio, then some pot or other, then audio again, then you can sample another pot or you can ignore it, then Audio again, etc etc.
So you finish up with half the samples being audio (so 25KHz), and the others being available for pots. You might as well cycle through the pots on the alternate samples: Audio, Pot1, Audio, Pot2, Audio, Pot3, Audio, Pot4, Audio, Pot1, etc etc. Yes, its much faster than you need for pots really (especially with only a few pots), but there's no real benefit to slowing it down. It's a side-effect of the *audio* rate.
HTH,
Tom