[sdiy] Lin/Log VCAs and envelopes - compensating for log VCAs

Tom Wiltshire tom at electricdruid.net
Sat Feb 6 23:52:55 CET 2016


On 6 Feb 2016, at 22:06, rsdio at audiobanshee.com wrote:

> 
> On Feb 6, 2016, at 11:08 AM, Tom Wiltshire <tom at electricdruid.net> wrote:
>> To be honest, this doesn't look exceptionally "natural" to me. But I don't think I'm going to argue with 50 years of synth history. If that's what we like, that's what we like.
>> 
>> Now, what I'm thinking is that I could easily tweak the tables in one of my PIC envelope generators to give these "log" curves. I could then feed the envelope to a log VCA and get the same sound you get with a typical ADSR into a OTA/linear VCA. It's a "log-compensated" envelope. Being able to switch between the two curves would enable people to use either a log or linear VCA and still get the same effect.
>> 
>> What do you all think?
> 
> Although tables can be a great implementation choice for many PIC tasks, it might actually be better to use a single pole low-pass filter for your ADSR. That perfectly recreates an RC charging / discharging circuit without requiring a linear-to-logarithmic lookup. Besides, if you have a 16-bit DAC, you probably don't have room for a table large enough to hold all 64K possible log outputs. Even a 10-bit DAC would skip a lot of output codes unless your lookup table were significantly larger than 1K entries (probably at least 8K needed). The low-pass code will require a couple of multiply instructions, but most PIC chips can handle that. If you were programming a DSP chip, you'd be set.

Hi Brian,

A single-pole IIR is a possibility that I've recently looked into, but for other jobs. The problem is that it's only efficient if you limit the coefficients to what you can do using shifts. Otherwise, you have to do multi-byte multiplication, which means a look-up is definitely more efficient. On 18F chips or dsPICs, you're probably right, but I've been working on 12F and 16F chips with no multiply instruction, so it's a *big* cost. On my envelope generators, I've used a 256-entry look-up plus a linear interpolation - this is the same cost as a basic single byte multiplication, which still gives a gain over IIR, and also gives you arbitrary envelope curves. You can easily extend a 256-entry table to 12 or 14-bits without anyone detecting that it isn't curved. Note also that even a 64K table will miss some output values if the output is non-linear, as our example is.

My usual rule of thumb for these basic chips is "Don't do hard sums" !

Tom






More information about the Synth-diy mailing list