Showing posts with label Auto-Pan. Show all posts
Showing posts with label Auto-Pan. Show all posts

Saturday, 8 June 2019

Spectral Hex Ping Pong Delay in MaxForLive for Ableton Live

After playing around with various Ping Pong Delay-like devices for a while, I realised that my 'Hex' template was a good place for experimenting with multiple delays, so I took the internals of the AUDpiPOde device and put it inside the 'hex' device template (six times). The result is AUDhexPPD, where I'm abbreviating ping pong delay to PPD to save characters.

AUDhexPPD


Because AUDhexPPD is another 'wide' device, then here's just the left hand side:


Going across the left to right, the input indicator shows the incoming audio signal (and yes, this does duplicate the tiny meters in-between devices), then the Ping Pong Delay block, with the 'Note value time delay' button grid, followed by the 'Unsync' time tweaker, the 'LR swap' output channel allocator, the 'f' delay freeze button, and the Feedback rotary control (which is individual to each PPD block).

The next block across to the right is the middle block: the three-band 'spectral' filtering, which just gives three outputs via low-pass, high-pass and band-pass filters. Unlike the usual 'crossover' filters that you get in some 'spectral' devices (or loudspeakers, now that I think about it), these filters have a Resonance rotary control, which gives the device the ability to colour the sound, so maybe it is more than just six delays.

Finally, on the right hand side, there is the 'Auto-pan' block, which has an individual meter per audio processing block, the 'X' Active/Muted switch (as per all of the 'hex' devices, and a few others of mine), the new 'Pan Position and LFO Modulation' UI widget that I introduced recently (move the white 'thumb' down and horizontal for pan position, and up for LFO modulation), and finally the LFO Rate rotary control, which goes from very slow to not very quick, but then it is a modulation control and audio rate modulation of pan position is not something I'm a great fan of...

On the far right-hand side, there are the usual memory buttons (Click to recall, Shift-click to save (red when empty, grey when filled)) and the Dry/Wet rotary control, followed by three 'common' controls which affect all of the six audio processing blocks: Feedback, Resonance, and Freeze. These just make it easier to alter all of the six audio processing blocks at once!


As usual in the 'hex' devices, the right hand half of the front panel is mirrored, which looks interesting, and makes it very clear that this is a stereo device. Just repeating things twice can make it look like they are arranged in series... There isn't a perfect solution for this, but this way works for me, and it isn't too hard to flip one half if you need an unmirrored custom device...

MaxForLive

So, what's interesting in the M4L code for this device? As I have mentioned previously, I prefer stereo in and out for my devices, and this is normally done with pairs of mono in and mono out devices where the output can be panned across the stereo image... However, each of the 6 audio processing blocks in AUDhexPPD is a tapped delay with a mono input and stereo outputs, and so instead of having one output that needed to be panned, then I had two - and for a ping pong delay then these two outputs should be in the Left and Right channels (or vice-versa - which is what the 'LR Swap' button does). But with two outputs then I needed two auto-pans, and so the obvious answer was to have two auto-pans in anti-phase, so that when one output was on the Left, then the other would be on the Right. 'Dual anti-phase auto-panning' isn't a very catchy description, so I'm going to call it 'Helicopter' mode, because the two pans circle around each other rather like the blades on a helicopter...


Yes, I could have changed the balance between control values and audio signals in this - so the 'snapshot~' and 'sig~'could have been removed from the panning part, but then I would have had to add them back in to the LFO Depth and LFO Out to get control values. This way works for me...

Alternatively, I could have had two SEPARATE auto-pans for each of the two outputs: one LFO for Left, and another LFO for Right. This would have required a doubling of all of the controls in the centre 'panning' block, and would have made the device even wider! (and more complex to use) I decided to go for the simpler solution and leave the 12 pan LFO version for another time (Maybe in an 'mc' version as a way to explore this new feature of Max 8!)

