# The Multi-band Junction, a Free Max For Live Device for Ableton Live 10

The Multi-band Junction is a Linkwitz Riley Multi-output Crossover free Max For Live Device built for Ableton Live 10. One of the great new features in Live 10 is the ability to have multiple audio I/O within Max For Live devices. In other words, Max for Live devices now support multiple audio inputs and outputs, which can be accessed via the track’s Input and Output Channel choosers. Devices can also be routed to arbitrary tracks via the Live API. This opens up a world of possibilities for multi-channel processing and mixing. One possibility is to use Gen to build an audio crossover via a Linkwitz Riley filter network, then route each audio band to a separate audio track for further processing. In this blog post we will explore how the new L10 M4L multiple audio I/O was used in the Multi-band Junction, a cool tool that offers unique sound design possibilities.

## What Can The Multi-band Junction Do

The Multi-band Junction is a stereo FX that allows us to split an incoming audio signal into three bands, route these bands to separate tracks and then process these tracks in weird and wonderful ways. The video above showcases some of the devices sound design possibilities. Many more exist!

## Gimmie!

The Multi-band Junction is a free Max For Live device. Simply gran it from our shop here.

## System Requirements

In order to use the Multi-band Junction a copy of **Ableton Live 10 is needed. **As the device is a Max for Live Device, Ableton Live Suite or Live Standard with the Max For Live extension is needed, on Macintosh and PC. The Multi-band Junction **will not work in Live 9**. L10 has just been released! Visit Ableton for more info.

## How Does The Multi-band Junction Work?

The Multi-band Junction uses the standard M4L plugin~ object to bring audio into the device. The signal is then patched into a series of Gen~ objects which provide the audio crossover (more on that later). As the crossover is a filter, we need to calculate the filter’s coefficients for each band (i.e. low, mid and high) whenever the filter’s cutoff frequency is changed. We use the filtergraph~ object to generate our coefficients for each band, which we then patch them into our Gen~ filters. As the Multi-band Junction is a stereo device we need filters for both the left channel and the right channel.

Figure 1: A Cascaded Series Of Gen~ Filters Here the left channel input signal is routed into a cascade of Gen filters whilst the filtergraph~ object calculates the coefficients for each band

## Plugout~

Here’s where the magic lies. We patch the outputs of each of the filter bands into discrete inputs of the plugout~ object. In L10 we can add arguments to the plugout~ object. These arguments allow us to route the audio to separate audio tracks in our Live project, via the track’s Input Channel choosers. In the Multi-band Junction, we use channels 1 & 2 for the dry source signal, outputs 3 & 4 for the low band left and right channels, outputs 5 & 6 for the mid band left and right channels and outputs 7 & 8 for the high band left and right channels. The device also features a series of customizable scopes that allow us to visualize the frequency spectrum of our signals.

Figure 2: Using The Plugout~ Objects Arguments Here our plugout~ object uses the arguments ‘1 2 3 4 5 6 7 8’ to route to separate audio tracks in our Live project, via the track’s Input Channel choosers

## Routing In Live

The next step is easy. The Multi-band Junction uses the Live API for quick and easy audio routing. Make sure you have the track the Multi-band Junction is inserted on selected, then simply click the ‘Create Tracks’ button. The device will create three audio tracks for you adjacent to the track the device is inserted on, name them appropriately and mute the source track. Next, click the ‘Route Tracks’ button and the device will setup all required audio routing and monitoring for you. This process sets each of the three audio track’s Input Type chooser to our ‘Source’ track, alongside routing each track’s Input Channel chooser to our corresponding output from the Multi-band Junction : 3/4 for the low band, 5/6 for the mid band and 7/8 for the high band. Simply set the filter’s cutoff frequency to taste.

Figure 3: Audio Routing Within L10 Here we have four audio tracks. Track one is for the dry source. Track two is for the low band, track three for the mid band and track four is for the high band. The audio for each band has been routed into our Live project via each track’s Input Channel choosers

## Processing In Live

Now your free to explore weird and wonderful multi-band processing. Now we have the audio signal split into three discrete bands we can perform processing on each band separately to create unique and interesting sound design elements. Mix the balance and the fader position of each track to taste and don’t forget to explore sweeping the filter’s cutoff frequency. Below are a few examples of what can be done.

Figure 4: Low Band Processing Here we have a Dark Hall Reverb device set to 100% wet on the low band channel. Reverb on bass was a technique utilised to great effect by Dub pioneer King Tubby

Figure 5: Mid Band Processing Here we have a Flanger device with a high feedback amount on the mid band channel. This gives a classic psychedelic effect to only our mid range frequencies

Figure 6: High Band Processing Here we have a Saturator device with a digital clip on the high band channel. This gives a harsh and aggressive character to our high band frequencies

## Under The Analogue Hood – Nerd Time

