Thursday, May 31, 2012

Bidule Example: Low Frequency Filter Modulation Example

Wednesday, May 30, 2012

Bidule Basics 4: Parameter Automation in Ableton Live and Parameter Linking

This post assumes that you have read the previous Bidule Basics posts. There is no Live session or Bidule patch associated with this post.



Parameters Galore!
One of the strengths of Bidule is the way in which you can easily map and manipulate parameters.

Previously, we've looked at using MIDI notes to control parameters as well as modulating a parameter with an LFO.

Beyond these options, Bidule also lets us map parameters in a number of ways.

This post will explore two related concepts:
• How to set up parameter automation in Ableton Live, so that any parameter in Bidule can be automated like any other parameter in Live (i.e. in its own track lane and via automation recording).

• How to link one parameter of Bidule to one or more than one other parameter, thereby creating "macro" controls that allow the control of multiple parameter easily.



Automating Parameters from Ableton Live
As you can imagine by now, we can create very complex Bidule patches if we want to. These patches might include many parameters, easily into the hundreds.

Although this may be great for control within the Bidule patch itself, it makes things more complex outside of the Bidule patch.

Imagine that we have a reverb effect within Bidule, and we want to control a given parameter within that reverb effect from Ableton Live, via plugin automation.



With any other Ableton Live plugin, every parameter that can be automated is readily available with its own track automation, ready for writing / recording automation data.

However, this is not the case with parameters inside of Bidule patches - these are contained "within" Bidule.

As a result, we need to manually create a 'bridge' between Live and Bidule. This tells Live that we want to automate one of the parameters found within Bidule, and which parameter it is that we want to automate.

To manually create this 'bridge':
• Click on the 'parameters' button at the top of the Bidule patch window.
• You will see a list of Bidule objects within your patch in two columns: source and target
• Locate the 'Bidule Plugin_0' reference in the source column
• Expand this reference so that you see a long list of 512 parameters in the source column
• Choose the first parameter (named Parameter 1) in the expanded list of Bidule Plugin_0 items
• In the target column, click on the parameter that is to be automated. You might need to expand a Bidule object to see all of its parmeters
• Click on the 'Link' button below the two columns
• You should see the new link listed at the bottom of the linked parameters list below the two columns

In the example below, we've selected Parameter 1 from the Bidule Plugin_0 as our source parameter. The target parameter that has been selected is the Room Size of the Freeverb_0 Bidule object. 





Now, when we look at our Bidule AU plugin device in Ableton Live in our Audio Effects area of our track, we can see a slider and a reference to "parameter 1", which is mapped to the Room Size of the Freeverb_0 object.


We can move this slider in the same way as any other Live plugin parameter. This also means that this newly-created Parameter 1 has its own automation lane, as you might expect.


This means you can draw in automation within the automation lane using Live's pencil tool, or you can record automation by moving the slider in the plugin itself. Very handy!

The process outlined above can be repeated for up to 512 parameters, giving us an extraordinary level of control over our Bidule patch. Consider this when using various parameters within Bidule and when creating different settings. 





Linking Parameters within the Bidule Patch
Besides automating parameters as shown above, Bidule also allows us to link multiple parameters within a given patch.

This lets us create macro controls, where you can control multiple parameters by moving just one slider or changing one variable. Let's go through a simple example of this!

Consider the following simple Bidule patch. We have audio coming into the patch at the top. This audio is routed through a Freeverb object. The output of the Freeverb object is then routed to the mixer. So far so good.

However, there is a simple Variable object (see the object palette under Building Blocks > Maths > Variable) that has been renamed to 'Variable_0 - Macro Control 1'.


The aim of this Variable object is so that we can control more than one thing from the one slider. In fact, we don't even have to connect anything within Bidule using patch cords.

What we have to do is link the value parameter of our Variable object (i.e. the value of our slider / number that we enter when we double-click on the Variable object). We can link this parameter to other parameters, such as the level parameter and panning parameter of channel 1 of the Mixer object.

