Tags: posts polarity-music Bitwig Convolution Audio-FX Sampling Grid Community

Exploring Convolution in Bitwig Studio's Grid: A Start to Creating a Convolution Effect Inside the Grid

Tutorial | Jun 16, 2020

In this video, I explore the concept of convolution and whether it's possible to do inside the grid of Bitwig Studio. I showcase a preset I created that allows users to alter an input signal with a convolution signal. I explain the basic concept of convolution, which involves multiplying an input signal with an impulse response and adding it to the output signal. I share a website that helped me understand convolution better and demonstrate how I tried to make the preset work within the limitations of the grid in Bitwig Studio. I acknowledge that this preset has its flaws and limitations, but I still offer it for those who want to experiment and learn more. Overall, this video is a documentation of my learning process and I invite viewers to share their ideas and insights in the comments.

You can watch the Video on Youtube - support me on Patreon

Questions & Answers

Maybe you dont watch the video, here are some important takeaways:

Questions:

1. Is it possible to do convolution inside the grid of BitVic Studio?

The video attempts to explore the possibility of doing convolution inside the grid of BitVic Studio. The creator of the video shows a project where they use a vocal sample as the input signal and a kick sound as the convolution signal to create an output sound that is a combination of the two samples. The creator acknowledges that this is not a perfect solution, but it is a start towards achieving convolution inside the grid.

2. How can one save money on BitVic Studio and also support the creator's channel?

The creator of the video provides a link to their webpage which includes a link to the BitVic Store. By using the creator's code, users can save 10% on the regular price of BitVic Studio and upgrade plans, while also supporting the creator's channel and content.

3. What is the concept of convolution and how does it work?

Convolution is a process in which two signals are combined to create a new signal. This involves taking the input signal and multiplying it with an impulse response, which is another signal that represents the response of a system to a specific input. The result of this multiplication is then integrated over time to create the output signal. This process can be performed on a sample-by-sample basis and can be used to achieve a variety of effects, such as reverb, filtering, and equalization.

4. How does the creator attempt to achieve convolution inside the grid of BitVic Studio?

Due to the limitations of the BitVic Studio's grid, achieving true convolution is not possible. However, the creator attempts to create a similar effect by iterating through the impulse response of a sample using an attack-decay envelope that is targeted to overlap with a single sample of the input signal. The creator then uses an array to write the output of this impulse response and delays it by a single sample before adding it back to the next index number. The resulting effect is not perfect, but it provides a starting point for further experimentation and development.

Transcription

This is what im talking about in this video. The text is transcribed by AI, 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.

