$0.00 0

YOUR CART
Checkout

SUBTOTAL
DISCOUNT
VAT
TOTAL
Checkout
Banner
In this tutorial series, I'll focus on building an envelope in Reaktor Core. Readers of...

Reaktor Tutorials

Building an Envelope in Reaktor Core, Part I

In this tutorial series, I’ll focus on building an envelope in Reaktor Core. Readers of this series should have a decent understanding of the Core environment. You can read this series of tutorials to get yourself up to speed if necessary.

ENVELOPE FUNDAMENTALS

To begin with, let’s take some time to talk about what an envelope is and how it works. Obviously this is the first step to building just about anything from scratch in Reaktor. In this tutorial we’ll be focusing entirely upon a standard ADSR envelope design. This section will probably be incredibly boring if you have a strong knowledge of envelope architecture!

While envelopes can be used for several purposes, such as modulating the cutoff frequency of a filter, they are most commonly used to control the amplitude of another signal, generally audio oscillators.

The first phase of an envelope, called the Attack phase, is triggered by the start of a new MIDI note. The amplitude of the envelope at the beginning of a new Attack stage should simply be the last value output by the envelope. This may seem counter-intuitive, as generally the Attack stage is thought to start from an amplitude of zero and rise to the maximum amplitude, which is controlled by the MIDI gate.

However, there is the possibility that a new MIDI gate arrives before the previous envelope is finished with it’s Release stage. In this instance, restarting from zero will create a ‘click’, which sounds distinctly like a digital glitch (and not a good one), as the envelope jumps from it’s previous value directly to zero. So, we re-start the envelope from it’s most recently sent output, which should usually be zero anyway.

The Decay stage simply decreases from the maximum amplitude to the amplitude chosen by the Sustain knob. Since the Decay stage only begins at the end of the Attack stage, it is quite simple to implement.

Not as simple as the Sustain phase, however, at which point the envelope simply outputs the value given by the Sustain knob.

Finally, we have the Release section, which is sort of an inverse of the Attack phase. The Release section is triggered by the release of a MIDI note. It travels from the most recently output value (often the Sustain value) back to an amplitude of zero. While the Release is usually thought of as starting from the Sustain value, it is quite possible that the MIDI note is released before the envelope reaches that stage, so we can simply use the last value output from the envelope as the start of the Release stage.

The last thing I want to cover in this section is the four knobs that the user uses to interface with an envelope – Attack, Decay, Sustain, and Release. The Attack, Decay and Release values control the length of each section in time (we’ll be using milliseconds). The Sustain knob, meanwhile, is an amplitude value.

CORE IMPLEMENTATION

We should be able to implement all 4 envelope stages using a single time counter, as outlined in Part III of the Introduction to Reaktor Core series:

This counter counts the number of ticks of the sample rate clock. I have modified from the previous version to deal with integers only. This is not strictly necessary, but it is slightly faster.

This counter restarts from zero at every incoming event to the ‘Reset’ input. When we connect the incoming MIDI gate to the Reset input, the counter will restart every time a new MIDI note is pressed, and every time those notes are released.

We can then use the state of the gate input in conjunction with the output of the counter to decide where to route the counter value. For example, if the gate is on, we know that the value needs to be routed to either the Attack, Decay, or Sustain stages. If the gate is off, we know it can go directly to the Release stage:

Next, we’ll take the Attack and Decay times, and calculate their length in samples. For example, if the Attack is 100 milliseconds long (1/10th of a second) and the sample rate is 44100, there are a total of 4410 samples in 100 ms (1/10 * 44100):

I rounded the output to the nearest integer value, this way each stage takes a certain number of sample ticks, with no annoying fractional values, such as an attack time taking 101.45 samples.

If the gate is on, we can use these value to determine which stage is currently active. If the counter is less than the number of samples in the Attack stage, then the Attack stage is active. If not, we check if the counter is less than the Attack stage length + the Decay stage length.

Using this information, we can choose which output to send the counter value to:

The counter value will be used as a clock for whichever macro receives it. In the next tutorial, we’ll design the envelope stages so that they only output a value if one is received to the clock input. Then we can simply merge together the outputs of the stages and we’ll have a functioning ADSR envelope.

CONCLUSION

It may feel as though we’ve accomplished very little, for the length of this tutorial, especially given that the counter was mostly done in the Introduction to Reaktor series. However, we have accomplished much in that we have outlined the problem and have a large view of how to solve it.

The reality is, we’re quite close to being done! Join us next time, where we’ll get into designing a function that can be used for the Attack, Decay and Release sections. Thanks for reading!

Have a Question or Comment About This Tutorial?

Want to ask a question about this tutorial or perhaps you have something to add?

Click through to our forum post about this tutorial and join the conversation!

Visit: Building an Envelope in Reaktor Core, Part I

RELATED COURSES

Building in Reaktor for Beginners

ADSR Courses

Add to cart

Sequencer Modules in Reaktor

ADSR Courses

Add to cart

FFT (Fast Fourier Transform) with Reaktor

ADSR Courses

Add to cart

Reaktor Core Masterclass

ADSR Courses

Add to cart
Waveform Loaded
Waveform Played
×
PLAYLIST
Clear all
WISHLISTS
Create an account to use wishlists
×
SAVE TUTORIALS
Create an account to save tutorials
×
FOLLOW YOUR FAVORITES
Follow your favourite labels, formats and genre's and ADSR will show what's new in those on your next visit.
×
  • Create product wishlist
  • Save your favorite tutorials
  • Regular discounts and exclusives
  • Never miss a sound! Follow your favorite labels.
Sign up to My ADSR to ensure you're ahead of the pack. Save your favorite content and be notified of new content. You'll never miss a thing!
Create your account now!
CREATE ACCOUNT
Sign up to My ADSR to ensure you're ahead of the pack. Save your favorite content and be notified of new content. You'll never miss a thing!
  • Get days all ADSR courses free
  • Create product wishlist
  • Save your favorite tutorials
  • Regular discounts and exclusives
Create your account now!
SIGN IN
adsrsounds.com login Video streaming login
Remember me
Forgot your password?
DON'T HAVE AN ADSR ACCOUNT?
Create your account
FORGOT PASSWORD

Send info
  1. Enter your email address
  2. Click "Send info"
  3. Check your inbox for an activation link
  4. Visit activation link and enter set new password
Sign in
DON'T HAVE AN ADSR ACCOUNT?
Create your account
IMPORTANT: Is this product compatible with your system? Please check the product system requirements tab before purchasing. To proceed with this purchase you must check the box to confirm you have checked the requirements.


I have read the system requirements and agree to the return policy. I understand that refunds will not be given due to limitation of my software or operating system.

I don't agree
, you have loyalty credit available. To redeem click the button to claim !
Claim
Claim your free sounds

For every $5 you spend on ADSR receive 1 free credit for Sample Manager.

Even better, we have back-dated this so any purchases you made since 2017 have also been credited to your account!

Click the button below to claim your free credit.

Get my free credits
Loyalty credits
1Every purchase you make on ADSR* now earns you 1 loyalty credit for every $5 spent
2Once you make a purchase your credits are added to your account
3Credits can be redeemed in ADSR Sample Manager to download individual loops and samples
4To redeem simply download ADSR Sample Manager and/or log into Sample Manager with your ADSR login details
5Credits will have been automatically added to your account
6Loyalty credits expire 30 days after initial purchase
* Not including video subscriptions