The Max code just inverts the (0 to 1) control value for the multipliers so that the two inputs are affected in opposite ways. Remember that the audio inputs are called 'L' and 'R' because this is the convention for ping pong delays - the first echo comes from the Left channel, then the next from the Right channel. These are not the main incoming audio channels to the whole device - each audio processing block has a mono input and two 'stereo' outputs. So, for each audio processing block, the two inputs are coming from a tapped delay, and so these input signal will be 'bouncing' back and forth between those inputs, and this auto-panning then adds additional pan control on top of that. If you stop the LFO and fix the pan position to Left or Right, then the result is ordinary ping pong echo - where the repeats 'bounce' between Left and Right.

Note that this is the auto-pan arrangement for just one of the six parts in the Pan block. So if you have just one 'X' highlighted and the rest muted, then that ping pong delay will bounce between the Left and Right output channels, panned according to the pan position and LFO modulation as set in that block. If you have two 'X's highlighted (one in the Left half, and one in the Right half), then you have two ping pong delay in parallel - and so the outputs can bounce between the Left and Right outputs independently. If you have all six blocks active, and use the 'triangle' tweak controls to 'unsync' the time delays, then you start to move away from 'echo' and towards 'reverb'-type sounds. The more asynchronous echoes you have, then the more 'reverb'-like the result will be - which, of course, is exactly how real reverb is produced: lots of echoes with different delay times. You 'could' put several 'AUDhexPPD' devices in series, but it is probably going to take a lot of adjusting to get something even approximately like a conventional reverb sound...

Getting AUDhexPPD

You can get AUDhexPPD on http://www.maxforlive.com/library/device/5522/audhexppd

Here are the instructions for what to do with the .amxd file that you download from MaxforLive.com:

     https://synthesizerwriter.blogspot.co.uk/2017/12/where-do-i-put-downloaded-amxd.html

(In Live 10, you can also just double-click on the .amxd file, but this puts the device in the same folder as all of the factory devices...)

Oh, yes, and sometimes last-minute fixes do get added, which is why sometimes the blog post is behind the version number of MaxForLive.com...

RAM and CPU in Live

This MaxForLive device has six tapped delays, so it will use lots of RAM storage and CPU power - but it is worth it, IMHO!

Effects Rack Equivalent in Live

I haven't tried it, but it ought to be possible to get quite a lot of the functionality of AUDhexPPD with an Effects Rack in Ableton Live, although the UI is not going to be as compact, and it might even be possible to implement the spectral crossovers using the band-pass filters inside Delay (or Ping Pong Delay if you aren't using Live 10.1).


What is interesting is that the limitations of building AUDhexPPD inside Live result in something which is a nice, usable effect, but it isn't the same as the MaxForLive version. Anyway, it was a good exercise in translation, and I'm making it available for free. You can download it from here...

Modular Equivalents

In terms of basic modular equivalents, then AUDhexPPD would require two high-pass filters, two low-pass filters, two band-pass filters, six tapped time delays, six LFOs, six panner, some utility switches, and two mixers, giving a total of about 24 ME. It is interesting that this is also a 'wide' device in MaxForLive!







Friday, 31 May 2019

Spectral chorus - another 'Hex' MaxForLive device

For a long time, I have been trying to find a good way to provide an intuitive user interface for 'Modulated Pan Position'. You can see me experiment with various ways to implement it in many of my MaxForLive devices - what I have always needed is a simple/obvious way of allowing control over pan position, but also allowing that pan position to be modulated by an LFO.

The 'traditional' way of doing this (and I have used it a lot: albeit unwillingly...) is to have a pan position (a slider is nice and intuitive) plus an LFO 'modulation depth' rotary control. That's two controls, and there is an implicit interaction between them where the LFO over-drives the panning so that the position goes to left or right and stays there, then suddenly pans across - it's because the LFO waveform (typically a sine wave) is over-driving the pan position, and the clipping of the waveform gives 'flat' spots in the auto-panning (Yuk!).


This is why, in AUDhexCHORUS, I'm introducing something that I have been working on for quite a while: a single UI widget that does pan position AND modulation depth combined together.


Here's the UI widget" The components are:

