Sunday, 24 January 2016

Generating audio soundscapes...

A few weeks back, I revisited my old Reaktor workspace and started reworking some of the ideas in there for M4L. Here's the second output from that project...


Saw4Generator_Dark is a sound generator with preset memories. It does not respond to MIDI inputs - it just sits there and makes noises continually...

The basic idea is very simple. There are two sections: a sound generator that produces the raw sounds; and a mix processor that controls how those sounds are formed into a stereo sound stage. Both sections have manual controls that can be tweaked, as well as LFOs that allow some changes to be made cyclically over time (although this version does not allow the sound generator modulation settings to be controlled by LFOs, which is something for a future version)


The sound generator section starts with a sawtooth wave oscillator with and and LFO to modulate the pitch and the output is frequency modulated by another similar oscillator, which is modulated by another similar oscillator, and another one on top of that... The result is a simple FM vertical arrangement that is often referred to as a 'stack'. There are a lot of controls!

The mix processor is a flexible output stage with even more controls! The output allows mixing of four deliberately-harmonically-diverse outputs: the final oscillator itself ('Saw'), the ring modulated output of the third and final oscillators ('Ring'), the output of the third oscillator 'sample & hold' processed by the final oscillator ('S&H'), and the output of the second oscillator 'sample & hold' processed by the final oscillator ('H&S'). In other words there are four separate outputs, each with its own unique harmonic content. The output stage has LFO modulation of the mixing, plus LFO panning as well.

There's a lot of power here to control the sound, and a lot of LFOs providing the bulk of that automation. As always with LFOs (and often with VCOs, and especially with digital versions of these building blocks...), the 'never the same twice' rule applies - so don't set all the LFOs to the same rate or the same modulation, instead go for values that won't 'collide' too frequently: ratios that are prime numbers are good. Here's why:

If you think about two LFO were one is twice the speed (rate) of the other, then they will 'collide' or repeat (have the same values at the same time) every cycle of the slowest LFO. In the diagram I've simplified the LFO to show only two output states (0 and 1):

01010101010101  (rate = 1)
00110011001100  (rate = 1/2)
^   ^   ^   ^   (the pattern repeats quickly) 

But if the rates (or the ratios between them) are prime numbers, then the collisions take much longer to happen:

00011100011100011100011100011100011  (rate = 1/3)
00000111110000011111000001111100000  (rate = 1/5)
^                             ^      
(the pattern repeats more slowly)

So by setting values like these:
0.01
0.02
0.03
0.04
You will get lots of places where the LFOs are in sync, and digital systems are pretty precise with timing for LFOs, and so you tend to get short repetitive patterns, which normally isn't what you want when you are controlling a complex sound generator...

Better values for getting long times between repeats would be more like:
0.03
0.05
0.07
0.11
Which takes quite a long time to repeat, and sounds a lot more complex when you hear the controlled output.

Getting Started

