Thursday, June 13, 2013

AutoTheory


As you may know, my company Pitchblende has been involved in the creation of several successful REs already. In association with Mozaic we have recently released a brand new RE to the Shop. It's called AutoTheory and, frankly, we think it's great!

The AutoTheory Harmonic Engine enables anyone, regardless of musical theory or keyboard training, to easily create professional-sounding melodies and harmonies.
AutoTheory makes it easy to play in harmony. Simply choose a key and a scale and AutoTheory will map all relevant chords and notes to the keys of your keyboard. Connect it to one or more Reason instruments and it will transform the way you play.
 
Play full chords with just one finger. Experiment by modifying chords with the chord sliders and modifier keys. Adjust individual chord note voicings and transpose or remove any note to create a customised chord. Create your own scales or select one from the many provided. Use what sounds good to you. 
AutoTheory automatically remaps notes to match your chords. Now you can easily improvise melodies that sound good. Maintain your hand in the same position while composing melodies over different keys, scales and chord configurations. Optionally lock specific chord tones to fixed white keys. Four mapping modes accommodate different levels of user experience. 
All controls in AutoTheory can be automated for easy transitions anywhere in a song. This means you can change the key or scale in the middle of a song without moving your hands. 
AutoTheory also provides a Strum effect that can be used to add drama to any chord. Subtle and extreme timing changes are easily applied and fully CV-controllable. 
AutoTheory can control multiple instruments at once. One option sends the root note of chords to a dedicated bass instrument. Four chord and four melody channels provide independent control of velocity and octave for each connected instrument. This allows you to create a rich soundscape - all from a single sequencer lane or just your own hands. 
CV inputs are provided, which are useful for driving AutoTheory with Arpeggiators and Pattern sequencers. 
Check out the included Demo Songs that demonstrate how to use AutoTheory. A set of useful Combinators is also provided.
Back Panel view

Available for Reason 6.5, 7 and beyond. You can try it for free for 30 days by visiting the Shop page. Also check out the comprehensive User Guide.


Pitchblende: like us on Facebook, follow us on Twitter, and find out more about us here.



Friday, April 5, 2013

kal zone

Here's a link to a great Reason blog by Kalle Nemvalts. Here you'll find several tutorials based on Reason 6.5, including a great tutorial about using Thor as a CV controller. There's some great material there, and he's taken the time to add lots of informative screenshots. Do take a look - you might learn something new.



Thursday, February 28, 2013

Update to Akai MPK mini Remote Codec

