Using Stages as a 6x VCA?

Hey mate! It looks super usefull, i’m going to try it out asap!
Do you think is possible to add a vca/mixer with an internal envelope mode?
The upper pots may be used for panning (EDIT: this have sense only if a smarter output handling is found. We need two outputs for the stereo image), the slieders may have two function depending on the led status:

  1. defining the max amplitude of the VCA
  2. defining an envelope segment (like in your 6 equal envelope mode)

the time/level cv in may be the input for our audio rate signal, the gate input may be the gate for our internally defined envelope.
The output may function like this: if no output jack in inserted the last output contains the mix of all vca.
if other jacks are connected the corresponding output is removed from the mix out.
It may be hard to code but it may be great. I don’t know it there are hardware limitations to this tho.

Besides that sounding confusing to use, the sample rate of the Time/Level inputs isn’t high enough for audio to go through cleanly.

(You can hear it by routing audio through a Step mode segment (yellow LED).)

1 Like

The way i exposed the idea is confusing but in reality the thing is really simple:

  1. Defining an envelope like in the 6 equal envelope mode
  2. Each time a gate is triggered the envelope starts opening the VCA

Is the sample rate selectable in a variable?

No, it’s limited by the hardware performance.

I was wondering: since i would like to learn dsp, do you think, as an hobby, this may be an hard project to do? :slight_smile:
To be honest i don’t even know if a digital VCA with built in evelopes can be done or just traight up appealing.

The DSP is just a multiplication, and generating the envelope.

The difficulty is the hardware. On how many channels do you want to do that? If it’s just on two channels, you can repurpose any board with an audio codec (say Warps’). If you want to do that on six channels like you originally thought, you’d have to design your own board with a multichannel audio codec. This is more work! It might be simpler to use a quad analog VCA and only generate the CVs digitally (as is done on Frames or Streams).

1 Like

Ok I suppose that it’s better to start with the simplest idea possible since I have to learn how to design a circuit or how to program a dsp (I have a good knowledge of signal processing theory and coding in general). So maybe a dual analog channel with digital envelopes may be a good point to start with. For a final project tho i think that 4 channels is the minimum.

Émilie, I was taking a look and studying the plaits schematichs to understand how to work with the inputs and outputs of a MC. I was looking at the CV offset achieved with this inverter integrator op amp configuration. I was wondering: i get that R30 and R27 are designed to transate the CV in such a way to have a range of volts varying from 0V to 3.3V, but are you assuing that the input voltage is in the [-5;5] range? what if someone puts a -10 or 10 VDC in the cv input? Does the voltage saturate to GND or Vd=3.3V? And how do you choose the capacitors value? In fact in the pic the two values are different and i can’t get why (i know that the cut frequency of thi low pass filter is 1/2piR*C ). Maybe you are sampling the two inputs at two different rates?.

1 Like

Yes because the MCP600x is a rail to rail op-amp. That’s why I use this very specific part.

Depending on how fast I need to sample the CV. In Stages, the CVs are sampled at 31.25 / 8 = 3.9kHz, so this filter can have a cutoff in the same ballpark.

So why C46 is 100p? The mystery is… firmware update! During a firmware update, I need a much larger bandwidth, so this input is not filtered as heavily as the others.


Thank you for the clarification :D!
Just to be sure: since the op amp in in the inverting config, let’s say that we have -5V volt as input (let’s suppose, again, to accept Vin values in the [-5;5] range). It will be mapped at 3.3 V and 5V will be mapped at 0V. Will this be taken into account in the software, since we have to decode this voltage ([0;3,3V])in order to understand if we want a positive or negative modulation?

Yes of course, the raw value read by the ADC is multiplied by a (negative) scale and offset in software. These scale/offset values are determined during a calibration procedure (you need the calibration because the resistor don’t have the perfect, ideal value).

This means you have to manually calibrate every CV input of each module you produce?
This seems like a long work to do hehe

This can be software-automated fairly easily (that’s why all recent modules have an extra UART interface on their back - to remote-control the calibration and test operations).

I’m curious which other solutions you have in mind :slight_smile: Trimmers?

Before finding other solutions I need to know how you do this task now. I guess you are providing a fixed voltage to an input cv and, in the software, see how much it deviates from the ideal converted value? Do you do this for each of the inputs one by one?

EDIT: did you find the offset to be liner most of the time?

If you want to only compensate for the offset, you can measure the ADC readout at an unpatched input, you know that’ll be your 0.

If you want to compensate for the offset and scale, you have to provide two voltages, and do the maths.

All inputs have different scale/offset values.

And unless you use very very very shitty op-amps, the relationship is linear.

Since the error seems to be linear the math in the code works well and doesn’t require any polynomial curve fitting (which is cool and keeps the MC away from hard math). The only thing that may bother me is to apply the algorithm for each input (even if in the code you provided this procedure seems to happen only for the V/OCT input).
It may be cool to have a calibrated controllable voltage source to feed to all the cv inputs. Ofc the two voltage points we need to provide must be containted in the largest subset of voltages we are expecting from the imputs (if one imput can vary from [-5;5V] and another from [-1;10V] we can feed to both inuts a voltage between [-1;5V]). Once we have all the CV inputs connected an algorithm can be launched in order to save in memory the gain and offset parameters for each inputs. In order to compute the maths we need the “ideal” values we expect to read for each channel. It would be nice (but not necessary) to initialize them via txt file or something like that since the two points may vary from module to module. It would also be super cool to control the calibration points with the module itself, some power sources have serial communication (RS485/232 for example) but i don’t know if this is viable with an STM device. Sorry if all i wrote is an useless pony trip mess lol.

EDIT: I have just saw that you also calibrate the other ADC in a different loop but for this channels you only compute the offset. May I ask you why? :slight_smile: Maybe you just want the V/OCT in to be more precise?

If you think practically: do it once at the factory using whatever serial controlled precision voltage source you have, save the data in flash memory.

In some cases, the input will clip slightly above or below the limit (eg, the actual range might be [-4.95 to 5.09], so it’s never a good idea to use the largest possible range.

I use 1V and 3V for user-controlled calibration ; and -2V and +4V for factory calibration.

I consider getting the right scale and offset important only for the V/O input, since it’ll directly impact tracking. For the other inputs I’m only getting the right offset.

Yes clearly taking the extremes is not a good choice

I don’t know how this works, but if the factory produces 200 units, do you have to test them one by one?

What’s the difference between the two?

Would you sell modules that haven’t got through any test procedure at all? I won’t. So there are 2 to 10 minutes of test per module, more or less automated depending on how complex the module is, and how easy it is to automate (for digital modules it’s easier to automate everything).

Every UI component, input and output jack and signal path is tested.

I used 1V … 3V initially for the user calibration procedure since MIDI interfaces (or devices with CV output) which can output negative CVs were rarer. And found some devices with 0V as their minimal that didn’t always output a clean 0V.

I use a larger range at the factory when I am in control of the precision and range of the voltage source I use!

Yeha all the modules must be tested. I was just wodnering if you do all the calibration work alone haha.

Since i want to learn c++ and a bit of dsp i ordered “The Audio Programming Book” so i’ll be busy reading for a bit and i’ll not bother you for a while hahaha.

Just one last thing: do you think buying a STM32 nucleo board and trying to read a voltage and output a voltage may be a good starting point in order to learn a bit of STM programming and circuitry?