Monday, 8 September 2014

Waveshaping with a wavetable

Having tested a simple waveshaper with Squarer, I wondered if I could take the audio processing part and add it to the Wavetable Creator and make a more flexible wave-shaping utility. As it turned out, doing this went a lot faster than I expected and I rapidly had it working. So please welcome ShaveWapery 0v04.


ShaveWapery uses the same user interface as Wavetable Creator, but changed to the more fashionable 'dark' look, and using my standard lilac as the key color (there's now no chance of mixing the two utilities up!). You choose source waveforms from the on/off boxes at the top, set their amplitude and other parameters, and then press the 'Generate' button. The resulting waveshape appears in the box on the left and its spectrum is displayed underneath. But instead of just allowing you to export the wavetable, in ShaveWapery, it immediately becomes available as a transfer function for a waveshaper.

As always with transfer functions, starting off with a linear input/output relationship is always a good idea. In this case, a sawtooth produces a linear transfer function:


 and any audio should pass through mostly unaffected. Moving the 'Sharpen' control anti-clockwise should give a very similar 'squaring' of the sound to Squarer. And unlike the 'Saturator' built-in effect in Live, ShaveWapery allows you to add randomness to the transfer function:


which can produce some very interesting effects that are noise-like but also structured. There is an enormous range of things to try here, so explore away. As with all such waveform-based processing, if you input monophonic audio, then you will get monophonic output, but if you input polyphonic audio, then you will get distortion. I did thinking about calling this the Intermodulator, but I prefer ShaveWapery!

I'm currently working on improving the user interface - I'm not happy with the 'Generate' button, for instance. But this is just the first iteration.

As usual, ShaveWapery can be downloaded from MaxForLive.com .

Sunday, 7 September 2014

Square Power!

Dopplator, the audio effects M4L device that I featured in the last blog, takes its sine-wave shape processing from an older Wavetable tool, and I've been playing with the Max For Live 'pow~' object quite a lot. By changing the exponent of the power law, you can do simple waveshaping, which is good for LFO applications, but I wanted to try using it for more direct audio processing.

I really like Ableton Live's 'Saturator' effect. It's a powerful way to add extra harmonics to sounds, but I'm not a huge fan of the way that you control the transfer function. So I've taken the 'pow~' function and used it as a simple transfer function to give a 'single-control' harmonics adding device, by using the power law function to 'square' the incoming audio. Compression at the waveform level is one way of thinking about it, although this has the side effect of causing distortion if the input contains more than one set of harmonically related frequencies. But distortion is often useful as well, and this is only a first trial run at an audio waveshaper.

Using an M4L object like 'pow~' on an audio signal isn't quite as straightforward as it appears. 'Pow~' only accepts positive inputs, and so you need to split the audio signal into the positive half and the negative half, and then invert the negative half, then do the processing, reverse the inverted half, and put the two halves back together again. So there's lots of processing around the 'pow~' object, just to enable it to get the right audio signals. Waveshapers can also be very sensitive to input levels, and so I've chosen to restrict the exponent to values less than 1 - higher than 1 and the curve acts like an expander, which increases the sensitivity to input level.


So, Squarer has a single control, which passes the audio waveform through mostly unchanged for a setting of 0%, and adds even harmonics as the percentage increases, with 100% just on the point of instability. If you take a sine wave and look at the output of Squarer with the M4L 'Scope' device, then as you increase the percentage , the waveform changes shape just like the Dopplator LFO control waveform.


And if you play more than one note, then you get intermodulation distortion... (This is why my preference is to put waveshaping just after the VCOs in a synthesizer, where you only get 'one note' at once.)

Squarer can be downloaded from MaxForLive.com , as usual. I know it is very simple, but you may find it useful, and who knows where it will lead me to next...

Sunday, 3 August 2014

Glitches in time...

One thing often leads to another. In a recent example, revisiting my Korg Electribe S Mark II sampling drum machine was the trigger for a new Max For Live project.

Right from the first releases some years ago, I've always liked Korg's Electribe series of sequencer-based hardware modules or 'grooveboxes'. In these increasingly virtualised times, I'm not surprised that there's an Electribe for the iPad, although I do have a great weakness for physical controllers. (and there are a few projects coming up along these lines...)

One of my favourite tricks on the Electribe is to turn the delay depth all the way up, and then to turn the delay time knob anti-clockwise so that the delay line starts to feed-back, and then to 'ride' the delay time  rhythmically whilst dipping the delay depth to stop the feedback going unstable. It's a kind of dopplery, fluttery, accelerando, decelerando effect that is very effective on drums, and the technique has been widely used in lots of contexts, and it set me thinking about using multiple controls simultaneously. (The series of blog articles on Limiting is really about how you 'condense' several controls into one.) You can do this type of feedback, flutter echo stuff on most delay line devices, of course...

The 'doppler flutter' effect (for want of a better name) is a perfect example of using two controls at once to achieve a single effect, and it requires one control to be increased whilst the other is decreased, and vice-versa. Doing this in Max For Live took me longer than I expected because I quickly realised that when I moved the controls, I was not doing simple linear rotations with abrupt stops, nor was I doing the eased sine movements that I have been using for almost all of my LFO-driven effects so far. No,  I was listening to the resulting sound and modifying the control knob movement in response, and so it seemed like the rate of change of rotation was a major contributor to the final sound. A bit of experimentation quickly showed that this was the case, and so I re-used the power-law sine shaper from the Wavetable Creator to give me a variable shape of LFO control pulse for the two oppositely driven controls.



The results are very interesting. The 'Shape' control provides very detailed control over the shape of the LFO control pulse that peaks the delay depth/feedback and dips the delay time, and yet minor changes to the way that the controls change can have very marked effects on the resulting rhyhmic patterns. When I analysed this a bit deeper, then it became obvious that having the controls inside the delay feedback loop was going to affect the sound considerably.

To emulate the 'riding' of a human being tweaking controls, I added a conventional 'Swing' timing control, and this works very nicely with the 'Shape' control. Separate depth controls for the feedback delay time and the left and right inputs provided very strong delay-based stereo imaging as a bonus.


And so Dopplator was born. In sync mode, a simple bassline or drum pattern can be glitched very nicely with a wide variety of rhythmic echo-based additions, whilst in the free-run mode then the arthythmic variations can be long and complex. All from a very small number of controls... The process of exploring the options has resulted in an effect which has moved on considerably from the source of the inspiration, so this is different to the 'doppler flutter' effect in my Electribe S, but it is an interesting addition to the genre!

As always, Dopplator is available from the maxforlive.com website. Enjoy!

Audio demos:


Sunday, 6 July 2014

Limiting inspiration...

Sometimes the spark of an idea can come from a chance comment, and can tip your mind into thinking about something from a different viewpoint. One of the comments on Maxforlive.com for one of my comb-filter-based audio effects set me thinking, because it warned against using limiting because it could change the sound...

Now changing the sound is what audio effects are all about, and every time that I think there isn't any room for anything even remotely new, then up pops something that you hadn't considered before. So after a run of filter-based audio effects, I now had a nagging suspicion that there must be something that hadn't been explored with limiting (or its cousins, compression and expansion, and the evil twin, noise gating). Which is when a crazy idea popped into my head, and resulted in a series of limiter-based effects that reaches its natural conclusion in SyncLimiter.

It is often said that there is nothing new. So I'm cautious about suggesting that this might be new, so I will caveat this with 'new to me'. I've never seen anything that deliberately mis-uses limiting with LFOs setting the threshold, but then I'm a very conventional user of limiters (as in keeping something with lots of time-varying gain stable, as in a swept comb filter) and so I may well merely be revealing my blinkered knowledge.

So with all that out of the way, I present SyncLimiter, an audio effect that has two independent limiters whose thresholds and compression ratios can be modulated by sample-and-hold captured sine waveforms from two independent synch-able LFOs.


I've chosen the 'mirror' look for the UI, so the left and right hand sets of controls are reflected in the vertical axis. The first control to reach is the 'Limiter' control, which is just a lift from previous projects, and which does a complex mapping of threshold and ratio to give a single control that 'feels' right to me. At zero, there's only a slight effect, whilst at 100 there is maybe just a bit too much effect on the sound, and so the place to start is at a setting of about 50. (This is the default). After that, the 'LFO Depth' controls how much the LFO affects the Limiting, and the overall modulation is shown in the dark grey indicator. The 'S&H Freq' control alters the rate at which the LFO sine waveform is sampled (and held), and so at high frequencies (10 Hz) it has little effect, whilst at lower frequencies it chops the sine wave into a 'stepped' waveform. There's lots of scope for exploration here, with the relative ratios between the four frequencies, resulting in a wide variety of stereo changes to the sound. Some of the changes are subtle, others less so.

SyncLimiter works well on drums and rhythmic material like choppy comping. You may even like the way that it can muddle up pads, but using it on vocals is probably limited in its appeal. And actually, there are no rules - and any that you are given are probably interesting to try breaking. I'd be very interested to see in what ways this is mis-used!

I also apologise here to anyone who is offended by this flagrant exploitation of limiting, and I also have to warn users that there may be clicks present in the output of this effect, despite my best efforts with Max's 'line'. This is a dirty and crude effect - you have been warned!

As usual, SyncLimiter can be found at Maxforlive.com (One of these days I hope to make something different enough to get onto the Ableton 'Friday' blog entries!)

Sunday, 23 March 2014

Wavetables as sound effect sources

I've always been a fan of wavetables. The direct relationship between a block of memory holding waveform information and the resulting sound is useful in lots of ways, particularly if you go beyond the basic 'linear read'.

Previously, I've released some of my early experimentation in M4L with wavetables, and the latest revision is now available: Wavetable Sound Effects 0v04. (from Maxforlive.com) Compared to the previous versions, there are more wavetables, more control over the scanning through the table, and a better user interface that makes it very clear where the LFOs are and what they do. Each wavetable is just 2 seconds in length, but the sound making possibilities are much wider than this might suggest.
As usual with most devices, start off by turning the LFO modulation levels down to zero. In this case there are three: Vibrato for frequency modulation, Rangato (range-ato) for the modulation of the range of table scanning, and Timbrato (timbre-ato) for the modulation of the centre of the table scan. Once you are familiar with the basic operation, then you can return to the LFO modulation and explore how it affects the sound.

Basic operation centres around the main controls, which are in the dark backgrounded area. The Table selection chooses between ten very different sets of audio files (hand-crafted from scratch in Audacity). The Start and Finish controls adjust the region of the wavetable that will be scanned and turned into audio, and the triangle sets the centre of the region - if the white area is outside of the window, then nothing happens (the limits are hard-coded), so there's no need to explore what happens if you do this.

The Freq (uency) control sets the rate at which the region is scanned and thus turned into audio, and the High/Low button on the right controls how quickly this happens. underneath the Freq control is the Shift control, which enables the output pitch to be changed independently of the scanning rate. The sound sometimes vanishes if you set the Shift control too high, so explore the left hand side of the dial first...

The Range control provides more scanning control, and the indicator bar next to it shows the total modulation being applied to the scanner.

That's about it really. Explore and enjoy!
Enhanced by Zemanta

Sunday, 9 February 2014

A Limiting Solution part 3

Once I had created LFO Limiter, it occurred to me that I had missed one additional possibility for flexibility - it processed both stereo channels in the same way. So I duplicated the limiter section and produced the stereo version: LFO S Limiter ( available from MaxForLive.com ).


LFO S Limiter (0v01) is just two LFO Limiters stuck together - everything is duplicated and totally separate. So you really can have completely different settings on each stereo channel - even one limited and the other not. My personal preference is for more subtle differences, with the same 'Limiter' depth amount, but slightly different LFO frequencies. Having two separate channels provides more scope for complex rhythmic and syncopation of source material...

The panel design isn't the prettiest I've done, but I struggled to find a way to have the two channels shown clearly. You can see the same dilemma in many of my devices that have two separate channels - Hairbrush is a good example where I have mirrored the two sides to see how that feels, but it isn't a perfect solution. There seem to be at least three different approaches to a two-channel layout, and I'm not sure which is the best one.


Ableton use the 'Vertical Copy' layout in the 'Analog' synthesizer, and where you have a strong flow across, with two channels and a common 'central area', then it works nicely. But you only get a single row of controls, which tends to make the device wide, which can result in lots of scrolling left and right to get the correct device visible.

The two horizontal layout options are interesting. I am very familiar with the 'Horizontal Copy' from older modular synthesizers, where you just double up on the module, and so the layout automatically copies (unless the module is stereo, of course, and modern modules do seem to use horizontal mirroring sometimes). But I actually prefer the 'Horizontal Mirror' because somehow it emphasizes the two channel-ness, and looks better aesthetically. One thought I did have was to run an experiment where I make two versions and see which one gets the most downloads...
Enhanced by Zemanta

A Limiting Solution part 2

I tend to stick to the same sort of life-cycle when I am creating audio effects. I start with an idea or a need, then try a few potential solutions, and then refine them until there is a 'best' candidate, which is then developed further. What gets published on MaxForLive.com is almost always tagged as 'Work In Progress' because there's always room for improvement. 'Never finish a song...' is the old studio trick of returning to a recording project a few days after it felt perfect, only to find that there are actually loads of things that can be improved. This principle seems to be broadly applicable: Artists apparently always leave a picture with 'three brush-strokes to go...'

When an effect is finished enough to be usable without needing to be fixed every time, then the programming task fades, and the exploration phase starts. For Comber 0v02, this is where serendipity stepped in. I was seeing what the results of some of the control settings were with the new Limiter function, and I was adjusting the Limiter depth control live, riding it as if it was just another controller. And surprisingly, the result was interesting...

Equalizer / Compressor / Limiter
Equalizer / Compressor / Limiter (Photo credit: HSmade)
I've always treated dynamics controls as 'set and leave' devices - you find the right compression, limiting, gating or expansion, and then leave it. The wide use of gated reverb in the 80s (Phil Collins, Allan Holdsworth: Velvet Darkness (not part of the official discography), David Bowie: Low, Peter Gabriel: III...) was one of those 'wow' moments where an un-natural effect sounded really good. Unfortunately, the over-use of gated reverb, particularly on snares, can become a cliche...

But tweaking the Limiter depth control gave another interesting - and not natural - sound. Some similarities to gated reverb, but because it was mixed up with the comb filtering, it was worthy of further exploration...

So I added an LFO to the Limiter control and stripped out all of the comb filtering, resulting in LFO Limiter 0v01, where the depth of limiting changes over time. And because the Limiter depth control is adjusting multiple parameters inside the limiter library object, the LFO is doing something that would require very nimble finger movements on a conventional set of limiter controls.


Limiter 0v01 has very few controls. The 'Quick/Smooth' time response mode switch is the same as in Comber, and the LFO is my usual free/sync sine wave taken from the MaxForLive examples. Because I'm trying to focus the attention of the user on the sound and not the technicalities, I have deliberately not put any animated display of the limiting process in action. After all, you don't show a representation of the comb filter spectral response in a phaser or flanger... Instead you get my standard 'Modulation slider' display that I tend to use whenever a value is modulated by an LFO - in this case the Limiter is modulated by the LFO Depth control. I much prefer bouncy little dots to the usual Ableton method of animating the modulated control (where the Limiter control rotates back and forth in time with the LFO modulation).
LFO Limiter should be on the MaxForLive.com site soon, and can produce some very unusual rhythmic and syncopated effects, particularly when preceded or followed by some echo.

Using LFO Limiter


The best way to explore it is to start out with the LFO Depth set to zero, and just get familiar with the effect of the Limiter control: zero is no limiting, 100 is pure 'pumping'. A setting of about 30 is a good place to start introducing LFO modulation, and my initial preference was to match the LFO Depth and Limiter settings, so try 30 for the LFO Depth at first. (I did contemplate having a single control that replaced the two, but the 'same setting' for both is not always appropriate for some source material, so I have left them as two separate controls.) After that, just tweak and explore.
Enhanced by Zemanta