1. a 'thumb' (the bright white vertical bar) that you click with the mouse to control the setting of pan position and LFO modulation.
2. an LFO indicator (the big purple block) that shows the current pan position. (When the LFO modulation is active (as it is here) then this slides horizontally from left to right to show where the audio is in the stereo image.
3. two numbers that show the horizontal and vertical position of the 'thumb'. (These cn be used as mapping targets for other M4L devices)

The UI metaphor is very straight-forward: horizontal is pan position (Left is left, Right is right!), whilst up and down controls the depth of LFO modulation - and there's a triangle graphic that shows you where you need to position the 'thumb' to avoid over-modulation of the pan position. The 'thumb' that you click on is a vertical bright white bar, so when you move it horizontally it looks like a pan position slider, but when you move it upwards, then the LFO modulation is gradually increased, and if you move it all the way to the top of the triangle, then you get perfect side-to-side pan LFO modulation, with no 'hold' at either side. It makes using pan position/modulation SO much easier!


Here's a GIF that shows the UI widget in three modes.

The top example shows the 'thumb' in the 'sweet spot' position at the top of the triangle where the LOF modulation is maximised without clipping. Here the LFO modulation (the purple block) will move the pan position from hard Left to hard Right, without any major pausing at the Left or Right positions. If you move the 'thumb' to the left or the right away from the top of the triangle, then the LFO will spend time at that side (The waveform will be clipped), and may not go all the way across to the opposite direction. (The animated GIF has jerks in the way that the purple block moves - this is because of the looping in the GIF - in the actual device the purple block moves smoothly from sid to side, indicating the LFO-controlled pan position.)

The middle example shows the 'thumb' right in the centre, and so the pan position is only slightly modulated by the LFO.

The lower example shows the 'thumb' in the 'down' position, and this completely removes any LFO modulation, so horizontal movements of the 'thumb' just control the (fixed) pan position. The two numbers underneath the UI widget are the horizontal and vertical positions, and can be used as a target for mapping by LFOs and other M4L devices that use controller mapping. in this case, the 'thumb' is all the way to the left, and so the audio will be panned hard to the Left of the stereo image.

AUDhexCHORUS 

To accompany a neat pan UI widget, there's a neat device: AUDhexCHORUS (AhC for short, to save my fingers as I type!) There are lots of chorus devices out there, but this one has a few 'specials' that make it more interesting...

1. The 'Pan Position/Modulation Widget! (Of course!)

2. Spectral controls, as per some of the previous 'Hex' devices. You have three spectral 'bands' to play with, so you can have different chorus amounts/styles wherever you want across the frequency spectrum, and you can have different bands for the Left and Right stereo channels if you want.

3. Envelope tracking makes the chorus depth tracks the amplitude of the incoming signal... This is particularly good for dynamic sounds...

The actual chorus effect is achieved by using frequency shifting (Via ring modulation (which just multiplies two audio signals together) and can also be called a four-quadrant multiplier or a balanced modulator.) instead of using a modulated delay line. A future version might allow switching between the two methods - let me know if you would like this.

AUDhexCHORUS is a 'wide' device (It uses lots of screen 'real estate' in Ableton Live, so be prepared for some horizontal scrolling) - I'm not known for making 'one-rotary-control' devices!

In detail


AUDhexCHORUS is symmetrical, so both halves of the user interface are mirrored. Let's look at the left hand side - which covers the Left channel. Vertically, there are three similar rows of controls (one for each spectral band), and horizontally there are three similar processing blocks. Going across the blocks from left to right there are:

- The Frequency Shift block, which contains:
-- the frequency shift rotary controls,
-the envelope amount rotary controls (which increase the amount of frequency shift depending on the envelope of the incoming audio),
-- the vertical envelope depth indicator,
-- the smoothing rotary control (which smoothes the envelope control),
-- the 'sideband select' buttons (which select positive frequency shifts, negative or both),

- The Spectral Filter block, which contains:
-- the frequency rotary controls (high-pass in the upper row, band-pass in the centre row, and low-pass in the lower row),
-- the resonance rotary control (higher values get more 'peaky')
-- the 'Broad/Narrow' switches, which controls the number of filter sections that are used,

The Auto-Panning block, which contains:
-- the row output/mute switches (output when the 'X' is light, muted when the 'X' is dark),
-- the UI Widget for the pan position and LFO modulation, as described above,
-- the LFO rate rotary control (which is almost stopped at the slowest speed!).

On the far right hand side, common to both channels, then there is a Dry/Wet mix rotary control, as well as memory buttons which can be used to ave your favourite settings. Just shift-click on a red square to save (or a grey square to over-write), and click on a grey square to recall that memory setting.

Getting AUDhexCHORUS

You can get AUDhexCHORUS on http://www.maxforlive.com/library/device/5500/audhexchorus

Here are the instructions for what to do with the .amxd file that you download from MaxforLive.com:

     https://synthesizerwriter.blogspot.co.uk/2017/12/where-do-i-put-downloaded-amxd.html

(In Live 10, you can also just double-click on the .amxd file, but this puts the device in the same folder as all of the factory devices...)

Oh, yes, and sometimes last-minute fixes do get added, which is why sometimes the blog post is behind the version number of MaxForLive.com...

Modular Equivalents

In terms of basic modular equivalents, then AUDhexCHORUS would require two high-pass filters, two low-pass filters, two band-pass filters, six frequency shifters, six LFOs, six panners, some utility switches, and two mixers, giving a total of about 28 ME. It is interesting that this is also a 'wide' device in MaxForLive!




Monday, 15 April 2019

Spectral auto-panning in MaxForLive for Ableton Live

My two recent MaxForLive audio devices have both been based around having 6 processing sections - hence the 'hex' in their names. But I realised that there was a much simpler device that uses the hex pan section, which could be used in many ways, and this blog post is devoted to it: a hex spatializer!

AUDhexSPATIAL 


AUDhexSPATIAL moves parts of sounds around in the stereo field. That's all. It is quite straightforward, but don't let that fool you into thinking that you can't do much with it.

The input audio is passed through three parallel filters, and then the outputs are auto-panned across the stereo image. The three filters can be used in several ways, but the most obvious way is to use them to split the audio into three separate bands: The high-pass filter outputs the high frequencies, the low-pass filter outputs the low frequencies, and the band-pass filter outputs the middle frequencies.

Each filter output can be panned to hard left or hard right, or can be Auto-panned - controlled by a three position switch: L/Auto/R. But the frequencies of each filter are independent, so there's nothing to stop you putting the high-pass filter below the low-pass, or the band-pass anywhere from low to high.

The filters are there just to provide different blocks of frequencies to the output section where the panning happens. And the three [X] toggle switches allow you to turn the outputs on and off, so if you want to have just the high-pass filter output, then just enable that toggle switch and turn off the others. The two stereo channels are separate, so if you want different filters and pans for left and right, then that is completely possible.

Naming

After a lot of agonising, I have finally decided to use a new and consistent naming scheme for my M4L plug-ins. From now onwards, and if I update anything, then I will strive to use three prefixes:

- AUD for Audio processing devices (aka effects)
- MIDI for MIDI devices (this took ages to figure out!)
- GEN for devices that generate audio

Of course, in an imperfect world, I may not always succeed in trying to be consistent, but I will try. Please let me know if I falter!

Applications

OK, so your imagination is probably your main limitation here. If you want to have the left channel quickly auto-panning the top end of a piano sound, whilst the right channel slowly pans the bass around and both channels have two different resonant filters panning at different speeds, then that's fine.

But there's more. Try putting AUDhexSPATIAL in front of a Ping-Pong Echo, or put it in between two Ping-Pong Echoes... It is very interesting to experience just how complex a simple sequence can sound when it goes through this sort of processing.

Limitations

You can't adjust the panning width directly - adding two extra rotary controls would make the centre section way too big, I reckon. (But let me know if you really want this, and I might schedule a '+' version...) You get full left-to-right panning, or else hard left or hard right. Of course, you could make a rack and use the Utility object to restrict the pan width of multiple AUDhexSPATIALs...

There are only 3 filters and three panners per channel. Making a version with more channels is not in my current plans, and my main concern would be trying to find a way to fit everything into the user interface...

Oh, and the filters are not animated - they are fixed graphics! Sorry...

MaxForLive

Recent blog posts have included details of what is happening inside my M4L devices, and this is no exception. This time, I'm going to look at the three-position switch that has been added to the output section.

Max and MaxForLive have a lot of ways of routing numbers, messages and signals around. There are lots of objects, with names like Gate, Switch, Route, Selector, Matrix, and more. Sometimes the objects that route signals around have different names, and work slightly differently to the objects that route numbers or messages, and they can work slightly differently. It's quite a lot to get your head around, and one of these days, I'm going to try to do a guide (a bit like the one I did on squeezing controls into limited spaces!). But in the meantime, here's the first of a little mini-series where I look at a few interesting ways to route stuff.

The three-position switch does two things simultaneously: it allows you to select between hard left and hard right pan positions, or it selects the auto-pan. These are very different things, although if you look at AUDhexECHO or AUDhexFrequencyShifter then you will see that by slowing the LFO to 'stopped' then the result is fixed pan positions. But that isn't a very practical approach for a three position switch. There is also the complication that the output of the LFO that does the auto-panning is a signal (so it has the yellow-striped connections in Max), whilst the more usual way to control a panner is with numbers, so there's going to be a conversion somewhere.

First off, let's look at the context. Here's the relevant part of the Max code for the audio output of  AUDhexSPATIAL:


And here's the 'pan_mr' object expanded out (this is a cheat to make things clear - in reality, you don't see the controls that are connected to the input ports, but I have removed the ports and added the rotary control and the 3-position switch control to make it obvious how things are connected):


