Tags: posts polarity-music Bitwig Bitwig-5.3.2 ControllerScript Harmony

Key Filter - Bitwig Piano Roll Extension

Tutorial | Mar 06, 2025

In this video, I introduce new features to my controller script, Retrospect, which now includes built-in functionality to correct out-of-scale notes directly, eliminating the need for a separate key filter in Bitwig. This update allows users to record the correct notes in a desired scale directly into a note clip, simplifying the process and saving time. I also provide guidance on how to download and set up the script, and welcome feedback and feature requests from viewers.

You can watch the Video on Youtube

Summary

Maybe you don't watch the video, here are some important takeaways:

In this video, I discuss an enhancement to my controller script called Retrospect. If you're not familiar with what Retrospect does, I suggest you watch my previous video for a detailed explanation. In short, the script records MIDI data in the background to ensure you never lose a melody or chord progression. This time around, I've added some new features and the best way to explain them is through a signal flow graph.

Here's how it typically works: when you play random notes on your keyboard, it's often difficult to determine if they fit within a certain scale. These notes, including any out-of-scale ones, are sent to a controller script and then into Bitwig's piano roll, where they're recorded. Even though some notes may be out of scale, you can use Bitwig Studio's key filter to correct them to fit into a scale like D sharp minor. Once corrected, these notes are sent to an instrument, such as the Polymer synthesizer or any VST instrument you choose. The issue arises during recording; you record the actual notes you play, which might be out of scale. Although they get corrected in real-time, having them corrected directly in the note clip would be more efficient.

My solution is to integrate the key filter's functionality directly into the controller script, eliminating the need for the additional setup of another instrument track. By doing this, it ensures that only the correct scale notes are recorded initially. This approach simplifies the process and streamlines your workflow, as you won't have to deal with the cumbersome task of creating additional tracks and routing outputs.

To demonstrate this, I show how selecting a scale, like D sharp major, and enabling the key filter ensures you only play notes within that scale. Although I noticed a bug where notes are sometimes cut off when moving an incorrect note to a correct one, it's a minor issue that I'll address. The current workaround involves disabling a specific feature to prevent this cutoff, which works reasonably well.

You also have access to a wide variety of scales beyond what standard key filters offer. With a multitude of scales available, my script allows for diversity in your music production without the hassle of manually correcting notes.

I recommend downloading the updated script from the description below. For those who encounter difficulties downloading JavaScript files directly, I suggest downloading a zip file and extracting it into the appropriate folder within your controller script directory. Once placed correctly, you can add the Retrospect controller via the Bitwig interface, and it should function as intended.

