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!




Tuesday, 21 May 2019

Ping Pong Delay - Re-imagined differently! (Plus M4L Audio switches)

My first AUDpiPOde (Ping Pong Delay) M4L device had some protracted problems, and hopefully the additional tweaks for version 0.04 should fix them. But in the course of learning more about how the original (and soon to be deprecated) Ableton Live Ping Pong Delay actually worked, I realised that I had re-imagined it along the wrong vector, and that my 'all stereo' approach had too many differences to the original. The band-pass filter also proved to be a significant challenge, and dropping it again restricted the flexibility. (...Now, I'm not the greatest fan of 'muddy' echoes, but they are a defining characteristic of some vintage tape echo units...)


So, here's almost the opposite of AUDpiPOde - it uses a tapped delay line, mixes the channels into a mono signal for the echoes, and puts back the 'far-from-perfect' band-pass filter emulation made up from a high-pass and low-pass filter (and I need to learn more about filters in Max!). It uses a different 'freeze' method (as well as the ones I added), and it provides a 'Thru' button to bypass the filters. I also tweaked the delay routing so that you can have 'Echo in the Left channel first, then the Right channel' or 'Right channel first, then the Left channel' - which is quite striking if you are used to the 'feel' of the original!

And the name? AUDpiPOde-A, of course!

Making audio switches

One of the traps for people who are trying to learn Max are the large variety of switches. There are simple switches, complex matrix switches, routers and the names are sometimes different if audio is being switched. I'm still gathering information for a guide, but in the meantime, here's what I've been doing to build custom audio switches...

LR 'Left first' 'crossover' toggle switch

The 'Echo in the Left channel first, then the Right channel' or 'Right channel first, then the Left channel' switch functionality is a good example. All that needs to happen is that the two outputs from the delay (the middle tap and the end) need to be routed to the Left and Right channels, in the two possible combinations.


This is the output stages of the AUDdiPOde 'Ping Pong Delay' device, with, from top downwards, the feedback rotary control, the 'LR' echo order control, and the Dry/Wet rotary control. For the Feedback control, you can see how the line~ object is fed with pairs of '<new value> 50ms' values for each new line segment, so that the multiplier that does the feedback only gets values that change reliably slowly (each new value takes 50ms to happen) and so the amplitude of the feedback signal doesn't jump suddenly.

Just below the feedback code, the 'LR' box is where the interesting switching takes place. The 'p cross_mr' object has two stereo inputs (from the tap and the final output of the tapped delay line) and two stereo outputs (which go to the Dry/Wet' balance control library object. The 'LR' toggle switch controls the 'p cross_mr' object, and all it does is change between the default 'Left In to Left Out, Right In to Right Out' switch setting to the alternate 'Left In to Right Out, Right In to Left Out' which reverses the channel ordering. So in the default 'Left first' position, the 'LR' switch controls the 'p cross_mr' object so that the tap output of the delay line goes to the Left In of the 'cross' switch and comes out of the Left Out, which means that the tap output is heard in the Left channel first, whilst the final output of the delay is routed to the Right channel and so is heard later. When the 'LR' toggle is in the 'Right first' position, then the 'cross' switch routes the tap output of the delay to the Right channel where it is heard first, and the final delay output is routed to the Left channel, where it is heard later. So the 'cross' switch connections are either straight-through, or crossed-over - hence the name.

I don't think there is a standard MaxForLive switch that does this 'out of the box', so I made the 'cross' switch:

  
There are only two objects used inside the 'cross' switch - gate~ objects, which are just on/off switches for audio signals, and one of those arcane 'not quite obvious' special-purpose modifier objects: '!- 1', which inverts a 0 or 1 control value. So 0 becomes 1, and 1 becomes 0 - it is an 'inverter' for  control values. If you replace the two left-hand gates with through connections (closed switches) then you can see that A goes to X, and B goes to Y. Whereas if you replace the two right-hand gates with throughs then A goes to Y and B goes to X, and so achieves the straight-through or
crossover switching.


In physical hardware, then crossover switches like this are very easy to spot when you look at the rear  wiring of a front panel - the inputs go to the centre common part of the switch, whilst the outputs come from one of the outer pairs, and two wires cross over the outer pairs - so you can see at a glance that it is a crossover switch!

Fade switches

If you just switch from one audio signal to another, then you get sudden changes in the value of the signal, and these can cause clicks in the audio. To avoid this happening, one technique is to 'dip' the audio volume as you do the switching, and then restore it afterwards. This approach is used in AUDpiPOdePLUS, the 'performance-oriented' freeze echo device.

For this technique to work, then a sequence of operations need to happen in the right order, and at the right times. Here's the sequence:

1. The volume is at maximum.
2. trigger for the switching occurs. In the AUDpiPOdePLUS device, this happens when one of the 'Freeze' mode buttons is clicked.
3. The volume starts the fade downwards to zero.
4. The volume stays at zero for a few milliseconds, whilst the switching takes place.
5. The volume starts to fade back up.
6. The volume reaches maximum level again.

Once again, there wasn't a standard pre-prepped switch for the 'Freeze' mode button signal routing, so I made my own. It uses the 'constant volume' technique from a previous blog post, plus the 'gate~' switching describes earlier, with added 'fading' to dip the audio signals in and out at the right moments.


The three 'Freeze' modes are A, A+B, and B, which correspond to 'Tap', 'Final output', and 'Tap and Final output' being fed back to the input of the delay. the volume compensation is done using a 1/n multiplier, so that the final multipliers multiply by 1 for single inputs, or by half for two inputs. The fading is done by the 'p dip_mr' objects, whilst the gate~ objects do the switching, and the 'pipe' objects just delay th switching so that it happens when the volume is zero. But the really interesting stuff is in the 'dip' object:


Unfortunately, once you have seen it, then it isn't quite a magical as you might have expected. The line falls to zero in 50 milliseconds (ms), then stays there for 10 ms, then rises back to 1 in 50 ms again. The 0to 1 values of this 'fat' or 'dip' envelope are the multiplier value used in the multipliers, so there's no complicated conversions required. Here's the same thing expressed as a timing diagram:


So the trigger happens when one of the 'Freeze' buttons is clicked. The fade envelope starts to fall, and when it reaches zero, then the multiplier is zero, which means that no audio gets through the multiplier. The switch control has been delayed from when the trigger happened, and the audio signal is switched whilst the envelope is at zero and there is no audio signal getting through. Once the switching has happened, then the fade envelope returns back to 1, and the audio has been switched without any click happening.

This 'dip' fade envelope technique can be used whenever you want to switch from one audio signal to another without having a click. There are other ways to do it, including some that don't have any 'dip' in the audio, but this is a simple starting point for further explorations.

Filtering

I have struggled with the filtering all the way through the two 'AUDpiPOde' devices. In this 'A' version, I have revised the filtering again, so there is now only a single low-pass filter instead of two in cascade, and the high-pass filter is now a State Variable design because the 'subtracted low-pass' technique didn't seem to work very well (but then inside a feedback loop is always a bad place for any filter!). This is far from a perfect design, and full credit to the Ableton coders who have a far superior filter in the original Ping Pong Delay, and in the new 10.1 Delay devices. If only such a filter was available in MaxForLive...

Getting  AUDpiPOde-A 0v05

You can download AUDpiPOde-A 0v0for 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...

Version 0.05 gives some idea of the development problems that I have had with these 'ping pong delay' devices! It seems that having ping pong delay plus several freeze modes is a good way to get confused about single routing, and I have made more mistakes than I want to think about. So my normal 'Work In Progress' label definitely applies to this device!

Modular Equivalents

In terms of basic modular equivalents, then AUDpiPOde-A would require two band-pass filters, two delays, some utility switches, and two mixers, giving a total of about 5 ME.






Sunday, 12 May 2019

Frozen Echoes - a sneak peak inside my M4L development pipeline...

I'm going to break my usual routine this time. Instead of a finished MaxForLive device, I'm posting an early prototype so that you get to see something before I have smoothed any rough edges.

For a long time, I've been fascinated by syncopation, and so the '3' and '5' buttons in Ableton Live's Ping Pong Delay have always been my defaults. Whilst working on my re-inagining of that device, I realised that the extended 'Freeze' buttons that I had added could also be pushed further - into territory that my AUDhexECHO partly covers, but with a different, more rhythmic, more performance-oriented slant. The result is a 'Plus' version of AUDpiPOde, but there's a lot of extras in that 'Plus'! (I also removed the input filtering, but I think the additions make up for that!)

AUDpiPOdePLUS

Here's the basic device: AUDpiPOde split into two separate channels, and without the common time and feedback controls - so just an echo effect.


The left half of each to the channel panels is just taken from AUDpiPOde, and in this mode, you get two different delay times for each channel, so the ping-pong echoes just bounce back and forth in stereo, as you would expect - but because the time delays are different, the timing is more... interesting.

The two buttons marked 'Free' mean that the two channels are separate. If you click on the one above the 'ms' time setting in the Right channel then it changes to 'Anti', which indicates that the two time delays work in opposition. So the time delay for one channel goes up as the other channel goes down.


So 1750 ms in the Left channel equates to 2250 ms in the Right channel, and notice that the time delay adjuster is greyed out in the Right channel - using the 'Anti' button just makes syncopated echoes easier to set up for 120 ppm (at the moment), but it is a good starting point for the next stage.

The panel on the far right contains common controls, including 7 'performance' controls. The largest three are just common versions of the three 'Freeze' buttons: Freeze (Ping), Freeze (Ping and Pong) and Freeze (Pong), where 'Ping' is a 'same channel' echo, and 'Pong' is an 'other channel' echo. The Dry/Wet rotary control controls the mix between the straight-through audio and the processed audio, and the 'MakeUp' slider/indicator is only active when 'freezing' is happening. The final four buttons are connected to the 'freeze' loop processing...

The right half of each of the channel panels contains two processors: a limiter; and a frequency shifter. These two audio processing effects are not inside the feedback loop that is associated with the 'Feedback' rotary control. Instead they are inside what I will call the 'freeze' loop - because this echo effect breaks two of the 'rules' that people often apply to echo units:

1. 100% feedback will cause the delay to oscillate, which is generally considered to be bad.
2. Don't put any audio processing in the feedback loop, because it will affect the feedback and might cause it to exceed 100%, in which case the first rule applies.

Luckily, inside the 'freeze' loop, things are slightly different, and this design has 100% feedback plus audio processing, and it is much harder to get it to oscillate than you might expect. In fact, the freeze loop is specifically designed to avoid the usual runaway feedback, although nothing is perfect! When the 'freeze' mode is selected, the input is switched from the audio input to the output of the freeze loop processing, so the delay is looped around itself, and only outputs audio signals. The Dry/Wet balance control shifts the all 'Wet' when 'freeze' mode is active, so that only the frozen audio is output.

One of the major changes between the plain and the 'Plus' versions of AUDpiPOde is hidden away in the Max code, and it is the audio switching. The Plus version fades in and out smoothly between audio signals, whereas the plain version just switches immediately. The freeze mode only works when the transitions in and out are as smooth as possible, and the fades help to minimise them. This design does to use cross-fades - I'm still trying to get my head around a way to do this, and it remains one of those 'one day I will figure it out' aspects of my programming.

And so to 'freeze' mode:


The selected button is 'P' , which is 'Freeze Pong', so the output goes round each delay in series, and with the 'Anti' time delay setting, this means that the audio will be delayed by 1000 ms, then 3000 ms, the 1000 ms, etc. The frozen output is thus 4 seconds (4000 ms) long in total, and so it repeats every 4 seconds. And because it is frozen, it can repeat indefinitely - although if you activate the Limiter or Frequency Shifters then this isn't true! (because they alter the audio) And when you want to stop the repeats of the frozen echoes, then you just click the 'P' button again and the Dry/Wet control will return to the previous setting, smoothly restoring the echo effect as before the freeze was activated.

So the performance process goes like this:
1. Set up the echo timings in 'Anti', so that the echoes stay in sync (or alternatively, you could just abandon sync!)
2. Click on one of the three 'Freeze' buttons.
3. Let the frozen echoes repeat...
4. Click on the highlighted 'Freeze' button to return to echo mode.

Things to fix

There's quite a lot of extra text needed here to describe the operation of the Limiter and Frequency Shifter effects. The timings in the time delay selection tabs aren't in the right order! I need to fix this. Also, there's that cross-fade that has so far defeated me! (Which means that the frozen echo loop is not quite perfect...) Finally, I'm wondering if I should put filtering inside the 'freeze' loop, which might be quite interesting...

Anyway. Enjoy!

Getting AUDpiPOdePLUS 0v03

You can download AUDpiPOdePLUS 0v03 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 AUDpiPOdePLUS would require two delays, two limiters, two frequency shifters, some utility switches, and two mixers, giving a total of about 9 ME.





Thursday, 9 May 2019

Ping Pong Delay re-imagined for Live 10.1 in M4L...

I'm sure that we are about to be swamped by lots of 'homage', 'retro' and 'for compatibility' versions of the classic Ableton Live 'Ping Pong Delay' plug-in effect so that anyone who likes the simple 'about to be deprecated' effect can continue to use it. But rather than just recreate it, why not take the opportunity to re-imagine it, and try to produce something that reflects what it would be like it it was a brand new device made today? Well, I took the re-imagination route, and as usual, the story isn't completely straight-forward...

Let's start with the classic 'Ping Pong Delay' audio effect:


With the input filtering at the top, then the quick 16th note delay time selector buttons, then the Sync, Freeze and 'Adjust' boxes, and finally the Feedback and Dry/Wet rotary controls, it manages to squash a lot into a small space. I've clicked on the '3' and '5' buttons and used the '% tweak' Adjust box more times than I care to think about, and that tiny little 'F' Freeze button is often overlooked as a creative performance tool... (and not to mention the often overlooked 'Control (M)/Right (W)-Click' in the name bar to reveal the 'hidden' context menu with 'Repitch, Fade and Jump' modes - and probably a standard Ableton question to people who think they know Live...)

Ableton Live 10.1 includes the new version that combines Simple Delay and Ping Pong Delay not one device:


(screenshot from live-101-user-wavetables-new-devices-and-workflow-upgrades  https://www.ableton.com/en/blog/live-101-user-wavetables-new-devices-and-workflow-upgrades/ )

There's a lot of interesting additions in the new version: separate delay time buttons for each stereo channel, plus %tweaks, the filter is now 'bypass'able, and the 'F' Freeze button is now made lots more obvious by being labelled as 'Infinite feedback', which I'm sure is going to attract lots more explorative clicks!  All-in-all, it looks cool, and I'm looking forward to it.

Before re-imagining

Back to the classic Ping Pong Delay... What would a modern 'revisited' version include? How about note value based time buttons? How about freezing based on separate stereo channels instead of just the mixed output? How about a 'bypass' for the filters?

First off, I need to look at the structure of just about all of the stereo delay devices that I have programmed in MaxForLive. My preference has always been for stereo in and stereo out, probably because I was raised in an era when not everything that was 'stereo' was actually stereo (and with two flavours of quadraphonic sound fighting it out when I first started reading electronics magazines), and so there's a bit of a common theme (and there's a partial collection from way back in history here, if you are interested...):


This is definitely a 'stereo in, stereo out' delay/echo device, and I have shown only what I tend to call 'Cross feedback', which is feedback that goes to the other channel. So, if you imagine a drum sound on just the left channel input, then assuming that the Dry/Wet mix control is set mid-way and there is some feedback, the output will be the drum sound from the left channel, then the delayed drum sound from the left channel, then the delayed drum sound (double-delayed) from the right channel, then the triple-delayed drum sound from the left channel, followed by the quadruple-delayed drum sound from the right channel, and so on. Each new delayed drum sound bounces back and forth from left to right, and if there's another bit of audio in the right channel, then that will be output (delayed) from the right channel first, then the left, and so on.

I have to say that I'm tempted to go back into some of my older devices and tweak them so that the 'first delay output channel' is selectable. Now that I have been working on ping-pong delays, I'm wondering if being able to decide if a drum that starts on the left should have the first echo from the right, not the left as shown here... It might be interesting to revise those old devices...

Anyway, if you have been following my recent devices you might be thinking that the 'basic' delay shown above is simplified from what I'm currently doing, and you would be right. Here's a more representative delay device - reminiscent of parts of the recent 'hex' series:


In this example, there are two feedback loops: one for the same channel, and one ('cross') for the other channel, which lets you decide if you want the repeat echoes to be in the same stereo channel or to bounce back and forth between the two channels with each successive repeat. The output panning is also controlled by an LFO driving a panner, so the actual stereo field can be animated as well.

What I hadn't done in any depth when I first started was examine the original Ableton Live 'Ping Pong Delay' device. If you are going to 're-imagine' something, then knowing too much about it is going to affect what you do and restrict your creativity, so I just took my usual delay and gave it a UI skin that was strongly influenced by the original device. It turns out that the Ableton device is rather different...


Let's go back to that drum sound on the left channel input - there's a screenshot of the text setup above - I just set the drum sound on the left or right channels using the Utility device, and then used the Dry/Wet mix rotary controls to look at the input and output of the two devices. You need to make sure that you only enable one device at a time, otherwise all those echoes can be very confusing!


If you send the 'left channel' drum sound to the original Ableton Live 'Ping Pong Delay' device, then you get the dry signal first in the left channel, then the delayed version in the left channel,


then a double-delayed version in the right channel, and so on. So far, it behaves just like mine.


But if you then try a drum sound in the right channel input, then you get the delayed version from the left channel first, then the double-elated version from the right channel, and now it is behaving VERY differently from my version.


So, based on this, it seems like the original Ableton 'Ping Pong Delay' device internal structure looks like this:


So the left and right channels are mixed together into a 'mono' single,and this is then delayed and output to the left channel, then that is delayed and output to the right channel, and the feedback goes round both delays. This is why a drum sound on the right channel appears at the left output for the first echo, then the right channel for the second echo, and so on, back and forth between the two channels. Note that with this structure, the first and second echoes are at the same volume in the left and right channels, whereas in my echo devices, the volume of the second echo depends on the 'Feedback' rotary control.

So now I knew the difference between the Ableton device and mine!

Frozen echoes

Let's look at freezing the echo, where the output of the delay is connected directly and solely to the input. Here's what it looks like for the Ableton device:


As you can see, the output will just 'ping-pong' back and forth between the left and right channels with each subsequent echo.

For my device, then there are several ways to do the freezing, and here's one of them:


This behaves in exactly the same way as the Ableton one: the output bounces back and forth from left to right with each successive echo. I have not included the Dry/Wet mix in this diagram because it was originally drawn for the AUDpiPOdePLUS device, where the Dry/Wet mix is inactive when the echoes are frozen.

Anyway, the end result of all of this investigation and looking at how echo devices work is two MaxForLive devices:

1. AUDpiPOde - the first Ping-Pong Delay device that appeared on MaxForLive.com, and which uses my preferred stereo delay to give stereo echoes that bounce back and forth between the left and right channels. This is not a faithful emulation of the original Ableton 'Ping Pong Delay' device - and so the word: 're-imagining' is very apt - this is how I would program a Ping Pong Delay device now.

2. AUDpiPOde_A - which is the second Ping-Pong Delay device that I will post on MaxForLive, and this uses a single tapped delay to give a different ping-pong effect - where the signal that bounces is a mix of both input channels. This is a closer emulation of the original Ableton Ping Pong Delay device in pre 10.1 Ableton Live.

This gives you both double value (which is her to measure for devices that are free!) and a choice: you can have 're-imagined' or 'close'. I hope that you find both variants useful, and don't forget that all of the re-imagining also produced another device: AUDpiPOdePLUS, which (despite the name) is actually a performance-oriented delay device which extends the 'frozen echo' feature into something rather different.

Re-imagining

Anyway, on with the re-imagined delay device:

Here is AUDpiPOde (from the first two characters of ping, pong and delay). I worked on the note value time delay buttons first. I replaced the 1,2,3,4,5... with note values, using the internal M4L time notation: 16d, 16, 16t for dotted 16th, 16th and 16th triplet, etc. I also added more buttons, from 128th note to 1 note (15.62 ms to 2000 ms at 120 bpm).

I also used the '% tweak' Adjust box to automatically switch between 'Sync' and 'Not in Sync'. So when you click a note value button then the delays are in sync, but if you use the '% tweak' Adjust box (with the triangle) then the time delays are not in sync with Live's timing.

Trying to keep the buttons as large as possible, whilst still keeping a small but neat rectangle of buttons meant that the obvious 'three values' of dotted, note and triplet organisation was awkward, and so I opted for a more free-form set where 2, 4, 8 and 16 are on a diagonal, and 32 and 64 have their own tiny diagonal. It isn't perfect, but it keeps the button grid small and neat.






For the freezing, then I added two extra buttons. The 'F' button is as before, and loops the output of the delay back to the input, thus giving the infinite delay that the new 10.1 makes much more explicit. Note that when the delay is frozen, then the feedback rotary control has no effect.










The new 'P' button loops around the stereo channel reversed audio signal, so if the input is just in the left hand channel, then the first delayed repeat will be in the right hand channel, then the second delayed repeat will be in the left hand channel again. being able to ping-pong in a frozen loop is very cool!









The final freeze button is labelled 'P+F' and combines the two previous buttons into one. For this delay, where both channels have the same delay time, then it makes no difference, but if this was available in the 10.1 delay, where each channel can have different delay times, then some very interesting results would be available. Now although you can do exactly the same effect in my AUDhexECHO effect with appropriate settings of the controls, this seemed like something for a 'Plus' version of this effect, and so expect exactly that very soon!





The filters were a challenge. Max For Live provides a lot of filters, and some very sophisticated tools to help you design specific special-purpose filters, but there are two problems. Firstly, the Ping Pong Delay filter is a band-pass filter - the two controls that are provided are the centre frequency and the bandwidth. But for a wide bandwidth, then a combination of a high-pass and a low-pass is easier to make, but then the controls are more complicated - you need to send the centre frequency to both filters, and then add or subtract half of the bandwidth setting. To complicate things even more, the frequency axis is logarithmic, where the frequency goes up by 10 times for each 'decade' block as you move across from left to right (you can see this in the spacing of the lines in each 'decade' block).


In the filter response plot for a band-pass filter shown above, the major lines at the end of each 'decade' block are 100 Hz, 1 kHz, an 10kHz - so the final vertical line on the right hand side is 20kHz, and zero Hertz is way off the the left somewhere. So the band-pass filter shown has a pass-band between just under 100 Hz to just over 3kHz.

The display in Ping Pong Delay is much smaller, of course:


But notice that each of the decade blocks have the same pattern as the first plot, where the vertical lines get closer and closer together as the frequency goes up, and (by implication) the far right edge is 20 kHz. The yellow dot is kind of centred on 1 kHz, and the centre frequency is 949 Hz, with a Q or resonance of 6.17 (which controls the bandwidth of the filter). Now, having the centre of the display at 1 kHz may not be what  you expected, but look at the right hand side - the narrow vertical strip from 10 kHz to 20 kHz is the same frequency range as the whole of the left hand side of the graph, from the 10 kHz vertical line leftwards.

So if we are going to use a simple x/y controller object from Max to control a band-pass filter, with centre frequency on the horizontal axis, then a pictslider output goes from 0 to 127 horizontally. If 0 represents 0 Hz, and 127 represents 20 kHz, then 1 kHz is going to be a value of about 63 or so, and 10 kHz is going to be at about 110 or so. To convert a linear controller value into a logarithmic value requires that we use an exponentiation function: using the 'pow' object in Max. Using the 'pow' object can be quite tricky, because small changes of input values can have large effects on the outputs. My usual technique is to transform the 'pow' into a 'domain' where figuring out what is happening is easier, and then to transform back once the settings are known. Here are two examples which illustrate this:


Box 1 shows a simple way to use 'pow', whilst Box 2 shows the 'transform' method. At first sight, Box 2 seems to add complexity, so we need to look at the inputs and outputs of the two boxes.

Box 1 first:


When n = 0.5, the output only goes to 11, and so the integer 'multislider' object that I'm using to do the plots quantises the outputs, but you can see that the curve goes from 0,0 to 127,11 and is gradually tailing off (just imagine a smooth curve!). When n=1, then the output is a straight diagonal line from 0,0 to 127,127.


When n=1.5 then the curve looks like a classic exponential, and goes up to 127,1431. When n=2 ('y=x squared' is how you would say it) then the max is 127,16129 (127 squared, of course).


  For n=2.5, then the rightist point is 127,181754, and for n cubed (n=3), then it is 127, 2048383.

In order to use these curves, then you would need to scale the maximum output, but this changes for each value of n:

n       maximum output
0.5             11
1.0           127
1.5         1431
2.0       16129
2.5     181754
3.0   2048383

You can auto scale by dividing by 127 to the power n, but this means that we are doing two 'pow' operations every time, which seems inefficient.

Alternatively, the 'transform' method adds scaling (divide by 127) around the 'pow' function so that it always has inputs between 0,0 and 1,1, and then multiply it by 127 to get the same output as the original UI object. The graphs now look like this:


The 'pow' object is now getting floating point inputs, and so we can see what the actual curve looks like without the accidental quantisation! Notice that each curve goes from 0,0 to 127,127.


And again for n=1.5 and n=2, the output is from 0,0 to 127,127.


And finally, exactly the same output range again!

Putting a transformed 'pow' object inside my filter testing gave this max patch:


This time, Box 1 contains a transformed pow function (I was testing out n=3 in this screenshot), and Box 2 contains the max objects to try and turn the horizontal movement in the pictslider into the correct centre frequency for the band-pass filter, and for vertical movement in the pictslider to control the Q, resonance or bandwidth of the filter - which I implemented as a plain butterworth type. Unfortunately, I couldn't get the mouse interface with the pictslider to feel anything like the Ping Pong Delay original, and having a 'difficult to use' filter section in a re-imagining f a classic Ableton Live device seemed like a bad move. So I reverted to two simple filters instead:


So, in this version, there are two pictsliders: one for the high-pass filter, and one for the low-pass filter. in both of them, horizontal movement controls the centre frequency, whilst vertical movement controls the Q, resonance or bandwidth of the band-pass filter. This simplicity felt much better than the previous complexity, and this is what is implemented in the current device.

Note that the high-pass filters are made from low-pass filters by subtracting the original input from the low-pass filter output. This turns a 'lores' object into a kind of 'hires' object. (although there isn't a 'hires' object in Max, of course!)

The filters can be bypassed by using the Filter/Thru button, and this is important because one of the disadvantages of using the 'lores' filter object is that it has a maximum frequency of the sampling rate divided by 4, and so for the usual 44.1 kHz sampling rate in Ableton Live, this means that the highest cut-off frequency for the two filters is 11 kHz.  I'm also cautious about putting filters inside feedback loops, and so the filtering is only on the input, so you don't get the classic 'tape echo' low-pass filtering that gets more and more noticeable with each repeat.

All of this is different to the original Ping Pong Delay device, and means that I should probably persist in trying to get the UI to feel right for the next version.



Commentary

I need to make it clear that I'm really looking forward to using the new '10.1' Delay effect in Ableton Live. It looks like it combines a lot of functionality in a single device, although I do wonder if the 'minimal UI and size' design approach that was used in the older devices has kind of been abandoned and we now have a more 'designed' expansive look. But in these days of larger and higher resolution screens where effects plug-ins (and most VSTs) are one of the last bastions of skeuomorphic design in UI design (as per the iPhone's iOS before it went 'flat'), then maybe some loosening of the stark minimalism of the older Ableton Live is timely. Personally, removing that minimalism and replacing it with pseudo-realism would negate one of the defining differences between Ableton Live/M4L and other DAWs/Reaktor. (And apart from a few notable inverted examples, and one stand-out (the Studiologic Sledge Black Edition), then I'm still waiting for brightly coloured keyboards to become fashionable instead of custom 'stage' specials...)


Another investigation


blortblort reported in the blog comments that the Feedback control was not working correctly. It turned out that I had made a mistake and had cross-connected the two delays, and got the 'freeze's witching wiring wrong. All of this makes AUpiPOde 0v02 a bit weird, and not the re-imagining that I intended. So I went back through the design, fixing things, re-assessing things, and what came out at the other end was AUDpiPOde 0v03, which should fix the reported problems (I also realised that I should do something less re-imagining and more 'homage' to the original, so that's what the AUDpiPOde-A 0v04 device is all about!



AUDpiPOde 0v03 removes the filters, adds the 'Left First' or 'Right First' LD selection button (as in the -A variant), and provides a 'panic' clear button - the red circle. If the echo starts runaway feedback, then the red button clears the contents of the delay. My recommendation is that you should delete version 0v02, and should only use version 0v03.

And onwards...

It seems that 0v03 had problems as well, although I did lots of testing. So I have visited it again, checked the signal routing, and added the 'f' freeze button from the 'A' version. This is version 0v04.

Getting  AUDpiPOde 0v04

You can download AUDpiPOde 0v0for 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 AUDpiPOde would require two band-pass filters, two delays, some utility switches, and two mixers, giving a total of about 5 ME.