Once we have created these links, whenever we move the value of the Variable_0 - Macro Control 1 slider, this will automatically change the value of the channel 1 volume fader and channel 1panning control of the Mixer object.

To create these links:
• Click on the 'parameters' button at the top of the Bidule patch window.
• You will see a list of Bidule objects within your patch in two columns: source and target
Locate the Variable_0 - Macro Control 1 object in the source column, and expand it
• Select the Value parameter
• Locate the Mixer object in the target column, and expand it
• Select the Volume Channel 1 parameter, and click the Link button below the two columns
• Scroll down to the bottom of the linked parameters list below the two columns - you should see the newly created link
• Now to repeat for the panning control!
Locate the Variable_0 - Macro Control 1 object in the source column, and expand it
• Select the Value parameter
• Locate the Mixer object in the target column, and expand it

• Select the Pan Channel 1 parameter, and click the Link button below the two columns
• Scroll down to the bottom of the linked parameters list below the two columns - you should see the newly created link








Once you have finished, close the Parameters window. Move the value slider of the Variable_0 - Macro Control object (you will need to double-click on the object to open the object window).

Check the value of the volume fader and the panning control of channel 1 of the Mixer window - you will see the values change accordingly!

Although this is a simple demonstration of this concept, we can take this idea much further. 



It's All About Control
Hopefully this short post gives you some ideas about what is possible with the parameters inside and outside of Bidule. Once again - like all of these posts - this should be taken as a starting point more than anything else, in that experimentation is always encouraged.

Condensed SEGA Mega Drive / Genesis GenMDM MIDI Mapping

For those interested, here is a condensed version of the SEGA Mega Drive / Genesis GenMDM MIDI Mapping as a PDF file: http://milkcrate.com.au/littlescaleweb/midi_mapping.pdf

I am still working on the user manual that will contain additional mapping as well as an in-depth explanation of all of the parameters shown in the condensed mapping.

However, this will give those that would like to know more about the mapping a bit more information. 

Monday, May 28, 2012

Bidule Basics 3: MIDI Control of Audio Effects

This post assumes that you have read the previous Bidule Basics posts. The Bidule file and Live session and samples used in this example can be found here.



Take Control!
The aim of this post is to provide a simple example of using MIDI note data from an Ableton Live MIDI track to control parameters of audio effects inside of Bidule.

This example represents just one possible data mapping, and a very simple method of control. The setup presented here can be expanded upon extensively.

Nonetheless, we can break the process down into several easy steps:
• Set up MIDI routing
• Create a MIDI track and sequence relevant MIDI data
• Add routing and setup the Bidule patch

Let's assume a starting point from the end of the previous Bidule Basics post about parameter modulation


Here, the frequency of the Biquad Filter objects was controlled by an LFO, and the Q was controlled by a standard Variable object slider.

Every MIDI note has two data components - pitch and velocity, both of which have a data range of 0 - 127. Velocity can be thought of as a representation of volume / note strength.

The aim for this post is to use MIDI notes to control these two parameters of the Biquad Filters - mapping the note pitches to the frequency and mapping the velocity to the Q.




Setting Up The MIDI
The first thing we need to do is actually let Ableton Live know that we want to use the virtual MIDI inputs that are created when we add an instance of Bidule to our session.

First, go to Ableton Live > Preferences and navigate to the MIDI Sync tab. Make sure that the input and output ports for the Bidule AU 1, 2, 3 and 4 devices are set to ON for the Track column, as shown below.


The next stage is to create a MIDI track and route the output of the track to the Bidule plugin. In Ableton Live, go to Create > Insert MIDI Track. Go to the Session view by pressing tab and route the output of the MIDI track to Bidule AU 1 - Channel 1, as shown below.


On the MIDI track, create a new MIDI region and sequence some MIDI notes, as shown below.



Create the Connection
Within the Bidule patch, delete the LFO and associated variables. Create a Bidule MIDI Input device by dragging and dropping an object from MIDI Devices > Input > Bidule AU 1.

This object represents data coming in that is routed to the Bidule AU 1 virtual MIDI port (such as the MIDI track that we just set up).