Our device works via a custom Linkwitz Riley filter network built in Gen. Linkwitz Riley filter’s are commonly used in the analogue audio domain to provide speaker crossovers. Defined by Siegfried Linkwitz and Russ Riley in an 1976 Audio Engineering Society paper entitled ‘Active Crossover Networks for Noncoincident Drivers‘, the filter network is also known as a ‘Butterworth squared’ filter. The most common topology of filter in the analogue audio domain (i.e. analogue EQ on a mixing console) is a second order (i.e. two pole) Butterworth, an infinite impulse response design constructed by British engineer Stephen Butterworth in his 1930’s paper entitled ‘On the Theory of Filter Amplifiers‘. Butterworth filters are generally considered to be a best compromise between attenuation and phase response (Zumbahlen 2008). They exhibit no ripple in the pass Phenq band or stop band, so they are considered ‘optimal in the sense of having a maximally flat amplitude response’ (Smith 2007). For this reason they are sometimes referred to as a maximally flat filter. They achieve their flatness at the expense of a wide transition region from pass band to stop band and they exhibit average transient characteristics.

Figure 7: Filter Topology Comparison

Filter type passband, stopband, and transition region comparison (Courtesy of Maxim Integrated Products, Inc.)

A Linkwitz Riley crossover is designed by cascading two Butterworth filters (a low-pass and a high-pass)together. When summing the low-pass and high-pass outputs the crossover behaves like an all-pass filter, having a flat amplitude response with a smoothly changing phase response. Fourth-order Linkwitz–Riley crossovers (LR4) are probably today’s most commonly used type of audio crossover. They are constructed by cascading two second-order (or two pole) Butterworth filters. Their slope is 24 dB/octave (80 dB/decade). The phase difference amounts to 360°, i.e. the two speaker drivers appear in phase, albeit with a full period time delay for the low-pass section.

## Under The Digital Hood – More Nerd Time

Typically, the design of Linear Time-Invariant discrete time domain (i.e. digital) filters involves the design of equivalent linear time invariant continuous time domain (i.e. analogue) filters. The analogue representation of the desired filter is then transformed into the discrete time domain via the use of the Bilinear Transform (i.e. the bilinear transform permits transformation from continuous time systems into discrete-time systems). However, this is mathematically complex so we will cheat. Instead we can approximate a second-order Butterworth filter in the digital domain via constructing a second-order Biquad filter. We can then cascade two of these together to get a fourth-order Biquad filter. Paying attention to how our of filter response’s (i.e. lowpass, highpass etc) are configured we will be able to approximate a fourth-order Linkwitz–Riley crossover (LR4). Just for fun we will add a third filter (i.e. bandpass) to allow us to have a three-way crossover.

A digital biquad filter is a second-order Infinite Impulse Response filter, containing two poles and two zeros. ‘Biquad’ is an abbreviation of ‘bi-quadratic’, which refers to the fact that in the Z-Domain, its transfer function is the ratio of two quadratic functions. The most straightforward implementation is the Direct Form 1. This can be easily realized in a signal flow graph (see figure 8) and translated into a difference equation (see figure 9). Applying the Z-Transform to the difference equation we can obtain the all important Transfer Function of our filter (see figure 10), defining what the filters Frequency Response will be. Difference equations are often used as the recipe for numerical implementation in software, and they are easy to implement via code into an algorithm.

Figure 8: Signal Flow Graph of Biquad Filter In Direct Form 1 Notice the feedforward coefficients , , and the feedback coefficients and . The feedfoward coefficients and represent the two-zero section and the feedback coefficients and represent the two-pole section

In the above signal flow graph, we can see the discrete-time operator has been used. Also known as the Unit Delay, this operator delays its input by the specified sample period – in our case each time it runs through the operator the signal is delayed by one sample. This means that digital filters are a sum of scaled (weighted) and shifted (delayed) impulses. A weird and wonderful conclusion can be formed – digital filters are based on delays!

Figure 9: The Difference Equation Of A Generic Second-Order Linear Time-Invariant Infinite Impulse Response Filter A second-order IIR biquad filter can be implemented in Direct Form 1 via the above difference equation, where is the input sequence, is the output sequence and , ,, , are the filter’s coefficients. Note that often the position of and in the equation are swapped, depending on the author. Within Max, Cycling 74 swap their position. For reasons of clarity we will follow the version defined above, as that is the order used in the DSP literature in our References section

The z-1 discrete-time operator has such an important role in digital filtering it crops up in our difference equations. Above, the term b1x[n-1] is the coefficient that has been delayed by one sample and is represented in figure 7 in the middle left of the signal flow graph. The term b2x[n-1] is the coefficient that has been delayed by two samples (i.e. z-2), represented in figure 7 in the bottom left of the signal flow graph. Its clear that the terms a1y[n-1] and a2y[n-2] are also represented in the signal flow graph.

Figure 10: Z-Domain H[z] Transfer Function Of A Second-Order Biquad Filter Our Transfer Function is the ratio of output transform over input transform. A biquad filter is a second-order IIR filter, containing two poles and two zeros. ‘Biquad’ is an abbreviation of ‘bi-quadratic’, which refers to the fact that in the Z-Domain, its transfer function is the ratio of two quadratic functions. Here the coefficients are normalized such that a0=1

