Tags: posts bitwig-guides Bitwig Grid-Module Tutorial

Bitwig Zero-Crossings Module - Simple Pitch Detection

Bitwig Guide | Aug 30, 2022

The Zero Crossings module in Bitwig Studio's Grid is a simple pitch estimator that measures the distance between zero crossings of an audio waveform to determine pitch or frequency, working best with simple signals like sine waves. Filtering options, both inside the module and externally, help make complex signals easier to analyze for more accurate pitch detection. While not precise for complex audio, it is a handy tool for generating pitch signals from audio input, which can then be processed or quantized further within Bitwig.

You can watch the Video on Youtube

Short Overview

In this tutorial, I explain what zero crossings are and how the Zero Crossings module works inside Bitwig Studio's Grid. I show how it estimates pitch by measuring the distance between points where an audio signal crosses the zero line, using simple examples like a sine wave and more complex sources like live voice. I also demonstrate how filtering the signal can improve pitch detection and how you can use the resulting pitch information for creative modulation. This module is best suited for straightforward audio signals and provides a basic but useful way to extract pitch in your Grid patches.

Introduction: What Are Zero Crossings in Bitwig Studio’s Grid?

Recently, I was asked about the meaning of zero crossings in Bitwig Studio’s Grid. This spurred me to create a comprehensive tutorial on the topic, including what zero crossings are, how they work, and practical tips for using the Zero Crossings module to estimate pitch inside Bitwig’s Grid environment. In this summary, I break down both the technical details and the creative applications, making it accessible for anyone wanting to improve their workflow in Bitwig Studio.

Setting Up the Grid with the Zero Crossings Module

To demonstrate zero crossings, I started in Bitwig’s Poly Grid, where you can use modular components to build your own synths and effects. The focus is the Zero Crossings module, which is defined in Bitwig’s help menu as a “rough pitch estimator.” To clarify this, I set up a sine oscillator (a simple pure waveform) and routed its signal into both an oscilloscope and the Zero Crossings module.

Understanding Zero Crossings and Pitch Estimation

Every waveform oscillates above and below a central zero line. In the case of a sine wave, this movement is simple and periodic. A zero crossing happens every time the signal moves through the zero line, from negative to positive or vice versa.

How Zero Crossings Estimate Pitch

The key idea is that the distance between each zero crossing relates directly to the frequency, or pitch, of the signal. Higher pitches (higher frequencies) lead to more frequent zero crossings, which appear closer together. Lower pitches mean zero crossings are spaced farther apart. By measuring these distances, the Zero Crossings module can estimate the pitch of the incoming audio signal.

Using the Module: Step-by-Step Demonstration

  1. Simple Signal Example:

    • By routing a clean sine wave into the Zero Crossings module, the output is a reliable pitch estimation. Changing the oscillator’s pitch makes the zero crossings appear closer or farther apart, and the module’s pitch readout tracks this accurately.
  2. Pitch Output:

    • The module outputs a pitch value, typically displayed as a musical note (e.g., C3). When the pitch of the input oscillator changes, the Zero Crossings module updates its pitch output accordingly.

Complex Signals and Filtering

When analyzing more complex signals, like a human voice or sounds from environmental recordings, pitch detection becomes much harder. Complex waveforms often contain many frequencies at once, producing irregular or extra zero crossings which can confuse the estimator.

The Role of Filtering (High Cut and Low Cut)

To help the Zero Crossings module work better with complex signals, it includes high cut and low cut (high pass and low pass) filters:

These built-in filters can be supplemented by placing additional filter modules before the Zero Crossings module for even greater control and better tracking of the desired pitch.

Practical Example: Using Your Voice

As a practical demonstration, I routed my own voice through the Zero Crossings module to estimate its pitch. Due to the complexity of vocal sounds, the module struggled without additional filtering. By simulating extra high pass and low pass filtering in front of the oscilloscope, I was able to significantly simplify the signal, making the pitch tracking much more reliable.

Real-Time Pitch Tracking and Sound Manipulation

Once the Zero Crossings module provides a stable pitch CV (control voltage) signal, you can use it as a modulation source for other modules, such as:

Limitations of the Zero Crossings Module

It’s important to note that the Zero Crossings module:

Conclusion: When and Why to Use Zero Crossings

The Zero Crossings module in Bitwig’s Grid is a quick and resource-light way to generate useful pitch information from audio sources, enabling sound-following synths, pitch-tracked effects, or even live performance tricks. While not suitable for every scenario, its simplicity and integration with Bitwig’s modular system make it a valuable tool, especially when combined with thoughtful filtering and processing.