The main audio processing is on the left hand side. Input port 1 (the square box with '1' in it) is the audio signal that is going to be 'panned'. It goes to two signal multipliers (notice the '~' after the '*') that are driven in anti-phase using the '!- 1.' inverter shorthand that I've mentioned before. (The formula inside the object just subtracts whatever you feed into the object from 1, so it really means '1-the_number', and so it inverts the value, so if you put 0 in then you get 1 out, and if you put 1 in, then you get 0 out, and linearly for all other values...). The pan value goes from 0 to 1 to pan from left to right, and so centre is a value of 0.5.

On the far right hand side, you can see how the left and right values re stored in message boxes that are triggered every time that the switch is changed. The 'LED" object with the round circle is a useful way to convert changes into 'bangs' that also shows you what is happening when you are debugging. The '0' and '1' messages that the message boxes output when they receive a bang are converted into signals using the 'sig~' objects.    

In the middle, starting from the rotary control, there is a 'cycle~' object that does the sine-wave LFO function, followed by a bit of maths to get the output into the 0<->1 range that is required by the multipliers that do the panning. The 'scaled and offset' sine-wave is then connected to the middle input of a 'selector~' object, which is a special switch for routing signals. The other two inputs are from the signals from the message boxes. So the selector switch can output:
- a signal representing 'left'
- a signal that is an LFO sine-wave
- a signal representing 'right'


And that's how you can make a three-position switch that has fixed values on two of the settings, and an LFO signal on the other.

Getting AUDhexSPATIAL

You can download AUDhexSPATIAL for free from MaxForLive.com.

Here are the instructions for what to do with the .amxd file that you download from MaxforLive.com:

     https://synthesizerwriter.blogspot.co.uk/2017/12/where-do-i-put-downloaded-amxd.html

(In Live 10, you can also just double-click on the .amxd file, but this puts the device in the same folder as all of the factory devices...)

Oh, yes, and sometimes last-minute fixes do get added, which is why sometimes the blog post is behind the version number of MaxForLive.com...

Modular Equivalents

In terms of basic modular equivalents, then AUDhexSPATIAL requires six filters, six LFOs, six VCAs, and a mixer, plus some switching for the fixed pan positions, giving a total of about 20 ME.