Envelope generator

Envelope generator with rise and fall control, sustain AR and no-sustain AD modes, rise and fall modulation.

:blue_book: Documentation: modules — Envelope
:shopping_cart: Product page: microrack — Envelope

Cv inputs for rise and fall with the ability to to loop the evolope :pinched_fingers: question is how fast can this thing go?! :smirk:

Also something like this would be a great teaching point. I remember the first time i came across “end of cycle trigger” didn’t have a clue for months what that was typically used for as id been accustomed to having a switch or button simply labelled “loop”. Then i quickly realised damn this isn’t just a fun new flexible modulation sorce but its also a whole new sound source as well! I think its things like this people miss out on

We have issue with time range right now, but the range can be fixed by tuning of the resistor values. I plan to implement rise/fall time from about 30 second up to 0.005 second (200 Hz), so you can use this module as LFO and even as signal oscillator

1 Like

Hooray, big description update!

Wow, this is a flexible module!
At first I didn’t think much of it: one of those simplified envelopes, where you need two of them to build an ADSR. But often a two-stage envelope ist sufficient, and this analog gate input opens up so many more uses!

Versatility of the modules is what distinguishes a modular system from a sawed-apart monosynth. :wink:

2 Likes

I was inspired by Buchla envelope, Makenoise Function and another same ad/ar envelopes

1 Like

Good news: envelope generator is ready!

Rise and fall time changes from 40 s to 10 ms, so you can use this module as envelope, as LFO, as slew limiter and as envelope follower.

I really like the result and I can’t wait for you to appreciate it too.

4 Likes

The output does a small “jump” at the start of each flank, which goes unnoticed in most applications, but is very obvious when used to modulate delay time (trying to build a flanger). It does not do that in sustain mode (but then it will not work as an LFO of course).

I have no idea what causes this effect, but then the envelope is one of the more complex circuits.

1 Like

I will investigate source of this jump. Maybe this is because of not perfect match between charge and discharge transistor circuits

1 Like

I have talked to a real electrical engineer (instead of just a hobbyist like me) about the circuit and we’ve come to several conclusions:

  • output voltage follows exactly the voltage at C1, so any jump in output voltage must come from a sudden pulse of current into or out of C1
  • the current into C1 comes from a current mirror controlled by RISE (or FALL) and R4 (or R5).
  • actually the current mirror is controlled by the difference between EG_IN and RISE
  • U3.2 makes sure that RISE follows along when EG_IN changes
  • U3.2 has (like every OP-AMP) a limited output slew rate, so if EG_IN changes too fast, there may be a glitch that sends a short pulse of current into C1
  • in Sustain mode EG_IN is generated by U1.2, another OP-AMP (with a limited slew rate), so U3.2 can follow along just fine
  • in Attack-Decay mode EG_IN comes from the digital output of U2 (a NE555, i believe), which may change too fast for U3.2 to follow.

Of course this is all just theory and needs to be checked with the datasheets and, ultimately, with an oscilloscope. But maybe a capacitor from pin 1 of SW1 to ground (forming a lowpass together with R32) would mitigate the problem already.

Edit: I did some homework: the LM358-datasheet gives a maximum slew rate of 0.5V/µs, so a 12V jump would take 24µs. The NE555-datasheet says: rise time is 300ns, but that is a digital signal, so 300ns is the time between 10% and 90% of the new output level; no word about the remaining 20%. But it should be done in unter 2µs, which means that it takes U3.2 about 22µs to catch up, and during this time an uncontrolled current is injected into C1, making the voltage jump.
Moving SW1 to the input of U1.2 instead of the output would solve the problem, but I’ll still try the capacitor as a feasible fix for the already existing modules.

Edit again: here is the 'scope screenshot I should have provided at the beginning. Output of the envelope module in A/D mode at the top of the curve. The jump (ca. 0.4V) happens wthin 25µs, as expected more or less.
The first part of the jump looks almost linear, ca. 300mV in 12µs, which amounts to 25mA at C1, five times more than expected for normal operation.