In our Transfer Function above, we can see our terms (i.e. b1x[n-1]) are transformed via the Unit Delay (i.e. b1z-1). These represent our scaled (weighted) and shifted (delayed) impulses.

So what does all this mean? Well, now we know the difference equation its easy to build our filters in Gen.

## Getting Busy With Gen

Gen is awesome. Gen refers to a technology in Max that represents a new approach to the relationship between patcher’s and code, specialized for specific domains such as audio (MSP). A Gen object compiles the patcher into a language called GenExpr. GenExpr bridges the patcher and code worlds with a common representation, which a Gen object turns into target code necessary to perform its calculations. Its super easy to make filter designs using single-sample feedback loops with Gen. As we previously stated, each filter band in the Multi-band Junction is a cascade of two second-order Biquad filters, forming a fourth-order Linkwitz Riley crossover (see figure 11).

Figure 11: Cascaded Second-order Biquads filter to construct a Fourth-order Linkwitz Riley Crossover Here the audio signal for each band is run through a second-order Biquad filter built in Gen, then routed through another second-order Biquad filter to construct as fourth-order Linkwitz Riley crossover. Each filter band in the cascade shares the same coefficients

## Zen Via Gen

Our second-order biquad filter is built in Gen directly from its difference equation:

Inside our .gendsp patch we can see the feedforward coefficients are built using a series of history, multiplication and addition operators:

Figure 12: Second-order Biquad feedforward coefficients in Gen Here the calculate the feedforward coefficients of our second-order Biquad difference equation. The audio signal enters the Gen patch via the ‘in 1’ object at the top of the patch. The Gen History object is our Unit Delay operator. The input signal is tapped off into a series of History objects to create our scaled (weighted by multiplication) and shifted (delayed by one or two samples) impulses. The b1 coefficient has a Unit Delay of z-1 so its signal path travels through one History object. The b2 coefficient has a Unit Delay of z-2 so its signal path travels through two History objects. They are then multiplied by the coefficients brought into the patch via the ‘in 3’ and ‘in 4’ objects. As the b0 coefficient does not need a Unit Delay, the input signal is simply multiplied by the coefficient brought into the patch via ‘in 2’. When we add the result of these operations we end up with a calculation that represents all the b coefficients in our difference equation (i.e. the left hand terms)

In a similar manner, inside our .gendsp patch we can see the feedback coefficients are built using a series of history, multiplication and addition operators. The final result is calculated via a subtraction operator and routed out of our .gendsp patch:

Figure 13: Second-order Biquad feedback coefficients in Gen

Here we calculate the feedback coefficients of our second-order Biquad difference equation. We subtract the result of the b term calculation (see figure 12) from the operation that calculates our a terms. As the a terms are constructed via a feedback loop, the signal that feeds their inputs is routed directly from the subtraction operator. The a2 coefficient has a Unit Delay of z-2 so its signal path travels through one History object. The coefficient has a Unit Delay of so its signal path travels through two History objects. They are then multiplied by the coefficients brought into the patch via the ‘in 5’ and ‘in 6’ objects. When we add the result of these operations we end up with a calculation that represents all the coefficients in our difference equation (i.e. the right hand terms). We then simply subtract the a terms from the b terms and route the audio signal out of the Gen patch via the ‘out 1’ object at the bottom of the patch. This represents our final filtered audio signal

## What next?

So now you have a better idea how to build second-order Biquad filters in Gen, alongside a better understanding about how the Multi-band Junction device works. If you want to know more about filter design and audio DSP then I recommend checking out the excellent books listed in the References below. Don’t forget – the Multi-band Junction is a free Max For Live device. Simply grab it here. In order to use the Multi-band Junction a copy of **Ableton Live 10 is needed**. The Multi-band Junction **will not work in Live 9**. Until next time, happy wiggling.

## References

Mitra, Sanjit, K. (2011) Digital Signal Processing: A Computer- Based Approach. New York: McGraw-Hill

Mulgrew, B. & Grant, P. & Thompson, J. (2003) Digital Signal Processing: Concepts and Applications. 2nd Ed, New York: Palgrave McMillian

Oppenheim, V, A. & Schafer, W, R. (2010) Discrete-Time Processing. 3rd Ed, Pearson.

Orfanidis, S, J. (1996) Introduction to Signal Processing. London: Prentice Hall

Siegfried Linkwitz; issues in crossover design: http://www.linkwitzlab.com/crossovers.htm

Smith III, J. (2007) Introduction to Digital Filters. W3K Publishing

Smith III, J. (2007) Mathematics of the Discrete Fourier Transform. W3K Publishing

Smith III, J. (2011) Spectral Audio Signal Processing. W3K Publishing

Smith III, J. (2010) Physical Audio Signal Processing For Virtual Musical Instruments and Digital Audio Effects. W3K Publishing

Zumbahlen, H. (2008) Butterworth Filter Design: Linear Circuit Design Handbook, ch. 8. Newnes