Arduino to mix both analog and digital signals

Started by SPoT_D, July 13, 2019, 05:43:01 AM

Previous topic - Next topic

SPoT_D

Hi all,

I was asked to make an arduino based pedal that actually uses simple arduino programming language to manipulate sound. This to make it a bit simpler to program than for example the ElectroSmash pedalshield. Something for a kid to have fun with without needing a degree in software engineering  :icon_wink:
Took some research, but with the Arduino MKRZERO and some help from a little library to get a faster sampling rate i managed to get a pretty decent  fuzz, reverb and delay. (thanks to Albert van Dalen @ https://www.avdweb.nl/arduino/adc-dac/fast-10-bit-adc)

Now I'm looking to manipulate an analog signal for tremolo, vibrato, attack/decay kind of things and to make it possible for the arduino to mix both analog and digitally manipulated signal for wet/dry control
Does anyone have a good example of a circuit where an arduino regulates the volume  of an analog signal?
What would be the best way to go about this without using a digipot (which I think will mess with the sample rate too much, but correct me if i'm wrong)
Is there a JFET or a vactrol kind of approach? (I have both, but my knowledge of how to implement those are limited)

A schematic of a similar approach would be great.

Thanks!

anotherjim

PWM control a Vactrol would be conceptually easy. It has the advantage that the circuit you are controlling can be electrically isolated from the digital control and the time response of the LDR in the Vactrol is slow enough to filter out the PWM pulses.

SPoT_D

OK, I'll expiriment with a vactrol. Do I put it in the signal path or to ground? (kind of new to vactrol). Some ideas on how to mix two signals are quite welcome as well

merlinb

Another way is to make the Arduino behave like an LFO by sending I2C data to a DAC like the MCP4725. You can make any waveform you like. Then use that waveform to control the LED + LDR.

SPoT_D

I'm trying to avoid i2c at the moment because it will likely mess with the sample speed of the arduino. If I go i2c wouldn't a digipot serve my needs better here?

anotherjim

Vactrol control is a variable resistance (so is DAC essentially). Simply find the analogue circuit you want to control, and then we find the best place to put the Vactrol LDR.
Need to decide if the Vactrol is a commercially complete one or assembled from a separate LED and LDR (more fun/learning with the self-assembly approach). The LDR characteristics can matter (dark resistance to maximum light resistance), but it's usually possible to trim the circuit to suit the operating range. Any given type of DAC would be very repeatable, while LDR circuits need to have some trimming on an individual basis.

cloudscapes

Quote from: SPoT_D on July 13, 2019, 05:43:01 AM
What would be the best way to go about this without using a digipot (which I think will mess with the sample rate too much, but correct me if i'm wrong)

So a thing to remember is that the sample rate has to be kept high usually just when you're sampling or generating audio with the microcontroller. If you're modulating analog components with envelopes, LFOs and other "slow" waveforms, it's not really necessary to keep the sample rate high.

I've made loads of projects that use digitally-generated enveloped/lfos, and I can usually get away with a sample rate of 1khz. It can be even slower, but that's the speed I generally choose for those purposes. Other projects like delays/samplers, then I crank it back up to at least 24khz, all the way up to 100khz if needed.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

SPoT_D

Quote from: cloudscapes on July 16, 2019, 08:49:45 AM
So a thing to remember is that the sample rate has to be kept high usually just when you're sampling or generating audio with the microcontroller. If you're modulating analog components with envelopes, LFOs and other "slow" waveforms, it's not really necessary to keep the sample rate high.
I am indeed using the arduino to manipulate sampled sound as well as trying to manipulate a analog signal. I'm trying to mix manipulated guitar sound from the arduino with the analog signal.