Showing posts with label spectral. Show all posts
Showing posts with label spectral. 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!