[00:00.000] In this video, it's about convolution.
[00:01.800] Is it actually possible to do inside the grid of BitVic Studio?
[00:06.200] That's something we try to find out in this video.
[00:14.600] If you want to save some money on BitVic Studio
[00:17.400] and the upgrade plans
[00:18.800] and you want to support my channel and my content
[00:21.600] then go to my web page,
[00:23.000] use the link to the BitVic store,
[00:24.800] use my code and save 10% on the regular price.
[00:30.400] So before I show you what I've done
[00:34.200] and what I've learned and how this works,
[00:36.800] I want to show you how it sounds.
[00:39.000] And we have here two samples
[00:40.600] and the first one is our input signal,
[00:44.000] which is a vocal sample.
[00:45.600] It's time.
[00:47.000] And the second sample is our convolution signal
[00:50.200] and we try to mess up the first input signal
[00:54.000] with this convolution sample.
[00:56.000] And this is how the output sounds
[00:58.200] when we use here a kick sound
[00:59.800] as a convolution signal.
[01:04.000] You can try and drag in here a snare.
[01:08.800] So it's a different sound,
[01:11.200] maybe a rim shot.
[01:24.800] So this is the current state of this project basically.
[01:28.200] So this is not perfect
[01:30.000] and it's not a real convolution,
[01:31.800] but it's a start
[01:33.000] because someone yesterday asked in the discord
[01:35.600] is it actually possible to create
[01:37.700] convolution effect inside the grid?
[01:40.100] And I said maybe and I searched for information on the net.
[01:44.100] And I found this website here.
[01:46.900] It's called DSP guide.
[01:48.400] And there's a lot of information on this website
[01:51.200] and also a whole chapter on convolution.
[01:54.400] And I also put, of course,
[01:55.400] the link in the description below
[01:56.700] so you can read it for yourself.
[01:59.700] Yeah, I basically want to give out this preset here
[02:02.900] to you and some of you maybe have the knowledge
[02:05.700] or the time to experiment with it
[02:07.400] and maybe make some additions.
[02:08.900] And in the end, we have together a community project
[02:11.900] where we created a small efficient
[02:16.000] some kind of convolution effect inside the grid.
[02:19.200] We can share with the rest of the community.
[02:22.000] So I tried to explain what I've,
[02:25.300] how far I've come yesterday.
[02:27.100] So I read this website here
[02:28.800] and the whole concept of convolution
[02:30.500] is actually pretty easy concept wise,
[02:34.000] but it gets pretty hard to imagine inside
[02:38.700] the head because you have nested loops.
[02:41.000] So you have your input signal here.
[02:43.800] You can see is X and then you have an impulse response,
[02:46.500] which is H and then you have your output,
[02:48.400] which is called Y.
[02:50.600] And this is just an amplitude on waveform.
[02:53.400] Also this impulse response is also just a waveform.
[02:57.000] And you see this graph here as some dots
[02:59.600] because it's about samples.
[03:01.900] So you have multiple samples here.
[03:04.200] It's just eight samples.
[03:06.000] So it's not many, but just to explain the concept, right?
[03:10.300] So all you have to do is,
[03:11.700] and you see this multiply is simple here.
[03:13.900] All you have to do is basically you take,
[03:15.900] for instance, take the first sample, this dot here,
[03:19.600] which is sample zero.
[03:21.300] And the sample zero has value of zero.
[03:24.400] So you take the zero and multiply it with every sample
[03:27.800] in this impulse response.
[03:30.500] So you multiply it with the first sample here,
[03:32.500] which is one and you multiply it with the first sample here,
[03:35.700] which is zero dot five and so on.
[03:38.800] And then you edit to the output signal here, right?
[03:42.500] So every time you multiply,
[03:44.300] you edit to the output signal.
[03:47.700] This means also that the output signal
[03:49.900] is always a bit longer or exactly longer
[03:54.400] as the length of the impulse response.
[03:57.600] So it's always edit every time you step through the input signal here.
[04:02.300] You add basically a bit of the impulse response to the output here.
[04:08.000] And then in the end, you have a convoluted signal.
[04:11.100] It's also shown here in this graph.
[04:13.200] I think it's a bit hard to explain inside the book.
[04:16.400] I think it's much better to make some kind of animation.
[04:20.800] But you can see basically the input signal
[04:23.700] stepping through each of the impulse response
[04:27.300] and changing the output.
[04:28.500] So this is the output here changing over time.
[04:33.000] And what it made it click for me was actually
[04:36.500] this small code bit here down on this website.
[04:41.000] Because I am kind of a web developer or was a web developer.
[04:45.900] And I'm familiar with a race and for loops.
[04:50.300] So you have three arrays here X, H and Y,
[04:53.300] which is our input signal impulse response and output signal.
[04:57.600] And all these arrays have multiple values inside.
[05:02.600] And you can read and write with the right index number.
[05:09.900] And then you have two nested loops, basically four loops.
[05:16.200] And you'll firstly iterate through the input signal.
[05:20.000] As you can see, 0 to 80 here.
[05:22.500] And for every sample, then you open up another for loop
[05:30.900] and iterate over the impulse response.
[05:35.000] And then you multiply the signals or the sample values.
[05:39.900] And then you add it back to the original signal
[05:43.200] and also modify the already changed samples in the output.
[05:49.600] That's a bit hard to grasp and it also says you're down below
[05:52.900] in the text, keeping the indexing straight in line
[05:56.000] 240 can drive you crazy.
[05:58.600] And that's basically this line here.
[06:02.600] It's not that you have just to simply multiply
[06:05.800] the input sample with the impulse response sample.
[06:09.600] You also have to change or add to the currently output sample
[06:14.700] here and modify it every time you iterate
[06:19.800] through the impulse response.
[06:22.600] So it's hard to explain, actually,
[06:25.100] but when you are familiar with coding,
[06:27.400] then it makes sense.
[06:31.400] And it's also very well explained on this website here.
[06:34.800] So inside the grid, everything that's explained here
[06:39.000] in this code is not possible.
[06:41.800] You can, firstly, you can't do something sample
[06:45.100] accurate inside the grid, really.
[06:47.900] So I try to circumvent this with this AD envelope here.
[06:54.400] And you can see it's a pretty short attack time here,
[06:58.500] exactly 0.02 milliseconds,
[07:03.100] which should or which is aimed for targeting just one sample.
[07:08.800] So if you use a calculator here,
[07:15.000] it's actually on the screen.
[07:17.400] So when we take our sample rate, which is 44,100,
[07:24.600] which is the samples in one second.
[07:26.500] So 1 second is 1,000 milliseconds,
[07:30.800] and then you divide it by 44,100.
[07:35.800] Yeah, dots or samples.
[07:39.100] And then you get the second, the milliseconds,
[07:43.200] which is 0.022 milliseconds.
[07:46.700] That's basically the length of one sample
[07:49.500] when you have a sample rate of 44,1 kilohertz.
[07:54.200] So this was my attempt to basically target one sample.
[07:58.500] So when we have in this input signal,
[08:02.200] reached one sample or when we process one sample,
[08:07.000] then I'm iterating over all samples in this impulse response
[08:12.800] because I'm using an attack time of 0.02 milliseconds
[08:20.300] to scan through the whole sample here.
[08:25.400] So one sample here is playing, and it's still playing.
[08:28.300] And then I try to iterate over all samples
[08:32.100] in this impulse response.
[08:34.000] When we switch over to the next sample in this input signal,
[08:39.800] then I'm again trying to iterate over all the samples
[08:44.200] in this impulse response and so on.
[08:46.200] So basically for all samples in here,
[08:49.200] I'm iterating over the whole sample in this sample.
[08:53.700] So the first thing I don't know is,
[08:56.900] is it actually possible to iterate
[09:00.800] through all the samples here,
[09:03.700] while one sample is playing here.
[09:05.700] Maybe it's not that accurate, right?
[09:07.900] Maybe the timing is also,
[09:11.900] we have only two digits after the floating points
[09:16.500] we can input 0.022 milliseconds.
[09:21.400] It's a bit rounded here to 0.022 milliseconds,
[09:25.000] so it's not that accurate.
[09:27.900] So that's the first compromise I have to do.
[09:32.900] And what's that?
[09:35.500] OK, then I'm basically writing into an array here.
[09:41.200] Writing this output of this impulse response into this array.
[09:47.200] And the input of this array is basically
[09:52.600] the impulse response samples
[09:55.300] and the currently played sample of this input signal here
[09:58.600] multiplied.
[10:01.100] And then I'm using the output of this
[10:03.200] with the long delay, which also the minimum delay
[10:07.400] of this long delay is exactly 0.022.
[10:10.700] I don't know, it's in coincidence or it's actually,
[10:15.700] yeah, it's made this way.
[10:18.100] So yeah, I'm delaying basically the output
[10:21.300] and adding it back to the next sample.
[10:23.900] So the sample, the delay is exactly one sample long.
[10:28.700] So when we are here, switch to the next index,
[10:35.500] we are using basically the output from the index
[10:39.700] before and adding it to the next index position in the array.
[10:46.800] And I'm adding it back here just with a simple addition.
[10:51.100] So we kind of stepping through the input signal,
[10:55.500] multiplying every sample from the inputs response,
[11:03.500] and also adding the last index value from the output
[11:10.800] to the next index number.
[11:14.900] I also don't feel like this.
[11:18.500] And then I'm mixing everything together.
[11:21.100] And that's it.
[11:22.300] So that's basically what I try to do.
[11:27.700] I don't know if this is correct, and all the stuff here
[11:31.400] I'm trying to achieve here is working correctly.
[11:35.800] But at least you get some kind of effect.
[11:39.100] It's time.
[11:40.200] It's time.
[11:41.500] It's time.
[11:43.600] And it changes with the impulse response.
[11:46.500] Simple.
[11:51.300] You also have to remember that also the array
[12:03.100] has only 1,024 steps long.
[12:08.500] So we can't use super long impulse responses.
[12:14.500] So that's what I try to do.
[12:19.100] At least there's an outcome.
[12:20.500] You can change the input signal with the impulse response
[12:23.500] here.
[12:23.800] I don't know if it's correct or not.
[12:25.900] So I'm giving this away.
[12:27.100] You can download it and hopefully someone
[12:29.700] can make some steps in the right direction.
[12:37.900] At least it's a start.
[12:39.600] So this wasn't really a tutorial.
[12:41.300] It was more like a v-log or documentation about some advanced topics.
[12:47.500] And maybe some of you have some ideas to bring this project forward.
[12:51.900] So let me know in the comments.
[12:53.300] If you have some questions, also please leave a comment.
[12:55.500] Of course, leave a like if you liked the video.
[12:57.700] Subscribe to the channel and to Patreon if you want.
[13:00.800] And I see you in the next video.
[13:02.700] Thanks for watching.
[13:03.500] I'll see you in the next video.