Tags: posts bitwig-guides Bitwig Grid-Module Tutorial

Bitwig Add and Subtract Module - Simple Math in the Grid

Bitwig Guide | Aug 25, 2022

This video explains how basic math operations like addition and subtraction are used in audio signal processing within the Grid, demonstrating concepts like DC offset, phase alignment, and volume changes by combining oscillators. It also shows how these operations relate to common audio tasks such as mixing, phase inversion, and extracting mid-side information from stereo signals. While the tutorial uses the Grid, the principles discussed apply broadly to audio programming and signal processing in various environments.

You can watch the Video on Youtube

Short Overview

In this video, I explored basic and advanced audio signal processing techniques within the grid, demonstrating how simple math operations like addition and subtraction can shape sound in interesting ways. I showed how phase alignment, DC offset, and the combination of different oscillators affect the waveform and overall audio experience. I also briefly touched on concepts like stereo field manipulation and highlighted that these principles apply across various music software and environments. For those interested in diving deeper, I recommended resources for further study in audio signal processing.

Introduction to Basic Math in the Grid

In this video, I walked through some fundamental math operations you can perform inside the Grid, focusing on Bitwig Studio's modular environment. I started with very simple examples, gradually moving towards more practical and creative use cases in audio signal processing.

Adding Constants and Reading Outputs

To kick things off, I demonstrated how to use the math category within the Grid. The "add" module allows you to sum constants, such as 1 plus 1, resulting in 2. For visualization, I used a readout module, which displays the numerical result immediately. While this basic use might seem trivial, these modules serve as building blocks for more complex operations.

Visualizing Math With the Oscilloscope

Next, I employed an oscilloscope to visualize the signals. One caveat I showed is that the oscilloscope only displays values from -1 to +1. If the sum exceeds this range, the display doesn’t reflect the actual value, so I used lower values (like 0.3 + 0.3 = 0.6) to keep things visible on-screen.

Offsetting Oscillator Signals

I made things more interesting by introducing audio-rate signals. By connecting a sine wave oscillator to the oscilloscope, I explained how changing a constant value can offset the entire waveform vertically. This process, known as DC offset or phase offset (though DC offset is more accurate), shifts the center of the waveform up or down without altering its amplitude. This can be useful for correcting unwanted DC offset, which can cause problems in audio systems.

Working With Multiple Oscillators and Phase

I duplicated the sine oscillator, showing how two signals can appear out of phase due to slight timing differences when the second oscillator was instantiated. Using a trigger module, I synchronized their phases so they aligned perfectly, resulting in a doubling of volume when the waveforms were in phase. Conversely, shifting one oscillator 180 degrees out of phase with the other can result in total cancellation, a phenomenon of destructive interference.

Application in Music Production

I applied these ideas to typical mixing scenarios. For instance, if two instruments (like bass and kick drum) occupy the same frequency but are out of phase, their signals can cancel each other, causing a weak mix. Aligning their phase ensures they combine constructively, giving a much stronger and punchier sound.

Modulating Frequency and Creating Tremolo Effects

Altering the frequency of one oscillator in relation to another produces amplitude modulation effects, such as tremolo, resulting in fluctuating loudness and movement. Replacing sine waves with sawtooth shapes creates even richer, more complex sounds, often used in bass and electronic music. However, this also introduces variations in volume, so the result is not a clean, constant bass.

Using Alternative Mixing Modules: Blend and Sum

I discussed how mixing two signals with a simple "add" module is equivalent to using a mixer, which adds signals together and increases volume if they're in phase. The "blend" module, however, compensates for this volume increase, ensuring the summed signal doesn’t become too loud, particularly useful for combining a dry signal with an effects (FX) return. The "sum" module works like "add" but accepts more than two inputs, making it easy to combine several sources.

Subtraction Module and Phase Inversion

Switching from addition to subtraction, I explored what happens when you subtract one signal from another. When similar signals are in phase and subtracted, the result is silence (zero). But if they are out of phase, the subtraction emphasizes their differences, resulting in a louder signal.

Phase Inversion Technique

Using the subtraction module with an empty first input, I showed how you can invert the phase (polarity) of a signal. Subtracting a signal from zero flips its waveform upside down, essentially creating a mirror image (phase inversion). This technique is handy for correcting phase issues or for special effects.

Stereo Processing: Mid-Side Techniques

Moving into stereo processing, I touched on mid-side techniques. Adding the left and right channels creates a "mid" (center) signal; subtracting them gives the "side" (difference) signal, key principles in mid-side audio processing. Although the Grid has a dedicated stereo split module for this, I wanted to explain the underlying math behind these techniques.