A good way to start with Saw4GeneratorDark is to turn all the controls to the leftmost minimum position, and then to select the Saw button, adjust the volume to your preference, and choose the pitch you want in Oscillator 4 (there's just a Pitch control there, so it is easy to find! You will also find the 'preset' store buttons here. 'Shift & Click' to store, Just Click to recall. Saving this 'All leftmost' preset is a good place to start again when you get lost).

Using just one oscillator is a good way to learn the output options: LFO modulation of volume, plus LFO panning. Once you have gt your head around the controls (some ping-pong echo is very often applied to the output of this type of generator...) then there is the LFO modulation of the pitch of the oscillator to try out. Saving a simple sound like this is often a good starting point for further exploration.

When you are comfortable with all of that then you can try moving to the left and try exploring the pitch and modulation controls for Oscillator 3, then the LFO pitch modulation for that oscillator, and so on to the leftmost Oscillator. Because Oscillator 1 is at the top of a stack of FM then it can cause big changes to the oscillators underneath it, so be cautious at first with the pitch and modulation controls. If everything gets too much, then just go back to the 'all leftmost' and start again from Oscillator 3.

Further processing

The screenshot above shows one possible chain of audio processing that you can add after Saw4GeneratorDark. A 'Saturator' is used in the 'wave shaper' mode, followed by an 'Auto Filter' set so that a resonant filter peak scans across the frequency spectrum, then a limiter to avoid problems with a peaky filter on the resulting rich audio material, and then the ubiquitous 'Ping-Pong Delay'.


The thinking behind this type of audio processing chain is straightforward: generate a harmonically-rich sound source, and then dynamically filter it down into a simpler sound. The Saw4GeneratorDark output already has a lot of harmonic content, and so the Saturator doesn't need very much drive in order to get a lot of frequencies, but it can be useful for a little bit of thickening or 'colouring' of the output. The low-pass peaky filter lets some low frequencies through, and so tends to give a stronger sound, but try using a peaky band-pass (or high-pass) and see the difference that it makes to the sound landscape that is produced. You can replace the simple Limiter with a Multiband Compressor if you want more control over the output frequencies, but you might think that there are already enough controls! The final Ping Pong Delay just pushes things together, and could be replaced (or augmented) with some Reverb.

This is just one possible chain of post-generator processing. There are many more possibilities to play with, and when combined with Saw4GeneratorDark, you can create a wide variety of unusual soundscapes. There's a lot to explore in Saw4Generator, and a lot of sounds waiting to be created. Recording the output and processing it further is thoroughly encouraged!

(As always, this is a work in progress, so it may not be perfect, and early versions tend not to have very much help on controls included in the M4L. Please feel free to report bugs via the comments, and I will try to fix them when I can find time.)

Sunday, 3 January 2016

Sweeping wavetables using .WAVs

Previously I've blogged about 'Waivy', the simple swept wavetable glimpse into the forthcoming update to Waverne. 

Well, as I was playing with Waivy, it struck me that instead of fixing the wavetable with the carefully compiled fixed version that I'd included, it might be interesting to allow .WAVs to be used instead, and so 'Sweeper' was born. 



Simple and fun (and with free 'Frasier' references), Sweeper is a variation of my recent 'Waivy' plug-in, but adapted for use by those people who like to use their own .wavs instead of pre-compiled wavetables. 

Sweeper allows you to use the default wavetable (different to the one in Waivy, of course) or drop your own .WAVs onto the waveform display and then select the part of the waveform that looks interesting (and sounds interesting). The separate 'Wave' control allows finer selection, and the 'Sweep' control allows dynamic wavetable sweeps in real-time, as per various synthesizers of the past. 

Please note that M4L and Live are a little bit selective in their import of AIFFs, and so only .wavs can be used in this plug-in. (Sound of people converting AIFFs into WAVs...)

Also note that the obvious use: extracting waves from loops, turns out to be somewhat less than anywhere near as brilliant as I had hoped, so don't be disappointed. (Sound of people not converting AIIFs into WAVs...)

Because Sweeper is deliberately simple, the envelope is an 'AD' 'contour-like' shape, which isn't as limiting as you might expect, and remember that this is a preview! Also there isn't any filtering, which can make Sweeper a little brittle in sound, but this is easily overcome by adding a filter, and Ableton Live makes this very easy:



The 'Auto Filter' remains one of my favourite effects in Live, and in this case, it allows you to do more than just remove some of the harsh top-end, it also allows you to dynamically filter the output of Sweeper using the LFO. Adding all of this functionality into Sweeper would have made it much more complex, and when you can add 'Auto Filter'....

As always with early versions of my M4L devices, you may need to do some tweaking of settings to get the best results. In particular, the 'Wave' and 'Start' controls tend to interact and you may need to adjust them to get the wavetable sound you want, instead of a metallic buzzing. Alternatively, if you want nasty metallic buzzing, then Sweeper does it by accident too!

Anyways, as a free 'explore me!' plug-in, Sweeper has lots of scope for making some very nice sounds, plus some dreadful aliased sounds as well -  and which is which all depends on your taste...

Sweeper is available for download from MaxForLive.com.


DIY MIDI Controller with LEDs

Possibly one of the least amazing titles for a blog articles! In these days where RGB LEDs feature on just about every specification list for MIDI Controllers, then the only difference is that it's a simple home-brew MIDI Controller - creatively mis-using a spare numeric keypad.


The numeric keypad is intended to be used with laptops that don't have separate number keys in a nice neat square form, and require the user to either use the buttons over the 'qwerty' row, or to do various extra key-presses to re-use other keys on the main qwerty keyboard. So the keys on the keypad just map into the standard key numbers as if this was a full external keyboard. To use the keypad as a controller, I have been working on a simple MaxForLive plug-in that intercepts the incoming key number messages and allocates them to functions in Ableton Live - this is still ongoing work, but the controller is finished, hence this blog entry!

The keypad as supplied is very boring: black plastic everywhere, and the only concession to RGB LED-ness is a red 'Num Lock' LED that isn't really relevant in this context. So this obviously needed augmenting. First task was to light up the keypad itself, and four blue LEDs did that very nicely. The numeric keypad came with a USB plug, so power was easily available, and I just added a few series resistors to the LEDs. I could have added more LEDs, but four was okay for this first iteration, and there is a definite limit to how much hot-melt glue you can use without waiting for it to cool down properly.

The flashing yellow circle came from a concert wristband that my son was about to throw away because the batteries had died, and so that was pressed into service (with an on/off switch). The flashing multi-coloured interior to the circle was one of those 'infinite mirror' displays where two mirrors bounce light back and forth many times giving an illusion of depth, and so that became the middle of the circle, again with a selector button to allow the choice of flashing mode.

The end result looks very flashy (deliberate pun!) but has one problem - the backspace and return key tend to be used in mot application UIs - and in Ableton Live the Backspace key deletes the active plug-in, which is usually the custom M4L plug-in, whilst the Return key tends to spawn a new version of the plug-in. Obviously these buttons are not very useful in a control context, and the simplest solution was to disable them - mechanically (you were expecting a software method, perhaps?).

 Disabling keys on keypads is relatively easy given the lack of travel of modern keypads - you just put lumps of blu-tack (or other similar slightly sticky substance) underneath them, so that pressing them doesn't result in any movement. Here are some photos showing bits of this process.





Prising keys off is usually pretty easy - I use a screwdriver. doing the blu-tack is easy, and putting the key back is normally just a question of pushing it back.

Please note that the lower cost the numeric keypad, the easier these types of mods tend to be. Levering out the keys on an expensive laptop (an Apple MacBook Pro for example) and trying to put them back with blu-tack underneath is definitely not recommended! (Just don't do it!)


To indicate that two of the keys were now disabled, I covered them with white typing correction fluid, something which used to be a standard home office accessory... I'm looking for a better solution, and 'sticky-back plastic' is definitely beckoning me!





And that's it. A spare (actually unwanted, although it sounded like a good idea at the time!) numeric keypad turned into something which looks like a MIDI Controller, and which may well be used when I iron the bugs out of the MaxForLive plug-in. In the meantime, it looks very good on stage, and isn't that one of the prime reasons behind all of those RGB LEDs anyway?

Now that I think about it, I probably didn't need to modify the keypad at all - I could have just assembled a few bits of LED toys and put them into a suitably technical-looking box and I'd have a stage box that smart-alecks and know-it-alls would look at and say things like: '...and there was this amazing home-brew controller...'. Maybe there's a business opportunity here?

[ Note that I'm not suggesting that you modify/wreck your own (or anyone else's) keypads, keyboards, laptops or anything else. I'm just showing that I sometimes do hardware as well as M4L! If you do make any modifications, then you assume full responsibility for them! ] 






Transposing Quickly In Ableton Live

Ableton Live has a 'Pitch' MIDI Effect, which provides a rotary control for semitone shifting of incoming MIDI notes. This is fine for precise mouse-users who are not in a hurry, but isn't so good at speed...

So here's 'Quick Transpose', a simple 'holiday-themed' give-away M4L plug-in that is available from MaxForLive.com:


 There are two columns of buttons: Octave transpositions on the left, and Fifths on the right. The orange box shows the total transposition from the two columns, and the '!' button is a pain button in case any held notes occur (although I have tried to minimise the chances of this happening in the M4L code).

The screenshot above shows the obvious way to use Quick Transpose, and this is probably where most Live users would place it automatically - left most in a track chain.

But you can put Quick Transpose anywhere in the MIDI part of a track chain, which means that it can go in front of a synthesiser inside an Instrument Rack:


This allows you to quickly transpose one of a pair of synthesisers to parallel fifths or octaves with a quick click of the mouse, and you could always put another instance of Quick Transpose in front of the whole Instrument Rack to avoid needing to select notes and shift-octave them in the piano roll view. (Not that I'm saying that the 'Select, Shift-Arrow' octave transposing isn't a great time saver too!)

As with all of my recent M4L plug-ins, Quick Transpose is now also available in a 'dark' version as well. 


The 'orange box' has gone, and I'm still trying to decide how to tweak the UI to have the same indication without it looking like  button, so expect an update at some stage. (Although I'm sometimes rather slow with updates...)