This one, single outlet can contain all sorts of data - from MIDI notes and velocities, to MIDI continuous controllers, pitch bend data and more. 

Note that the outlet of the Bidule AU 1 object is white - this means that it carries MIDI data. Many Bidule connections are blue in colour - this means that they carry sample-based audio.

You cannot connect MIDI data directly to the blue connections - we need to convert the MIDI data into a format that we can use with the majority of Bidule objects (such as the input for our filter frequency, which is blue). 





Extracting Note Data
We now need to actually extract just the data that we are interested in - in other words, we need just the note data (i.e. pitches and velocities) and we don't need any other types of data (CC, pitch bend etc). 

The perfect object for this is the MIDI Note Extractor object, which listens to a stream of MIDI data and then extracts only note data. Once the note data has been extracted, pitches and velocities are converted to more useful data types and ranges. 

The pitches (that are normally numbered notes from 0 to 127) are converted to actually frequency number values. The velocities (that are normally numbered in the range of 0 to 127) are converted and scaled to an amplitude range from 0 to 1. Connect the output of the Bidule AU 1 object to the inlet of the MIDI Note Extractor object.

The Note Extractor object has four outlets. These are: 
• Frequency
• Amplitude
• Gate
• Trigger

Of interest to us are just the first two outlets - frequency and amplitude. Connect the frequency outlet directly to the filter frequency inlets of the Biquad Filter objects. 

Thus, any notes that are sent to the Bidule AU 1 MIDI port will be routed to the Note Extractor and then pitches are converted to frequencies, eventually controlling the frequency of the Biquad Filter objects.




Controlling the Bandwidth / Q
The next stage of the process is to make a connection between the velocity of the notes and the Bandwidth / Q of the Biquad Filter objects. Delete the simple Variable object that is currently connected to the Biquad Filter object and controlling its Q parameter. 


 The Bandwidth / Q inlet of the Biquad Filter expects a data range of 0 - 10 or so.

However, the output of the MIDI note extractor converts the velocity to an amplitude value from 0 - 1. Beyond this issue, the Q / Bandwidth and velocity have an inverted relationship. 

A low Q / Bandwidth represents a steeper / more obvious filter, whereas a low velocity represents a quieter / more subtle note. 

So, we need to transform our amplitude values to: 
• Become within the range of 0 - 10
• Become inverted with respect to their original value range

We can use the Function object, and easily scale and invert our velocity amplitude values. Add a Function object and type in a suitable expression with respect to X, such as: 10 - (x * 10). 

Connect the output of the amplitude values from the MIDI Note Extractor outlet to the X input of the function object. Connect the output of the function object to the Q / Bandwidth of the Biquad Filter objects


Thus, the velocity of any note that is sent to the Bidule AU 1 MIDI port is converted to a value of 0 - 1, then scaled and inverted to a value of 0 - 10, then eventually routed to the Q / Bandwidth of the Biquad Filter objects.



Mapping
The most important thing to take away from this is the fact that MIDI data - whether notes or other types of data - can be mapped easily and quickly to parameters within a Bidule audio effect plugin, allowing for musical control of the patch. 

Some things to consider: 
• MIDI CC can be used alongside pitchbends and note data
• Explore using the trigger and gate outlets of the Note Extractor
• Any MIDI effects found within live can be added to the MIDI track in question for added control / interest.

Bidule Basics 2: Parameter Modulation

This post assumes that you have read the previous Bidule Basics posts. The Bidule file and Live session and samples used in this example can be found here.



Oscillations
Consider the humble sine wave as we normally might hear and see it. Digitally, this waveform has a range of -1.0 to 1.0. These two extremes represent the maximum and minimum excursions of our speakers, but these values also represent the maximum signal that our digital to analog sound converter can deal with before we get nasty digital distortions.


However, in Bidule we can use our oscillators for control purposes. Rather than just listening to sine tones, we can use sine functions and other waveforms to easily control parameters of various objects.