If any issues arise or if you have feature requests, feel free to leave a comment or join my Discord for support. I also welcome supporters on Patreon if you'd like to help me out. Thank you for watching, and I hope you enjoy using the enhanced features of the Retrospect script. See you in the next video!

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:00] Hey folks, welcome back.
[00:00:01] Today it's again about my controller script called Retrospect and I don't explain what
[00:00:06] it does here in detail because I did this already in the last video, so just rewatch
[00:00:11] my last video.
[00:00:12] It kinda records MIDI data in the background so you'll never lose a melody or chord progression,
[00:00:19] but I added some new features this time, right?
[00:00:23] So I want to explain here what it does and the best way to explain this is actually to
[00:00:27] show you here a flow graph or a signal flow graph.
[00:00:32] So usually when you play something on your keyboard here, right, you play on your keyboard
[00:00:37] random notes and you have no idea what notes are in a certain scale, right?
[00:00:43] So you play some wrong notes probably or out of scale notes and then you send this MIDI
[00:00:48] data into a controller script and this controller script then sends this to Bitwig to the piano
[00:00:54] rule.
[00:00:55] So here you can record the notes, right?
[00:01:00] And there are probably some wrong notes or out of scale notes, but that's not a big problem.
[00:01:06] You can just use the key filter of Bitwig Studio, right?
[00:01:09] So you can set up here some kind of scale, maybe D sharp minor, right?
[00:01:14] And then this device corrects all the wrong notes or out of scale notes to the right notes
[00:01:21] that are in a certain scale.
[00:01:24] And then it sends these notes to an instrument.
[00:01:27] In this case here, it's Polymer synthesizer.
[00:01:29] You can use a VST instrument or whatever you want to use.
[00:01:32] It doesn't matter.
[00:01:34] And then you play the right scale notes with this instrument, not a big problem.
[00:01:40] The problem is that when you hit record, you record basically what you play on the keyboard.
[00:01:48] And what you play on the keyboard is probably out of scale.
[00:01:52] So every time you hit play on your note clip, you play out of scale notes.
[00:01:58] And then these out of scale notes are corrected from the key filter on the fly and then are
[00:02:03] sent out to your instrument.
[00:02:06] So it's not a super big problem, but sometimes you want to have inside of the note clip the
[00:02:12] right notes.
[00:02:14] You want to record the right notes that are in the scale.
[00:02:18] So the workaround for this is in Bitwig, you just create another instrument track.
[00:02:23] And then you route the output of the key filter into this new track.
[00:02:27] And then you record all the right notes from the scale in this new clip.
[00:02:32] So it's a bit tedious.
[00:02:34] And you need the key filter, you need another instrument track, right?
[00:02:37] And you need to record everything, so it's a bit tedious.
[00:02:40] So my idea was why not get rid of this key filter here altogether and bring this functionality
[00:02:48] into the controller script.
[00:02:49] So you correct or have the functionality of the key filter inside of the controller
[00:02:54] script and then correct all the incoming notes from the MIDI keyboard before it hits
[00:02:58] the piano roll and before you record the notes.
[00:03:02] So you can record then the right notes that are in a scale into a note clip directly.
[00:03:09] Then when you hit play on this note clip, you play the right notes and send it out to your
[00:03:14] instrument.
[00:03:15] So this is the genius galaxy brain idea, right?
[00:03:23] And this kind of works, I mean that's the result of this.
[00:03:29] All you have to do is you select the scale, let's say major, D sharp major.
[00:03:35] And then you say key filter, yes please, okay?
[00:03:39] So if this is snow, I can play, yeah, what's this D sharp major, okay?
[00:03:47] I can play all the notes.
[00:03:55] No problem.
[00:03:56] And when I switched key filter on, so now I can't play all the notes, I can get certain
[00:04:02] keys here.
[00:04:03] This is your E. I'm playing basically this note.
[00:04:06] Alright, so I switch this off, I play E and when this is on, my script moves this input
[00:04:15] to F because F is in the scale of D sharp major.
[00:04:24] And there are some problems here, I already see, it cuts out some notes when you play
[00:04:37] the same note as it wants to move the wrong key to the right key, okay, I already found
[00:04:44] the bug, I need to fix this.
[00:04:47] So let's hit record here, right?
[00:04:56] So I'm playing basically wrong notes on the keyboard, but here I'm having the right keys
[00:05:01] for D sharp major.
[00:05:05] Let's go to mixalode in flat six, maybe, so you can see we have a lot of different scales
[00:05:13] in here.
[00:05:14] Just the key filter have major, minor, Dorian, Phrygian, Lydia, and so on, so only the popular
[00:05:22] ones, right?
[00:05:23] So with my script you have endless different scales here.
[00:05:29] So let's hit record here.
[00:05:36] Yeah, so you can record here basically different scales directly into the piano, it's not
[00:05:50] a big problem.
[00:05:51] So this is the idea behind it, and it kind of works neatly.
[00:05:56] The only problem I just discovered is that when you play a certain note, and then you
[00:06:08] play another note, and the script wants to move this note to the first note, it kind
[00:06:13] of cuts off.
[00:06:16] Yeah, but it's also not a big problem.
[00:06:36] You probably have to use here to steal the same key.
[00:06:42] Yeah, then it kind of works neatly.
[00:06:49] So yeah, maybe I implement the fix for this, but you can also just disable this here.
[00:06:53] And it also works with just normal ESG, it's piano tech, let's use this one, let's use
[00:07:01] a different mode here, Hungarian, minor, F, no idea.
[00:07:06] Oh, that's something, it wants to play the A there, okay.
[00:07:17] I'm actually playing G sharp here.
[00:07:24] Nice.
[00:07:32] So in my opinion, it's a bit better than the diatonic transposer.
[00:07:37] Because you have more modes, and we can also extend this here by a lot of different more
[00:07:42] modes, but I think it's already pretty dope that you have so many.
[00:07:47] And then you can directly record this to a note clip without actually having to create
[00:07:54] a different instrument track, and then record the output of the diatronic transposer.
[00:07:58] It's super tedious.
[00:08:00] So that's now in the script here, I put this update in the scripture below.
[00:08:06] I recommend download actually my zip file.
[00:08:10] A lot of people have problems with downloading JavaScript files directly.
[00:08:16] So just download the zip file, put it into your controller script folder, and you can
[00:08:21] find this under locations.
[00:08:24] My controller scripts and there's here directory.
[00:08:27] So put this please in this directory.
[00:08:29] This is the right one.
[00:08:31] And in here, you can maybe create a sub directory called maybe polarity, and then you unzip
[00:08:37] my file into this directory.
[00:08:40] Then you can go to controllers here, and let's disable this here for a moment, you go to
[00:08:48] add controller, you select your polarity, then you say retrospect, and then hit add.
[00:08:56] Then you need to select your MIDI input, which is probably your controller.
[00:09:01] And then it goes live.
[00:09:03] It's on.
[00:09:04] Then you have here this kind of icon in the top right, I said, I said, we can't change
[00:09:09] here the icon.
[00:09:10] Maybe they change this in the future that you can use, you know, your own customized icons.
[00:09:16] But at the moment, it's just the same icon.
[00:09:20] And then you have to see and you can select everything, right?
[00:09:24] It also saves all these settings here with the project.
[00:09:27] So when you dial in here, Hungarian minor, the sharp, and then you save the project and
[00:09:32] you open up the project, it's you have the same selection here.
[00:09:36] So it's saved also or persisted with the project, which is kind of cool.
[00:09:41] Yeah, that's kind of it.
[00:09:43] If you have some problems or if you run into problems, let me know in the comments down
[00:09:46] below or maybe join my discord, ask me questions.
[00:09:50] If you have some future requests, also let me know.
[00:09:53] I'm open for everything.
[00:09:55] I just have not enough time, basically, sometimes, but I try to implement the best ideas.
[00:10:02] Of course, subscribe to the channel or maybe subscribe to my Patreon.
[00:10:07] I still have a Patreon wants to support me.
[00:10:10] Okay.
[00:10:11] Thanks for watching.
[00:10:12] See you in the next video and have some fun with this.
[00:10:15] Bye.