Showing posts with label Sine wave. Show all posts
Showing posts with label Sine wave. Show all posts

Monday, 12 January 2015

Refined Combing...

Things don't always go the way you intend. I had an idea for a phaser effect that was driven from a filtered noise source, and the end result was something rather different. Here's the story...

'Phasers' are just comb filters where the notch frequencies are modulated up and down in frequency by an LFO. (My previous Comber effect was nothing more than a few of these in one place.)
The audible effect for typical 'vibrato/tremolo' LFO rates sounds a bit like detuned oscillators, and so can be used as a simple 'chorus' effect (there are other ways of doing chorus effects as well). At slow LFO rates then the effect is more like several resonant filters sweeping up and down, which is exactly what is going on!

But whilst sine wave shaped LFOs are all very nice, there are many other possible alternative waveforms, and repetition can get a bit boring. So my idea was to got most of the way to the opposite extreme from the pure predictability of a boring sine wave and use noise instead. Filtered noise seemed like the right thing, and so I envisaged an array of resonant high-pass, band-pass and low-pass filters, and perhaps some sort of neat GUI control to create a final 'noisy' modulation for the comb filter.
Unfortunately, the end result was not as interesting as I hoped. High-pass filtered noise just gave a rapid tremolo effect, and not a particularly nice or useful one. Band-pass filtered noise was still too busy. The only really useful noise was heavily low-pass filtered noise, containing exactly the sort of frequencies that you would use for tremolo, vibrato or a phaser! After a bit of experimentation, it turned out that I didn't need any conventional filtering at all, and that just a bit of sample averaging (OK, primitive filtering) produced nice random wobbling that sounded ok - but it wasn't anywhere near as impressive as I'd been hoping.

So I wondered if something combining the LFO and the noise was a better idea, and I added a DJ cross-fade type control to mix between the LFO sine wave and the noise waveform. This seemed to liven up the result and make it a bit more interesting and unpredictable...
But then I realised that I had an alternative source of variation, and so I added a second LFO to drive a Sample/Hold circuit that sampled the original sine wave LFO. Sample/Hold circuits have always fascinated me, right from the days when you put high-input impedance op-amps on Teflon PCBs with polycarbonate capacitors and used reed-relays as input sampling switches, all in the analogue quest for long-term voltage storage (and you still got droop over time!). In the digital domain, things are different (and you add imperfections if you want to model the real world) and so a quick bit of M4L'ing later, I had an LFO with sine waves for high sample rates, and repeated complex patterns for lower sample rates. (The S/H samples when the indicator lights up yellow, btw.)
The DJ slider became a 'Randomness' control, and I added a red indicator to provide visual feedback for when the 'Freq' and 'Depth' controls needed to be adjusted (up and down respectively), and Comber V0.3 was born! I hope you find it a more versatile and inspirational effect for your music. 


Comber V0.3 is available, as always, for download from MaxForLive.com.

Related articles

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, 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!)