Conclusions on Signal Processing in Audio

Most of the techniques demonstrated are universal in audio signal processing and aren’t specific to Bitwig’s Grid. The same concepts apply when programming VST plugins, using Max for Live, Reaktor, or other modular environments. What changes is the interface and syntax, but the mathematical principles remain the same.

Further Learning and Resources

For those interested in deeper understanding, I recommended reading books on signal processing or exploring online resources like dspguide.com, which covers a wide range of audio signal processing topics that are universally applicable.

Summary

In summary, today’s session was focused on math operations inside the Grid as they relate to signal processing. We explored addition, phase, cancellation, modulation, mixing, subtraction, and mid-side techniques, all of which are foundational in digital audio work. A solid grasp of these basics will help you make better decisions when patching or mixing, and the lessons apply far beyond just the Grid.

Full Video Transcription

This is what im talking about in this video. The text is transcribed by Whisper, so it might not be perfect. If you find any mistakes, please let me know.
You can also click on the timestamps to jump to the right part of the video, which should be helpful.

Click to expand Transcription

[00:00:00] So in the grid, we can go here to the math category
[00:00:05] and can use the add module.
[00:00:07] And we can use a constant and the second constant
[00:00:10] and we can use a readout to see what's going on.
[00:00:14] So one plus one is two.
[00:00:18] Okay, that's it for today, guys.
[00:00:22] Thanks for watching and I'll see you in the next video.
[00:00:26] Just joking.
[00:00:27] It's basic math operation.
[00:00:29] And we can also add two plus one is three.
[00:00:33] So it works kind of an oscilloscope.
[00:00:37] We can see how it looks like on the oscilloscope.
[00:00:42] The problem here is we're adding two and one,
[00:00:44] which is three and three is out of scope of the oscilloscope.
[00:00:49] Because the oscilloscope only shows values
[00:00:53] between minus one and plus one.
[00:00:56] So we have to go here to zero dot three plus zero dot three.
[00:01:01] And this is zero dot six.
[00:01:06] And we can see the line here
[00:01:08] on the oscilloscope pretty clearly.
[00:01:10] So this is pretty boring and maybe a bit useless,
[00:01:14] but sometimes you need a math operation for exactly that.
[00:01:17] But you can also use this for audio signals
[00:01:20] or audio rate signals.
[00:01:21] And then it becomes more kind of interesting.
[00:01:25] So we use maybe here an oscilloscope oscillator,
[00:01:29] a sign, maybe a pitch.
[00:01:33] Pitch over here.
[00:01:40] And we've got the zero, which is C three,
[00:01:46] and maybe an attenuate here.
[00:01:48] And we go into this one here.
[00:01:53] This one here.
[00:01:54] So now I can see here the wave shape.
[00:01:58] Maybe we go here to a percent or half the volume.
[00:02:04] And now when we change at the constant,
[00:02:06] you can see we can offset the whole wave shape.
[00:02:10] It's not a loudness change.
[00:02:12] So we don't change the volume.
[00:02:16] We DC offset or we offset basically the,
[00:02:20] yeah, the middle line of the oscillator shape.
[00:02:25] But when you have this at zero here,
[00:02:28] the wave shape perfectly oscillates around the zero line.
[00:02:33] And this is maybe handy if you want to correct for DC offset
[00:02:37] or you want to introduce DC offset,
[00:02:39] which you probably don't want to, but it's possible.
[00:02:42] Interesting becomes more like when you also have
[00:02:47] an audio rate signal instead of a constant over here.
[00:02:51] What we can do is we can duplicate here this oscillator
[00:02:55] to a second one.
[00:02:57] And maybe use this one here.
[00:03:03] Give this a different color.
[00:03:09] It's in here.
[00:03:15] So now we can see or maybe we add this and this together.
[00:03:20] Something like this.
[00:03:27] You can see the second oscillator, which is green,
[00:03:42] is a bit out of phase compared to the first one
[00:03:46] because we just duplicated this in some point in time,
[00:03:50] probably also in between some of the phase options.
[00:03:54] And at the time when I instantiated here a new module,
[00:03:59] this one triggered out of phase.
[00:04:02] So we can bring this back into phase pretty easily
[00:04:05] by using trigger module here,
[00:04:12] and can read trigger both oscillators at the same time.
[00:04:15] So when I push this button,
[00:04:17] these two oscillator shapes will align perfectly.
[00:04:21] And you can also see that we add up in loudness
[00:04:25] because this oscillator and this oscillator
[00:04:28] is perfectly in phase.
[00:04:30] It's the same frequency and it's the same volume.
[00:04:33] So we add up the same volume together.
[00:04:36] So we have twice the volume as before.
[00:04:38] So you can see here it's lines up perfectly.
[00:04:42] Which means when this oscilloscope is out of phase,
[00:04:46] exactly 180 degrees,
[00:04:48] we end up with a much, much quieter signal.
[00:04:57] In fact, we can cancel completely the signal out
[00:05:02] with each other.
[00:05:04] So we have like where we have a negative value here,
[00:05:08] we add exactly the same amount in the plus range,
[00:05:11] in the positive range.
[00:05:12] And the same here, when we have a positive value,
[00:05:15] we add up the same positive value
[00:05:18] or subtract the same positive value
[00:05:21] to get a negative value.
[00:05:22] So we canceled basically this with this one out.
[00:05:25] So we end up with nothing.
[00:05:27] And this is also something that happens
[00:05:30] when you have a bass drum
[00:05:32] in the same frequency as the kick drum,
[00:05:34] or bass in the same frequency as the kick drum.
[00:05:38] And then, you know, you put these two together,
[00:05:40] mix these two together,
[00:05:41] and then you end up with nothing
[00:05:43] and lose a lot of energy.
[00:05:45] And that's not what you want.
[00:05:46] What you want is to have these kind of
[00:05:51] in the same phase, like this, right?
[00:05:55] So they add up and they increase in volume.
[00:05:58] And then it's much, much more punchier than four.
[00:06:05] So this is something you can do with that.
[00:06:07] The second thing is, or interesting,
[00:06:13] is when you bring this here out of phase
[00:06:15] and change the frequency even more.
[00:06:17] So the blue one here,
[00:06:23] is the frequency is much, much higher than the first one.
[00:06:26] And you can see it introduces here a lot of fluctuations.
[00:06:31] In fact, it changes the volume up and down.
[00:06:33] And it sounds like a tremolo.
[00:06:36] So this is basically what you use
[00:06:55] when you create this kind of hover effect.
[00:06:57] So when I replace this with a sawtooth instead of a sign,
[00:07:02] let's try this out.
[00:07:03] Right, you have these kinds of effects.
[00:07:12] So also nice for bass.
[00:07:14] But it also introduces loudness changes over time.
[00:07:18] So it's not a clear, full, static bass.
[00:07:21] It introduces some fluctuations,
[00:07:24] loudness fluctuations and so on.
[00:07:27] And that's why, okay?
[00:07:30] So back to sign here to the same frequency.
[00:07:35] Bring it to the same phase alignment.
[00:07:39] Okay, so it's also twice the volume.
[00:07:44] I already explained this.
[00:07:46] What you also can do is,
[00:07:49] of course, to exchange this plus for something else
[00:07:55] because the add operation is nothing else
[00:07:58] than just using a mixer.
[00:08:00] So mixing oscillator one to operator or oscillator two.
[00:08:05] The same effect.
[00:08:12] And that's also why when you right click here on the mixer,
[00:08:17] it shows you add at the replacement
[00:08:19] because it's kind of the same.
[00:08:21] So you can see nothing really changes.
[00:08:23] Really the same.
[00:08:28] You can also exchange it for a plant.
[00:08:30] Now you can see the volume is again just in half
[00:08:35] or the same as each one of these oscillators.
[00:08:38] And the reason for that is that the blend module
[00:08:41] compensates for the volume change for the, right?
[00:08:46] Or when you add the signal together
[00:08:48] and they are in the same phase,
[00:08:50] you end up with twice as loud signal
[00:08:53] and the plant compensates for that.
[00:08:56] And the reason is that you use a blend most of the times
[00:09:00] when you mix in a dry signal with an FX signal.
[00:09:03] So reverb or something like this, right?
[00:09:06] And you don't want to change the volume at all.
[00:09:09] Just want to bring in another effect.
[00:09:12] So the blend is basically perfect
[00:09:16] for using it with effects, right?
[00:09:18] Then we have here the sum,
[00:09:24] which is also just an add process.
[00:09:27] So you can see it's the same as add, same effect.
[00:09:31] The only difference with the sum module
[00:09:34] is that you can add more sources here
[00:09:38] instead of just two with the add.
[00:09:40] Yeah, you can bring in more sources,
[00:09:45] more oscillators if you want to
[00:09:47] and experiment with this.
[00:09:52] Let's see, right?
[00:09:55] So now we have here three oscillator shapes
[00:10:00] fighting with, yeah, against each other.
[00:10:03] So add this pretty simple process.
[00:10:09] Also, again, if you use add, it's the same.
[00:10:13] Or it's why we have here in the polysynth,
[00:10:18] we have this mixing or blend,
[00:10:20] oscillator blend mode panel,
[00:10:22] where you have like mix and mix is nothing else
[00:10:26] than just add, add oscillator one to oscillator two.
[00:10:31] And you can mix between the two.
[00:10:34] That's why it's called mix.
[00:10:35] So we can mix one, two or two both together.
[00:10:39] And if you go to negative, it's basically a subtraction.
[00:10:43] Mix is add plus and negative is subtraction.
[00:10:46] So when you go back here to the grid,
[00:10:49] and want to do the negative thing, we go to subtract.
[00:10:54] So we are using values and subtracting
[00:10:58] one signal from the other.
[00:11:01] And now it's exactly the opposite around.
[00:11:03] So when we go here to this,
[00:11:06] and you can see here below,
[00:11:08] when we bring these signals 180 degrees out of phase,
[00:11:11] like this, right?
[00:11:16] It doesn't cancel.
[00:11:18] It's not like that you end up with nothing.
[00:11:20] Instead, you end up with the loudest signal, okay?
[00:11:24] So it's completely the other way around.
[00:11:27] And when we have these both signals here in phase,
[00:11:30] then we end up with nothing.
[00:11:34] So we can use the subtraction module
[00:11:36] to compare two signals together.
[00:11:41] So we take one signal and subtract it from the other signal.
[00:11:44] And when you end up with nothing,
[00:11:47] then both signals are the same.
[00:11:50] And because of that, we can just remove here
[00:11:52] maybe the bottom oscillator and add these two together.
[00:11:57] And what you can do with the subtraction module now is
[00:12:02] if you leave the first input jack free
[00:12:04] and use the signal in the second input jack,
[00:12:06] you end up with the phase inverted signal.
[00:12:09] Why?
[00:12:10] Because the first input jack is empty.
[00:12:13] There's no signal going in, which means zero.
[00:12:16] And we subtract our signal from zero.
[00:12:21] So we end up with the phase inverted signal.
[00:12:24] So you can see here the red one is the phase inversion.
[00:12:27] And the blue or green one here
[00:12:31] is basically our dry signal.
[00:12:33] So we can use the subtraction module
[00:12:35] with the first input jack free as an phase inversion tool
[00:12:39] or phase flip or polarity inversion tool.
[00:12:44] So another interesting topic for the subtraction
[00:12:48] and add module is probably also the stereo field.
[00:12:51] It's not really needed in the grid, but I'll show you anyway.
[00:12:55] So when you have stereo signal here,
[00:12:59] that's just a regular drum loop.
[00:13:01] And you take the left channel
[00:13:10] and subtract it from the right channel.
[00:13:12] You end up with the side channel.
[00:13:14] If you take the left channel and add it to the right channel,
[00:13:24] you end up with the mid signal.
[00:13:26] If you add up the side channel
[00:13:42] to the mid channel,
[00:13:43] you end up with the left channel.
[00:13:48] If you subtract, you end up with the right channel.
[00:13:54] But it's not really needed.
[00:13:58] It's not really needed because we have here the stereo split
[00:14:02] where we get the left, the right, mid-side output.
[00:14:06] And you also have the merge.
[00:14:10] You can bring everything back together if you want to.
[00:14:13] So it's not really needed,
[00:14:14] but it's maybe good that you know it
[00:14:17] or that you at least heard of it,
[00:14:19] how do we get the mid-side informations
[00:14:24] or the left or the right channel out of signals.
[00:14:27] At the end of this video, I want to tell you
[00:14:31] that most of the stuff I told you in this video
[00:14:33] is not really grid specific.
[00:14:35] It's the same, you do the same thing basically
[00:14:38] when you code a VST plug-in or do something in MaxDSP
[00:14:43] or if you do it in React or it's basically the same thing.
[00:14:47] The only thing that changes is the syntax
[00:14:50] or maybe how the modules look like
[00:14:53] and what kind of features they have.
[00:14:55] But besides that, it's everywhere, it's the same.
[00:14:59] So in this video today,
[00:15:01] we basically spoke more about
[00:15:04] signal processing than the grid.
[00:15:07] And if you want to learn more,
[00:15:10] you're probably better off with just reading a book
[00:15:12] of Amazon about signal processing
[00:15:14] or go to this website here, which is called dsbguide.com.
[00:15:19] There are a lot of chapters in here
[00:15:20] about different audio signal topics
[00:15:25] and yeah, it's interesting
[00:15:27] and you can apply a lot of that stuff also in the grid.
[00:15:30] So that's it for the day.
[00:15:32] Thanks for watching.
[00:15:33] Leave a like if you liked the video
[00:15:35] and I'll see you in the next one.
[00:15:36] Bye.