Process
We can break this process down into a number of easy to understand steps:
• Create an oscillator setup
• Decide where it should be mapped to (i.e. which parameter should be controlled using the oscillator)
• Work out the data range for the mapping (i.e. what are the maximum values that are required for that particular parameter)
• Scale the output of the oscillator so that it is creating a signal that is within our desired data range, and connect the output to the parameter



Creating An Oscillator
Let's work with an example, and use the Biquad Filter from the previous setup, as seen below.

The perfect parameter for us to modulate of the filter is the frequency, of course! The first stage in this process is to create a simple low frequency oscillator (LFO). In Building Blocks > Oscillators, grab the Basic Oscillator object. This is our starting point to creating an LFO.


Rename the oscillator object 'LFO'. We are interested in the first two inlets - so create Variables for each of those inlets, and name them 'Variable Oscillator Frequency' and 'Variable Oscillator Amplitude'. Connect them to the oscillator object.

Set the data range for these tow variables to [0 - 20] and [0 - 1], respectively. This gives a frequency range of 20 Hz and an amplitude gain range of 0 to 1.




Why Should We Transform The Data Range?
Although the frequency parameter is obvious, the gain / amplitude parameter may not be. This parameter represents a multiplication factor that is applied to the oscillator's waveform. An amplitude setting of 1.0 means that the output of the waveform is multiplied by one.

Our sine wave's signal range goes from -1.0 to 1.0; therefore, an amplitude setting of 1.0 will leave this range at -1.0 to 1.0. However, if our amplitude setting is at 0.5, then every point along the sine wave is multiplied by 0.5, resulting in a signal range of -0.5 to 0.5.

Compare the two sine waves shown below as an example - the lighter wave has a range of -1.0 to 1.0, whilst the darker wave has a range of -0.5 to 0.5.



Finally, we need to scale and transform the output of our waveform in terms of the data range that the signal occupies - in other words, a data range of -1.0 to 1.0 may not be suitable for every parameter and every application.

For instance, our frequency input on our Biquad Filter object expects a data value range of 0 to 20,000. If we currently connected our oscillator to this inlet, we would be feeding it with a data source that has a range of -1.0 to 1.0, whereas we need to change our oscillator to sit within the appropriate range.





Scaling the Oscillator Data Range
The most useful object for this purpose is found in Building Blocks > Math > Function. Basically, this object takes up to three inputs - named X, Y and Z - and performs a mathematical function on them, and then sends the resulting data to the outlet.



Don't worry! This sounds complex, but it's really easy - as we're only going to be dealing with the X inlet (the first inlet), and we're only going to be doing simple things to it like addition and multiplication.

Now - let's consider the data range that we have, and the data range that we might like to end up with!
• Our oscillator is currently outputting a signal from -1 to 1
• Our frequency input from the Biquad Filter object has the range of 0 - 20,000 Hz
• However, we might only want a filter that sweeps from 0 Hz to 2000 Hz

So basically, we want to end up with an oscillator that has the signal range of 0 - 2000 instead of -1 to 1. We need to do two things: add something to our oscillator's output, so that we always stay in the positive with our signal (i.e. doesn't go below 0), and also multiply or increase our signal so that it goes all the up to 2000.

Logically, we can think about it this way: let's add 1 to the oscillator signal, and then after that, let's multiply the oscillator signal by 1000.

Double click on the Function object, and enter the expression as an expression of the X inlet. We can write that in the Function object like so: (X + 1.0) * 1000.

What we are saying by typing this into the Function object is: 'Perform this equation on every data value that arrives at the X inlet, and send the resulting value to the outlet'.




Connect the LFO to the Parameter
Now that our oscillator signal is properly scaled, it's time to connect the output of the LFO to the frequency inlet of the Biquad Filter objects, as shown below:

Of course, we can perform this same exercise with any parameter that we normally control with a variable control, opening up many possibilities for control.

Beyond this, also try to experiment with:
• Controlling LFOs using other LFOs
• Send more than one LFO signal to one parameter, but change the frequency, amplitude, etc independently
• Use filtered and scaled audio signals to control parameters of objects