If you have any trouble or need ideas, experimenting with pre-filtering and creative routing often yields the best results. Feel free to share your experiences or ask more questions about using this module!

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] I recently got asked what the hell is zero crossings inside the grid of Bitwig Studio,
[00:00:06] so I thought maybe it's a good idea to make a tutorial about this and explain what actually
[00:00:12] zero crossing is doing in the grid. If you want to save some money on Bitwig Studio
[00:00:22] and the upgrade plans, and you want to support my channel and my content, then go to my web page,
[00:00:27] use the link to the Bitwig store, use my code and save 10% on the regular price.
[00:00:33] Okay, let's start. So to explain this, we need, of course, one pulley grid device.
[00:00:40] And inside the pulley grid, we need a module called zero crossings. That's what this video
[00:00:51] is about, right? So when we select this zero crossings module and press F1 in the small help menu,
[00:00:58] it says zero crossings pitch is a rough pitch estimator. So to explain this, what it does is
[00:01:04] the best example would be to use a sine oscillator here and an oscilloscope.
[00:01:13] And you can already see the waveform inside the oscilloscope from the sine wave. It's pretty clean.
[00:01:21] And at the bottom of the oscilloscope, we have the value of minus one. At the top,
[00:01:25] we have the value of plus one. And in the middle, we have the zero line.
[00:01:29] And you can maybe guess it. Every time the signal crosses the zero line here, we have a zero crossing.
[00:01:37] And you can see the distance between the zero crossings. And when I change the pitch of the
[00:01:45] oscillator here, you can see the zero crossings are now much, much closer together, right?
[00:01:54] And when I lower the pitch, the zero crossings are much further apart.
[00:02:01] This means if you measure the distance between the zero crossings, you get the pitch of the signal
[00:02:11] or the frequency of the signal, of the audio signal. And this is basically what the zero
[00:02:17] crossings module is trying to do. It tries to estimate the pitch by measuring the distance
[00:02:24] between the zero crossings of the signal. That's all there is to it. So when we basically
[00:02:32] just connect these two here, so the sine wave has now a pitch and it's outputting an audio signal.
[00:02:39] The audio signal is going into the zero crossings. The zero crossings module tries to estimate the
[00:02:44] pitch. And if we use a readout here, we can switch these two nodes. And you can see here,
[00:02:52] our node is basically C3. Maybe change here the pitch. You can see,
[00:02:57] yeah, it measures some kind of pitch here at the end.
[00:03:08] So when we change the pitch on the oscillator, the output also changes here the pitch,
[00:03:14] measure it, pitch information. So in this example, it's easy because we have a sine wave,
[00:03:24] which is the simplest and easiest to measure it in hardware input. And we select the microphone,
[00:03:43] you can see my voice is much, much complexer than the sine wave before. And now it gets
[00:03:52] complicated, at least for the zero crossings module, to measure the distance between zero
[00:03:58] crossings because there are a lot of different things happening. Sometimes there are not even
[00:04:04] zero crossings happening at all. Sometimes there are double zero crossings happening and so on.
[00:04:11] So a lot of complex things going on in the audio signal, right?
[00:04:17] Therefore, there are now these high cut and low cut knobs here. So you can simplify basically the
[00:04:25] signal before you measure the distance. And to show you how this looks like, I'm basically,
[00:04:33] yeah, simulating these two knobs in front of the oscilloscope here by using an high pass
[00:04:46] and a low pass, okay, six poles here. So these two knobs are basically doing the same thing as
[00:04:55] these two knobs here in the zero crossings module. But in this case here, you can see now in the
[00:05:01] oscilloscope that when I'm turning in here, the low pass that the signal becomes much, much simpler,
[00:05:07] right? All the high frequency noises and yeah, harsh sounds are basically cut out.
[00:05:14] And now it's much, much simpler to actually measure the signal. So when I'm using maybe a volume knob,
[00:05:23] so it can raise the signal a bit, so you can see it. The signal is much, much simpler, right?
[00:05:32] You can see all kinds of pitches happening here in the end. So even sometimes when you use the
[00:05:39] zero crossings module and you have a super complex signal and you try to measure the pitch of the
[00:05:45] signal, it's even recommended to use additionally also high pass and low pass in front of the
[00:05:55] zero crossings and the low cut and the high cut inside the zero crossings module. So you have
[00:06:00] basically two filtering sections in front of the measuring module. So you can make the signal even
[00:06:10] simpler then. So in this case now we have some kind of pitches here, maybe just remove this
[00:06:18] and use this to change the pitch of a sine oscillator. So in this case here, we're just
[00:06:27] disabling the pre-code so we can't change the signal by using our MIDI keyboard. So it's completely
[00:06:33] dependent on the input here, the pitch input. So we just connect these two and now the zero
[00:06:41] crossings module is estimating the pitch, giving out the pitch signal and it changes the pitch of
[00:06:47] the sine oscillator itself, right? And all we have to do now is to use a volume knob here.
[00:06:57] So we can change the volume and maybe an output so we can hear what's going on.
[00:07:01] The zero crossings module is trying to estimate the pitch and changes the pitch of the sine oscillator.
[00:07:18] Works pretty great actually. So you don't need to use your voice of course, you can use all kinds of
[00:07:25] audio signals, so it's up to you what you're trying to do with it, right?
[00:07:31] All you have to know is that the zero crossings module is basically a super simple pitch estimator.
[00:07:39] It's not for complex signals, it's not precise, but it works pretty well for low frequencies
[00:07:45] or simple signals, right? And therefore you have this filtering section to make all
[00:07:51] kinds of signals pretty simple. You can also use the filtering, as I did here,
[00:07:56] in front of the zero crossings module to make the signal even simpler. And then you get a nice
[00:08:02] simple pitch signal out of the zero crossings module. And because you get the pitch signal here,
[00:08:09] you can use all kinds of pitch modulators or pitch modules, for instance here the pitch quantize.
[00:08:17] So when you select all the keys of C major, you get of course a pitch signal
[00:08:24] in the scale of C major. So you can even use this to transpose all wrong notes to a certain scale.
[00:08:36] You can also use transpose here and maybe pitch scaler. So everything you want, basically you
[00:08:44] can apply to these pitch signals, okay? So it's a nice simple module. It's pretty handy and
[00:08:54] yeah, try it out and give me feedback if you have problems using this module.
[00:09:01] Finally, a new tutorial up on YouTube after all this time. So thanks for watching and please
[00:09:08] if you like, if you learned something or if you liked the video and subscribe to the channel,
[00:09:12] if you want to be informed about new live streaming events or a new video and maybe
[00:09:18] think about subscription over on Patreon, it helps a lot. Thanks for watching and I'll see you in the
[00:09:23] next video. Bye.
[00:09:25] [Music]
[00:09:30] [Music]
[00:09:41] [BLANK_AUDIO]