Yet another edit: The env could also use one of those universal gates (or anything with a schmitt-trigger input) in the trigger path for the A/D mode (before C2/C3). That would guarantee a steep enough flank to trigger C2/C3 - R49 - U7 , even for very slow input signals. Probably C2 and C3 could then be smaller.

2 Likes

Update on the “jump” at the start of each flank: I soldered a capacitor (100nF) from SW1, pin 1 to GND, which seems to help a lot.


It doesn’t look like a big change on the scope, compared to the previous screenshot, until you consider the different vertical scale.

Here is an example of the “improved” envelope in action, as an LFO modulating the delay time to approximate a flanger:

2 Likes

oh wow!

I want to make the same fix, will come back to you with the results.

Hello! While following the osc module tuning guide that was recommended to me in this post on the esp32 module thread, I noticed the envelope sustain button impacts the frequency of the osc module even when the envelope module was NOT in the signal chain. The signal chain was esp32-midi module output B → osc module pitch in → osc module triangle out → output module. When the envelope module was also plugged in to the board and the sustain button was engaged, there was a significant increase in pitch by ~40cents. Is this normal behavior for the envelope module?

I also noticed that the pitch would be different depending on whether any module would be plugged in at all. Keeping the same signale chain as above, just having another module plugged into the board at all would change the osc frequency by ~40 cents. Is that normal behavior for modular synthesis in general? Microrack is my first experience with module synthesis.

That is definitely not normal. We expect modules to influence each other, when they are connected by a wire, and no influence without a wire. There is a reason why wireless modular hasn’t been invented yet: nobody wants it.

Jokes aside: how do you supply your setup?

If by chance you are feeding some “5V” into the USB-C, the 5V rail may be weak. The 5V rail supplies most (if not all) LEDs, so turning one on or off via the Env mode switch changes the current that is drawn from the 5V regulator. And that can change the actual Voltage on the 5V rail, if it is underpowered (weak). That in turn may (if the 5V rail is low enough) change the 3.3V on the ESP board, wich acts as a reference for the analog outputs.

This is just a theory, but kevinjwalters has documented the behaviour of the 5V rail in various supply situations here and the datasheet of the AMS1117-3.3 should explain the rest.
Edit: Datasheet says the AMS1117 needs 1.1-1.5V more input than output, so the 3.3V are in trouble, if the 5V rail drops below 4.4V, which happens if the input at the USB-C is below 4.7V, which can happen, especially with long cables in USB-A sockets (5V wall warts with a permanently attached cable compensate for the voltage drop in the cable at higher currents, but at a USB-A socket they don’t dare to generate overvoltage).

So we could do the Buchla thing and declare this a feature (“wireless modular”), saving you lots of cables in making microtonally generative patches… :slight_smile:
Or: use a good power supply. I’ve had good experience with a modern smartphone charger (USB-C, 20W); the power module will try to get 12V, but is also happy with 9. Or via the barrel jack: 9V or 12V, at least 1.5A.

That did the trick. Exactly as you said, I was using a wall wart that was 5V 2.4A wall wart (two usb-a plugs) to power the microrack. I tried two modern usb-c 20W and 45W warts and the envelope module no longer impacted the pitch. measured the VIN+ to GND- pins on the power module and the original wall wart showed 4.6V while the second two got between 8 and 12. One problem solved.

Another observation is that the pitch of the oscillator was about half an octave off between the old usb-A wall wart and the new usb-c ones. When I used the old wall wart and tuned the oscillator so the A key made 440Hz, the usb-c wall warts produced a note close to an E half an octave down. The oscillator is also back out of tune per octave, which was my original problem, but now I can fix that too thanks for Kevin’s article.

Thanks for the help @Nosnibor. @kevinjwalters You may want to update your oscillator tuning guide to include a first step of checking that the power supply is strong enough.

2 Likes