(image sourced from http://www.akaipro.com/mpkmini)
SCF kindly informed me that the Sustain button stops working after loading my Akai MPK mini Remote codec. I have confirmed this bug and fixed it in the latest version - 0.0.3.

If you've arrived here looking for the codec, head over here and read all about it.

If you're already using a previous version of the codec, you don't have to upgrade unless you want the Sustain button to be usable. If you do upgrade, please read the updated post carefully, as you will also need to re-upload the controller's Preset.

Wednesday, February 27, 2013

Selig Leveler, by Selig Audio & Pitchblende

Note: as of May 2013, The Curve is now known as the Selig Leveler. Videos remain as "The Curve".

In late 2011, Propellerhead Software announced that they would permit third-party plugins to be developed for the Reason environment. They dubbed these plugins Rack Extensions, or "REs".


The first set of new REs hit the online Propellerhead Shop in mid-2012, from the likes of Korg, Peff, Softube, u-he, iZotope and Propellerhead themselves. With the exception of a few, most were initially ports of popular VST plugins to the RE format. These helped get the ball rolling, however before long developers had created new and unique devices that really add a lot of value to the Reason platform. To date there are over fifty REs available, and the number is growing every week.


And as of approximately a week ago, there's now also one developed by my company Pitchblende and Giles Reaves of Selig Audio. It's called the Selig Leveler and you can see it for yourself here.




It is a brand new device that implements a novel technique for solving many dynamics problems. Giles neatly describes the function of the Selig Leveler here:
The Selig Leveler utilizes a unique approach to dynamics control, by applying upwards compression across a user specified range of the dynamic spectrum. This allows the Selig Leveler to target your compression like no other device, meaning the Selig Leveler can compress everything within a user specified range while leaving the loudest and softest signals almost completely alone. 

There's an introductory video that gives a good overview of what the Selig Leveler can do:



The device was designed primarily for assisting with the task of leveling vocal performances, a task that can be quite time-consuming using traditional compressors:




We put a lot of work into the Selig Leveler. Our focus is always on quality and bug-free operation, and I think we met that goal. Now that it has been released I'm happy to say that the reception has been very favourable. Several Propellerhead User Forum posts sprung up, with some neat demonstrations of how the Selig Leveler can be used on various source material, including this great video by DJStarski on drums:



If you are interested in dynamics processing, vocal leveling, or even fattening up your percussion tracks, I recommend taking a look at the Selig Leveler for yourself. Remember that you can take advantage of a 30-day free trial through the Propellerhead Shop.

You can follow my company Pitchblende's announcements on Twitter via @PitchblendeLtd or check out our Facebook page. Look out for new Rack Extensions in the near future...







Thursday, February 21, 2013

Improved Rotaries for the Akai MPK49 & MPK61

User bobseekone from the Propellerhead Forums has generously contributed a great new patch (which he calls ReasonEx) for the Akai MPK49 and MPK61 MIDI controller keyboards that turns the rotary encoders from absolute to relative positions. This means that you can switch to another device in Reason, move the knobs, and when you return to the original device moving the knobs does not cause them to 'jump' away from where they were. Another way to think of it is that Reason can remember where your controller knobs were for each and every device. Very useful - thanks Bob.

His patch also changes the buttons from toggle to momentary so that they can be used between devices more sensibly too. See Bob's blog for overview and details.

Disclaimer: I was involved in the creation and testing of this patch for the MPK49.

Saturday, October 15, 2011

Reason 6 Thor Voice Bug - Workaround

Update: version 0.0.2 fixes the fast-click problem reported by NaviRetlav.

I have developed a workaround to the bug described here that may be suitable for some situations.

It takes the form of a Combinator containing two Thor instances. When the bug is triggered the output from the first Thor is interrupted and this triggers the second Thor to generate a short pulse. This pulse is then used to gate the triggering of the first Thor's Step Sequencer, which has the effect of correctly resetting the Voice and reopening it.

This Combinator can be used to provide a reset pulse to any Thor in your workspace that relies on an open Voice, such as one that is using the Shaper to affect an external sound source (routed into the Thor). This pulse is generated whenever the bug occurs, thereby providing a way to recover from it.

A test-bench for this workaround can be found here (0.0.2). Simply open the file and you'll see the CV Debug combi on the left, and the Reset combi on the right. The top-right Delay device in the CV Debug (labeled "Reset Out") combi shows the state of the pulse. Hit Stop a few times to see the value jump from 1127 to down to 1000 briefly. You can adjust the length of the pulse with the first knob on the combi.

To use this pulse to reset another Thor, simply take this "Reset Out" signal into a CV Input on your Thor and use it as the Scale control (@ 100%) for your "LFO2 -> S.Trig" rule that you are using to retrigger the Step Sequencer. Look at the first Thor in the CV Reset combi for an example of this.

If you find this workaround useful or broken I'd appreciate some feedback please.




Reason 6 Thor Voice Bug

Update: I have developed a workaround, details are here.

This article is intended to explain the Thor Voice bug that has been observed by several Reason users in versions 4 through to 6. I first mentioned it here when discussing the Thor Shaper in Reason 4.

The bug concerns the way Thor handles creation of voices when it receives a trigger from the Step Sequencer. Normally, the Step Sequencer can generate triggers which open new Voice channels, allowing these channels to be used for effects (such as the LP Ladder filter, and the Shaper). By setting the Step Sequencer to trigger automatically via a trigger generated from the same Thor instance, it is possible to create a continuous Voice that stays open and provides an effects channel.

The bug is that hitting the Stop transport control, or selecting Export Loop/Song As Audio closes this Voice and the Step Sequencer fails to retrigger the Voice, and the channel is closed.

Earlier versions had a workaround, thanks to selig, that would help to solve the Stop issue, but not the Export Audio issue. Unfortunately with Reason 6 this workaround does not appear to work.

I present here a Reason 6 song file that clearly demonstrates the Stop issue. It consists of a Thor, a Subtractor synth that generates a continuous sequence of tones, and a second Thor that triggers the Subtractor. I did not use the Sequencer track to generate notes because I specifically want to show the behaviour when the sequencer is not running. Or to put it another way, the bug is a problem when you are working with the sequencer stopped, which is not uncommon when constructing patches.

When you open the example file, after an initial weird noise, you will hear the pulsing tone from the Subtractor, which is going into the Thor [Audio In 1], through [Filter 1], out [Audio Out 1] and into the Mixer. The Thor has a simple Step Sequencer (of one step) configured to generate a trigger and create the Thor Voice so that Filter 1 actually 'exists'. The Step Sequencer is triggered periodically by LFO2, and you will see that the Run button is automatically enabled & highlighted.

Now press Stop on the Transport panel - the sound will stop. Note that the Run button is still highlighted - this is because the LFO2 is frequently triggering it. But the Voice is not created and no sound will be heard. This is the bug. What should happen is that the retriggering of the Step Sequencer by LFO2 just after Stop is clicked should re-open the Voice and we'd hear the sound, but it does not and remains silent.

Manual intervention is required to restore the Voice - now click the Run button once, it will briefly go off and then be retriggered by the LFO2, and the sound will return.

Pressing Play will also 'fix' the problem, but again this is primarily an issue when working with the Sequencer stopped.

A similar issue, but not demonstrated by this example (I'll need to create a slightly different version) occurs after Exporting As Audio.

As anyone who follows this blog will know, I work a lot with CV within Reason. I like to create all sorts of interesting CV devices, and Reason provides almost an unlimited capacity to experiment with these things. In this regard it is almost bug-free, but this one particular bug is a real problem for my designs and I've yet to find a suitable workaround in Reason 6.

It also significantly reduces the usefulness of the Thor Shaper as a viable audio effect.

Thor patch to demonstrate Voice bug.




Monday, September 26, 2011

Akai MPK mini & Reason

Introduction

Note: there appears to be a newer version of the Akai MPK Mini Editor that is not compatible with the files I provide, or the process outlined below. If you don't have the older version, these instructions may not work for you. If anyone is able to shed some light on the situation I'd be happy to make mention.

In 2011 I picked up the Akai MPK mini, a "laptop production keyboard" clearly focused on portability.

(image sourced from http://www.akaipro.com/mpkmini)

I haven't used it enough to write a proper review yet, but there was one thing that did annoy me about it right out-of-the-box - it doesn't have any dedicated MIDI support in Reason or Record!

I should explain. MIDI controllers communicate with Reason & Record via a "codec" and a "remote map". The codec translates and associates incoming MIDI messages to specific 'control items', and the remote map is used to map these 'control items' to different Reason device controls.

But what makes your controller really useful is that a properly supported controller will auto-map its controls onto specific Reason device controls as you change devices.

For example, you can have a knob that maps to the first Combinator knob when a Combinator has MIDI focus, but then maps to the LPF frequency slider when you change to a Subtractor. The mapping is device-dependent and Reason takes care of it for you. You can also customise this mapping yourself.

Almost any MIDI controller will work with Reason as there are several 'generic' codecs that simply map keys, wheels, knobs, pads and sliders to generic 'controls'. But sadly if you are forced to use these codecs then you lose the auto-mapping feature - now your control simply generates a MIDI CC message on a fixed channel and this may correspond to... anything.

(Note that you can always use the 'remote map override' feature to assign any control to any Reason control - this can be useful occasionally but it's tedious to set up and does not scale to a full controller).

My Solution


I have created suitable Lua Codec and Map files for the Akai MPK mini. If you use these, you will be able to make almost full use of the device, and the knobs and pads will map to sensible controls on each Reason device. If you wish to customise the per-device mapping, simply edit the .remotemap file and add your own rules.

The latest version supports:
  • Compatible with Reason 5 / Record 1.5 to Reason 6.5.3 - may work with future versions too.
  • Kong pads - turn off CC and PROG CHANGE, then Pad Bank 1 maps to Kong pads 1-8, Pad Bank 2 maps to pads 9-16.
  • Switches - turn on CC and each pad will act as a switch. Pad Bank 1 maps to switches 1-8, Pad Bank 2 maps to switches 9-16. Note that 'toggle' mode for the switches does not work correctly, and probably never will, so the pad lights will not stay lit.
  • Prog Change - turn on PROG CHANGE and each pad will generate push-button events. Currently these are set up to send Transport messages:
    • 1 - rewind
    • 2 - ffwd
    • 3 - stop
    • 4 - play
    • 5 - record
    • 7 - change to previous sequencer track
    • 8 - change to next sequencer track
  • Knobs - eight knobs that are mapped to 'sensible' Reason controls. Note that Knob 1 is the top left knob.
  • Keyboard Sustain (Damper Pedal) support - hold the "Sustain" button to activate.
I used the Akai LPD8 lua codec and MPK49 remotemap files that ships with Reason as the basis for this project. I used an image of the MPK mini from Akai's website for the device picture. Akai's support page is here.

Upgrading to 0.0.3 - important note!


If you are upgrading to 0.0.3 from an earlier version, you must reprogram your controller using the "Akai MPK MINI Editor" as the CC values generated by the pads have changed.

To upgrade, simply follow the Installation procedure again. You do not need to remove the old files, just make sure you overwrite them with the new files from the zip file.

If you have performed any of your own customisation (for example the .remotemap file), be sure to back up your changes before upgrading. You will have to manually reapply your changes afterwards.

Installation


The latest version 0.0.3 is available here. It is a zip file. Unzip it somewhere handy.

There are two parts to this installation process. Part 1 involves copying the Remote files to the correct destination on your system. Part 2 involves reprogramming your MPK mini with the provided Preset. You must complete both parts to have a successful installation.

Part 1 - Copy the Remote Files


The files in the Remote directory should be copied into your user's Remote directory:
  • OSX: Macintosh HD/Library/Application Support/Propellerhead Software/Remote
    • it is also possible to install into /Users/[username]/Library/Application Support/Propellerhead Software/Remote if you want to keep them separate from your main Reason installation.
  • Windows XP: C:/Documents and Settings/Application Data/Propellerhead Software/Remote/
  • Windows Vista: C:/Documents and Settings/Program Data/Propellerhead Software/Remote/
  • Windows 7: C:/ProgramData/Propellerhead Software/Remote
Carefully copy all of these files, strictly maintaining this directory structure:
  • Remote/Codecs/Lua Codecs/Akai/AkaiMPKmini.luacodec
  • Remote/Codecs/Lua Codecs/Akai/AkaiMPKmini.lua
  • Remote/Codecs/Lua Codecs/Akai/AkaiMPKmini.png
  • Remote/Maps/Akai/AkaiMPKmini.remotemap
Now restart Reason so that it sees the new files. Go into Preferences and select your new MIDI controller - you can tell Reason to try and auto-detect the MPK mini, or you can add it manually.

But before this will work, you must set up the MPK mini to generate the correct MIDI messages. Now complete Part 2.


Part 2 - Load the MPK mini Preset


The provided Preset ensures that your keyboard produces the correct MIDI messages are received by the Remote codec (which you installed in Part 1). To install the Preset:
  • Ensure neither Reason nor Record are running - they may interfere with this process.
  • Run the "Akai MPK MINI Editor" (on the CD provided with your controller, or downloadable from Akai's product support page)
  • Click "Load Preset" and load the "Reason.preset" file from the Presets directory that you earlier unzipped.
  • This will automatically switch the display to Preset Slot 1, but you can upload the new preset to any Slot you wish by clicking the "Preset #" drop-down and select the slot number you want to upload into:

  • finally click the "Upload" button, and then click OK:

  • You can repeat this upload process for the other Preset Slots if you like, but note that uploading a Preset to a Slot will completely overwrite any data already there.

 (Previous versions had four identical Preset files, one for each Slot. However I realised that you can upload one file to any Slot with the above procedure, so now there is just one Reason preset).

In version 0.0.3 I have adjusted the CC values generated by the Pads to start at 65, rather than 64, as the first pad was interfering with the Sustain function.



Customisation


Because the Lua Codec maps almost every control on the controller to a 'control item', you can customise the device mappings however you want. Simply edit the AkaiMPKmini.remotemap file to associate the MPK mini's controls with whatever Reason device controls you want. More information can be found here.

The available control items are:
  • Keyboard
  • Sustain
  • Knob 1-8
  • Pad Button 1-16
  • Prog Change 1-16

Updates

Update 28th February 2013 - version 0.0.3 released, see post for details. If you are upgrading, please read this post carefully.

Update 2nd October 2011 - version 0.0.2 appears to work fine in Reason 6 (OSX).

Update 30th September 2011 - version 0.0.2 released, see below for details.

Release History

Version 0.0.3 - 20130228
  • Added support for Sustain / Damper Pedal.
  • Adjusted base CC for pads from 64 to 65.

Version 0.0.2 - 20110930
  • Added support for Transport controls in Record 1.5.

Version 0.0.1 - 20110926
  • Initial release, supports AutoDetect, Kong pads, CC pads (switches), Prog pads (transport), and knobs. All four presets are identical.
  • Tested in Reason 5 on OSX only.

Disclaimer


I am not affiliated or associated in any way with Akai or Propellerhead. I have created these files myself with the files and programs legally available to me. 

You download and use these files entirely at your own risk!


Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 New Zealand License.

Sunday, June 27, 2010

A Close Look at Thor's Shaper


Quick Links

Thor's Shaper is a modest device - it sits nonchalantly between Filter 1 and the Amplifier module and to me it was shrouded in a certain mystery. The Reason Operation Manual doesn't give much away, mentioning it briefly on page 215:


"Waveshaping is a synthesis method for transforming sounds by altering the waveform shape, thereby introducing various types of distortion. The Shaper can radically transform the sound or just add a little warmth, depending on the mode and other settings.

There's a brief mention of how to use it, and the names of the nine modes it supports, but that's about it.

I thought it might be useful to take a closer look at the Shaper and see if I can determine what it actually does.

First, a few things you need to know about the Shaper.
  • the Shaper has to be enabled to do anything interesting, obviously.
  • only Filter 1 output can go into the Shaper - the manual says:
"You can also route other sources directly to the Shaper in the Modulation section."
    but this is not correct. The Thor modulator destinations only include "Shaper Drive", and not the Shaper audio input. If you want to direct anything into the Shaper, you need to direct it into the Filter 1 audio input, and then typically select Filter 1 Bypass to disable any filter that is there.
  • the Shaper will not do anything until you trigger a "voice" in the synth. This means hitting a note on your keyboard when Thor has controller focus, using the sequencer to play notes through Thor, or using the Step Sequencer to allocate a continuous voice by latching the Step Sequencer trigger and setting the gate length to 100%.
  • the "Drive" control can be used to change the effect that the Shaper has on the sound. It can be set to a specific value or modulated by the Mod Matrix. A signal can also be routed directly into "Shaper Drive".
  • typically you'll use it to shape audio, but you can also use it to shape CV signals as well.
  • Thor has a bug.
So what does the Shaper actually do? Simply, it shapes or distorts the incoming signal according to the mode selected and the Drive setting. In most cases, the distortion is non-linear.

It is important to understand what non-linear distortion means. To do that, let's talk about linear systems first.

Linear & Non-linear Systems

A linear system is essentially (yes, I'm going to keep it simple) one in which the output scales proportionally with regards to the input. This means that if you have one input signal and you double its amplitude, you will see the output signal double too. If you have two input signals and you add them together before putting them into the system, then the output you see will be the same as if you put each signal into the system independently and then added the outputs. This is called the principle of superposition.

Linear distortion, where a signal is altered by a linear system, is pretty common. Essentially, you multiply the signal by a number so it's either larger (amplified) or smaller (attenuated). Static filters such as low-pass filters with an unchanging cut-off are examples of such distortion. Certain frequencies are cut out or boosted by amplifying or attenuating those frequencies. I'm deliberately ignoring phase effects mmmkay? :)

This leads to an important aspect of linear systems - you can only get out an amplitude- (and phase-) modified version of the frequencies you put in. If you put in a sine-wave at 100 Hz, you can only get a sine-wave at 100 Hz out, although it might be louder or quieter than the input.

A non-linear system on the other hand is an entirely different beast. The easiest way to define such systems is to simply consider them as systems that are not linear! In all cases, the output is disproportional to the input or inputs. This means you might put in 100 Hz and get out 372 Hz, or put in 100 Hz at one amplitude level and get an output that modulates amplitude over time.

Most systems in real life are non-linear but engineers prefer to think in terms of linear systems because they are a gazillion times easier to analyse. In many situations a complicated non-linear system can be broken down into a number of simpler, linear systems and analysed to a certain level of accuracy.

Thor's shaper is a non-linear system, but it's a relatively simple one. It contains no dynamic internal state so there's no time-based distortion effects. The shaping is simply done by a non-linear function selected by the Shaper Mode. Unfortunately it's not easy at all to reduce this to a simpler set of linear systems, but we can still learn a lot by looking at its behaviour.

Linear & Non-linear Functions

Consider the function f(x) = x/2, or y = x/2, which looks something like this:

(thanks Wolfram Alpha)

Consider an input signal of some value "x" - look along the horizontal x-axis for the value x, move straight up until you hit the diagonal line, then move directly across to read the corresponding output on the vertical y-axis. It's fairly straightforward to see that this function divides all incoming signal values by 2 - it always halves the amplitude of the input signal, regardless of what the actual input is. This is linear distortion.

What about this function, y = x2?


This is a parabolic function - the output is not proportional to the input signal, but to the input signal squared. Look at x = 0.5, the output is 0.25. The signal is attenuated by a factor of 2. When x = 1.0, the output is unchanged at 1.0. So the amount of this attenuation depends on the input value. Therefore the output is disproportional to the input signal - this is non-linear distortion.

If the function goes through the origin (where the axes meet), then that means that an input value of zero produces an output of zero. This has implications for zero-frequency (DC) offset that I might talk about later.

Thor's Shaper implements nine different functions in this manner, but also provides a "Drive" parameter. This parameter simply affects the shape of each function in a particular way - for one mode it might change only part of the function slightly, in another mode it might result in a completely different function altogether. Since there are 128 possible drive settings, you could consider there to be 128 different functions for each Shaper mode.

With this in mind, now I'm going to introduce and explain each mode and how the Drive parameter affects it.

Shaper Modes

In the following sections, for each mode, you will see two plots. These are screen shots from Audacity of signals generated in Reason and distorted by Thor's Shaper. Each plot has nine waveforms - these are measurements of the Shaper at various Drive levels from 0 to 127 - 0, 16, 32, 48, 64, 80, 96, 112 and 127.

Each waveform is independent of the others - it's just easier for me to present them on a single axis. Zero on the horizontal axis is in the centre of each waveform (where the diagonal line crosses the axis in this case). Zero on the vertical axis is where the horizontal axis lies.

The first plot will be a representation of the Shaper function, obtained by passing a rising full-scale linear signal (sawtooth) through the Shaper and recording the output. This is essentially just reading out the values in the function look-up table (if Thor uses such a thing). In this example, the Shaper is turned off and output is directly proportional to the output - in fact it's the same, or y = x:


If the function is linear, then the output will look exactly like one of the graphs above. In this example only, all nine waveforms are practically identical because the Drive parameter has no effect when the Shaper is disabled.

The second plot is an example of what the Shaper does to a pure sine-wave input for each drive setting:


Because the Shaper is switched off in this example, the function is again y = x and the sine-wave is unmodified regardless of the Drive parameter. For other modes it's interesting to see the effect on the sine-wave but its usefulness is limited - remember that the Shaper is non-linear so you cannot apply the principle of superposition! Adding sine-waves together before the Shaper input does not give you the same result as adding the result of passing through separate sine-waves. A particular function might generate a harmonic for a single sine-wave input, but two sine-waves might do something else entirely - see Intermodulation Distortion below.

In all cases, you can click on an image to view a full-resolution version.

I used these RNS files to generate the signals by "exporting loop as audio":

WARNING
For the CV Scope, the connection from the main mixer to the hardware device is deliberately disconnected. Do not reconnect the audio output unless you have turned off your speaker system first! I am not responsible for any damage that might result if you try to drive CV signals through your expensive amplifier or speakers!!



Soft Clip

function

sine-wave

This is a simple distortion that reduces the range of the incoming signal as the drive increases by clipping the signal. Compared with the hard clip, there is a more gentle, rounded characteristic to the clipping. Note that at zero drive it is not quite linear - there's a small distortion in linearity and a small attenuation of amplitude. At high drive the distortion is very distinct, very similar to the hard clip mode, and will introduce many new frequencies.

sine-wave chord



Hard Clip

function

sine-wave

This is a very simple and nasty type of distortion that simply limits the input signal to a maximum and minimum level according to the drive. It is similar to the soft clip mode except that the function has no gentle rolling off before the clip takes effect. At zero drive, the function is practically linear, and at maximum drive it's pretty much a step function except for a very narrow range near zero, just like the soft clip at this drive. This distortion adds significant new frequencies at higher drives.

sine-wave chord


Saturate

function

sine-wave

It is my understanding that the saturate mode is meant to model the behaviour of a transistor that is fully turned on. There is a linear section near the origin, but as the signal approaches the upper and lower limits, the saturation function pulls it back in. It's essentially a smoother version of the soft clip, which means it puts less energy into the higher harmonics.

sine-wave chord


Sine

function

sine-wave

This is a weird one - the shaper function is actually a sine-wave itself. I'm not sure what the intent of this function is, but it's pretty strange. At low drive, it's a bit like saturate with an attenuation at extreme input values. At higher drives, the frequency of the 'sine-wave' increases rapidly, essentially producing what I'd consider to be a fairly random effect. Consider an input signal value of x, with a drive of 127 - the output value is going to be almost anything, and will change dramatically for very small changes of x. It's pretty unstable.

This mode has some interesting and dramatic results if you automate the drive control, so that it changes as the sound plays through the shaper.


sine-wave chord


Bipulse

function

sine-wave

Another slightly strange distortion mode - I imagine it's called "bipulse" because at higher drives the function looks like two pulses, one inverted. Notice that the output signal for any input is greatly attenuated for any drive setting - even at minimum drive, the signal is no more than 25% of the original amplitude. At lowest drive, it's very similar to the sine or saturate function. As drive increases, the attenuation becomes even more dramatic. It's as if the signal almost disappears. I'm really not sure what I'd use this function for, but if you put in a very quiet signal, you would get an amplified output, whereas louder inputs would tend to disappear to nothing.


sine-wave chord


Unipulse

function

sine-wave

Yep, another unusual function. This is actually an even function, which means that it reflects negative input signals back into the positive half; notice the sine-wave above, it never goes below zero. In many ways, this function is a bit like a soft clip followed by a rectify - at low drive, it rectifies and amplifies then clips the input signal. At higher drives, the clip level decreases and the amplification domain becomes very small. At maximum drive this mode essentially creates a fixed DC signal and not much else.


sine-wave chord


Peak

function

sine-wave

The peak mode has two main effects - first, it cuts out all positive input input, which reduces the energy in the output by half. Second, it clips the negative input. So it's really just a soft clip or saturate with the bottom half cut off.

One unexpected use of this mode is to implement a unipolar step function for CV processing - at maximum drive, the output is zero for negative CV (0-63), and -64 for positive CV (64-127). All you have to do is invert this and you've got a nice step function.

sine-wave chord


Rectify

function

sine-wave

Now we're getting interesting - this function has some interesting properties. At zero drive it's linear, and at low drive the bottom is attenuated. At mid-drive, the lower half of the input signal is zeroed out and energy is lost. At higher drives, things get very interesting - the lower half is mirrored up into the top half, and this has three effects - first, fundamental frequency is doubled; second, the fundamental frequency is eliminated; third, even harmonics are introduced.

You can also use this function with CV processing to zero-out half of the input signal by setting the drive to 63. Unfortunately, the function is not quite zero for negative CV input, so you don't get a pure zero. An inverted peak works better in this case. The advantage is that this function retains linearity for the upper half of the input signal domain.

sine-wave chord


Wrap

function

sine-wave

And now for the strangest function of them all. I'm really not sure how to describe this one. At low drive, it's linear, but as the drive increases the upper half of the input signal is quickly attenuated non-linearly, and then inverted! Yet the maximum positive input is still passed through unmodified. As drive increases further, it just gets weird. Look at the way it distorts a basic sine-wave. Crazy stuff!

sine-wave chord



Frequency Analysis

I set out intending to examine each mode according to its frequency response. But I quickly hit a problem - non-linear systems don't lend themselves to frequency analysis very easily at all. Since the usefulness of this analysis is very limited, I decided to give this a miss.


Audacity does do some very nice spectrum analysis plots though.


Intermodulation Distortion

Intermodulation (wikipedia) is a phenomenon of non-linear systems where two input frequencies combine in a way that does not produce harmonics, but typically sum and difference frequencies. It's essentially an interaction between the input signals - they mix together and produce new frequencies which are typically non-harmonic, or "off-key".

This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 License.

It's intermodulation distortion that makes non-linear systems difficult to analyse, as well as sometimes sound very cool. It also means that the sine-wave plots throughout this article are indicative only - simply add a second sine-wave and you'll get completely different results. Put in more complex signals and who knows what you'll get out...

As I was writing this, something occurred to me. If you take a typical Thor sound patch and play a chord, Thor creates a separate voice for each note. Each voice has its own Shaper, so you're only playing one note through each Shaper - the result is mixed together later. This completely avoids any intermodulation distortion created by different notes. If you want to create this sort of distortion, which sounds completely different, you need to route the mixed audio into another Shaper. Here are some examples of the same chord played through a separate Shaper:

soft clip
hard clip
saturate
sine
bipulse
unipulse
peak
rectify
wrap

Here's the RNS file:

Using the Shaper for CV Processing

Normally the Shaper is used for audio distortion, but with a few considerations it can also be used to process CV signals. This opens up some very interesting possibilities.

Shultz designed a Triple Cross Fader using the Shaper's rectifier mode. This brilliant design uses the drive set to maximum which implements two piece-wise linear functions. You can read all about this here.

During the development of my 8-bit Adder, I encountered an issue where one of my CV signals was growing very, very large. This was causing the Thor scaling to fail. To fix this, I fed the rogue CV signal into a Thor Shaper with the hard-clip mode set to zero drive. This clipped the CV signal at 127 rather than whatever high value it had reached, and this allowed the Thor scaling to work properly again, regardless of what processing happened before.

In order to use the Shaper for CV processing, there's a trick you need to know. Because the Shaper is located in the "per-voice" section of Thor, it is only available when Thor is playing a note. Or at least when Thor thinks it is playing a note.

To do this, route your incoming CV source into Filter 1 Audio Input, then route the Shaper output to wherever you want the output to go. The trick is to use the Step Sequencer on Repeat Mode with a single step of gate length 100%, and to tie the Step Sequencer Trigger to LFO2, set to square wave. Also, set LFO2 to trigger the Amplitude Envelope (with A=99ms, D=max, S=max, R=max). The LFO2 rate and Step Sequencer rate don't seem to matter too much (but see the bug below).


I've created a basic template for this here.

The Bug

I co-discovered an unfortunate bug in Reason 4. Although the above self-triggering of the Step Sequencer works fine after loading a file, sometimes after exporting an audio clip, or even hitting "stop", the Thor Step Sequencer stalls. The 'Run' light remains on and the Step Sequencer is running - you can see the lights flashing above the steps - but there's no output. To reset this condition, simply click the Thor Run off then on. You can set the gate length to 99% to avoid this problem, but this will introduce very obvious glitches between each step. Not good.

This bug is a bit of a shame really, because it's just serious enough to make the Shaper unreliable. To get around this, I am considering making all of my Shaper devices 'resettable' - an external signal will toggle the trigger. Then I just need a way to generate this signal on "stop" - this same behaviour can be exploited to do this, as long as this behaviour remains consistent in future versions of Reason... (*ahem*).

Update: selig has suggested an excellent workaround for this bug here, using the global LFO2 to trigger a voice's Amplitude Envelope. I have created an updated template here and the old one is still available here. This design solves the "stop" bug, but still has an issue after exporting audio. The fast LFO2 rate retriggers as soon as possible. If you don't care about the export issue, you can turn down the LFO2 rate if you like.

Using the Shaper as a Standalone Effects Device

The Shaper is a mono device - it can only process a single audio channel at a time. However you can use it to process any audio, not just Thor's oscillator signals. With this in mind, and using the same principles as the CV Shaper above, you can use the following patch to do this - just wire your incoming audio into Audio In1, and take the result from Audio Out1.
If you want to process a stereo signal, just use two of them.

The Random Element

The Reason manual mentions that the Shaper has a slightly random element:
"... there is a slightly random element to the resulting distortion."
I'm not sure what this refers to. During my analysis the shaper functions were very well defined and always returned the expected values. I did notice a couple of glitches (if you look carefully you may see them in the plots above) but I put these down to Step Sequencer glitches briefly disabling the shaper. Other than that, I didn't see anything random at all. Maybe someone at Propellerhead can enlighten us?

Spiky Glitch

One other observation - sometimes the first value that is fed into the Shaper for each 'scope' sweep outputs an extreme low value. You'll see this as a little downward spike in the function graphs above, on the left, just as each one starts. I wasn't able to determine what causes this - I'm not even sure if it's a consequence of "exporting to audio file" or whether it's either related to the way the Step Sequencer works, or behaviour of the Shaper when it is given a zero input for a period of time. Any ideas?

Conclusion

This might be the longest article I've written for this blog so far - it certainly took the most time. Hopefully, if you've read this far then you now have a better understanding of what Thor's Shaper actually does in each of its modes.

In my opinion, the effect that the Shaper has on many sounds is a bit unpleasant, although with care it can be used to add warmth. It should work differently on chords because of intermodulation, but by default a separate instance is used for each note/voice, so you have to route into a Shaper yourself.

I don't think it's quite as pleasing as the Scream4 but it is a handy device to have around and its use in CV processing is also very powerful.

If you have any comments or questions, please do submit them - it's always great to get feedback.

Saturday, June 26, 2010

Akai MPK49 Pad Modification

A few years ago I did a light review of the Akai MPK49 MIDI keyboard controller. Subsequently I bought one and I've been happily using it since.



However one thing consistently bugged me (and everyone else) about the design - the drum "pads" are terrible. You have to hit them quite hard to even register a hit, let alone a loud one. Because I'd never really used such pads before, it didn't bother me too much. But Kong is coming...

So when I saw these two threads on the Propellerhead User Forum, I knew I had to give this a try. I'm really glad I did.

This video is a nice guide on how to take the MPK49 apart and get access to the rubber pads. There are 28 screws to remove, but it's not very difficult. The video author does a good job showing how to get inside, so I'm not going to rehash that here.


Some things to remember while taking apart your precious MIDI controller:
  • use a manual screwdriver rather than a motorised one as in the video - take note of how much torque is required to unscrew those twenty rear-plate screws, and when you put back together again, do not tighten them up any more than that. You're screwing into plastic - you do NOT want to strip the threads!
  • also try not to cross the threads when you're putting the screws back in, or you'll risk stripping the threads.
  • when you remove the little PCB, watch out for that little 1-inch ribbon connector. It's not too fragile I suspect, but try not to pull on it if you can.
  • when removing or replacing the rubber pads, be careful not to damage or scratch the underlying sensor array. I don't know exactly what it is (PVDF perhaps?) but it looks delicate.
  • when you replace the outer case, be careful not to trap the ribbon cables that might stick out the back.
 
The fundamental problem with the pads is that there is a gap of approximately 1mm between the bottom of each pad and the pressure sensor underneath. This means you have to hit or press the pad hard enough to travel that 1mm before any pressure will be sensed, regardless of the pad sensitivity settings within the MPK49. It doesn't matter how sensitive you set the software within the keyboard to be, that gap is always going to be a problem.

The simple solution is to fill the gap up with something. Many people, including that video, recommend using four layers of electrical insulation tape underneath the rubber pads. But electrical insulation tape? Really? I hate that stuff! After a while, the adhesive oozes out and goes everywhere, it's horrible, horrible stuff. Avoid!

Instead, I decided to use some cloth tape, sometimes rightly or wrongly called "duct tape", or occasionally "gaffer tape" (although mine isn't black nor has it a matte finish). The nice quality about this tape is that the adhesive is pretty stable and doesn't migrate much, but it's also pretty sticky. It's also quite robust and for this application it should hold its thickness over time.

I didn't know how much I'd need initially so I put a strip onto some grease-proof baking paper and ruled out 15mm x 24mm rectangles. The baking paper made it really easy to cut the tape to the right size and then peel it off for application without contaminating the glue with dust or clothing lint.


I started off with just a single layer on a single pad. I reinstalled the rubber pads and gave it a try. The improvement was considerable - in fact I was very tempted to leave it at that. But of course I'm not one to take something apart without trying out a few things...

So I tried two layers. This was even better! I could now do cool drum rolls with my fingers and I wasn't constantly 'missing' the pads and sounding incompetent.

Once again, I was going to leave it at two layers, but just to make sure I tried out a few pads with three layers.




Wow! The improvement is dramatic! I barely have to exert any pressure on the pads at all to get a decent signal, yet I don't get spurious hits either. Three layers is definitely where it's at in my opinion.

But three layers of the tape I've got doesn't mean much to anyone else, so I measured it for you.


Without going into the gory details, I ascertained that the tape is approximately 0.3mm thick, and I used three layers, so that's a total thickness of 0.9mm, with an error of, let's say, +/- 0.05mm. When you look at the underside of the rubber pads end-on, you can see the top layer of tape just below the edge.

(I used the coin as a known thickness to measure inside the pad cavity - the coin is 2.15mm thick on the edge, I measured 8.05mm without tape, and 8.97mm with three layers of tape. This is about 0.3mm per layer.)

Once you've put it all back together, you can set the pad sensitivity, threshold and curves to whatever you want. I'm using threshold 1, sensitivity 16, curve A and it seems to work fine.

The Akai MPK49 is a great but not perfect keyboard. If you have one, I definitely recommend doing this mod - it's not hard, just take your time and think ahead. In total it took me about an hour with all the measuring, experiments, etc.

Bring on Kong!