Pattern Based Music Sequencing

This project demonstrate technuiques that enable pattern based sequencing in Cubase 5. In Cubase a MIDI part can appear multiple times. This is done by Repeating a MIDI part with the “Shared Copies” option enabled. This enable the same MIDI part to play mulitple times, and since all copies are shared editing will affect all copies. Great. There are however some limitations on MIDI parts, that limit the use of patterns a lot.

  • It is not possible to override events in a MIDI part by overlaying them with another MIDI part. Thus it is not possible to “mute” MIDI events in a pattern in some places and not others. In contrast overlapping one audio event with another audio event will “mute” the first audio event where the events overlap.
  • It is not possible to link automation to MIDI parts. Thus it is not possible to control automation from the MIDI patterns. This reduce the usability of the patterns quit a lot.

It is possible to find workarounds for both limitations.

Using MIDI Controllers to Control Automation

In Cubase it is not possible to control automation directly via MIDI CC. Some VST instruments and effects support automation via MIDI CC. This document describe a method that enable almost all automation to be controlled via MIDI CC.

It is possible to link MIDI CC to automation via a “Remote Control” device. A “Remote Control” device receive MIDI data and translate that into various kinds of actions. One type of action is to control parameters of tracks, instruments, etc. In this way external MIDI hardware can control almost any parameter in Cubase. It is not possible to connect a MIDI track inside Cubase to a “Remote Control” device. This means that external hardware can control Cubase via MIDI, but a MIDI track inside Cubase cannot. There are ways to workaround this limitation.

To connect a Cubase MIDI track to a “Remote Control” device the MIDI data must be send out of Cubase and back into Cubase. A software MIDI “loopback” cable such as loopMidi or MidiYoke makes this possible. The MIDI track sends MIDI data to a virtual MIDI port and the “Remote Control” device receives the MIDI data from this port. Before using any virtual midi cables it is very important that all the virtual midi ports are removed form “ALL INPUT” in Cubase, otherwise there will be a infinite loop, and Cubase will freeze!

A “Remote Control” device is installed into Cubase and is not saved in the project. Therefore it is best to design a “Remote Control” device that will work for all projects. This can be done by creating a “Remote Control” device that control the “Quick Controls” of the tracks in the project. This way the “Remote Control” device can control different parameters without any modification.

Step 1 : Install Virtual Midi Ports

Install “loopMidi” or another virutal MIDI loopback device. If “loopMidi” is used create four MIDI ports can call them:

Mapping-1
Mapping-1 Out
Mapping-2
Mapping-2 Out

The first thing to do after installing the virutal MIDI ports is to remove them from “ALL INPUTS”. Otherwise there will be an infinite loop of MIDI events.

Step 2 : Set up Automation Tracks

  • Add a folder called “Mappings-1”.
  • Add 16 MIDI tracks to this folder. Name them “M1-01”, “M1-02”, “M1-03”, etc.
    • Midi Input to “Not Connected”
    • Midi Output to “Not Connected”
    • Mute to “Defeat” (<Alt> click on mute).
  • Add a folder called “Mappings-2”.
  • Add 16 MIDI tracks to this folder. Name them “M2-01”, “M2-02”, “M2-03”, etc.
    • Midi Input to “Not Connected”
    • Midi Output to “Not Connected”
    • Mute to “Defeat” (<Alt> click on mute).

There are now 32 tracks which will be used to map MIDI CC to automation. Each track can automate 8 parameters. Thus it is possible to automation 32 * 8 = 256 different parameters.

Step 3 : Set up Generic Remote Controls

  • Open the “Device Setup” Window.
  • Add a Generic Remote control.
    • Import ”Mappings-1
    • Set Input to “Mappings-1”
    • Set Output to “Mappings-1 Out”
  • Add another Generic Remote control.
    • Import ”Mappings-2
    • Set Input to “Mappings-2”
    • Set Output to “Mappings-2 Out”

Step 4 : Set up MIDI Tracks and VST Instruments

  • Insert a VST Instrument in Slot 1
  • Alternative 1: In the MIDI track linked to the VST Instrument.
    • Set MIDI Send 1 to “Post” (More about this later).
      • This means that this MIDI Send will see the MIDI date after it has been affected by MIDI inserts.
    • Set MIDI Send 1 to output to “Mappings-1” channel 1.
    • Set MIDI Send 1 to Transform and load the Insert Exclusive CC111-118 preset.
      • This will send CC111 to CC118 to “Mappings-1” channel 1.
    • Set MIDI Insert 1 to Transform and load the Delete All present.
      • This MIDI Insert will “mute” all MIDI events. Automating “Mute” on a MIDI track does not work correctly, so this is a workaround to be able to mute a MIDI track via automation.
    • Set MIDI Insert 1 to Off! (Otherwise there will be no sound)
      • Because MIDI Send 1 is set to “Post” this send will also be muted when MIDI Insert 1 is on.
    • On my computer the Logical Edit presets are located in “C:\Documents and Settings\<User>\Application Data\Steinberg\Cubase 5\”.
  • Alternative 2: In the MIDI track linked to the VST Instrument.
    • Set MIDI Send 1 to Transform and load the Insert Exclusive CC111-118 preset.
    • Set MIDI Send 1 to “Pre” (More about this later).
    • Set MIDI Send 1 to output to “Mappings-1” channel 1.
    • Set MIDI Insert 1 to Transform and load the Delete All present.
    • Set MIDI Insert 1 to Off! (Otherwise there will be no sound)
    • Set MIDI Insert 2 to Transform and load the Delete CC111-118 preset.
    • On my computer the Logical Edit presets are located in “C:\Documents and Settings\<User>\Application Data\Steinberg\Cubase 5\”.

If working with an Instrument track the procedure is almost the same, just skip step 1. In general it is more flexible to use the VST Instruments slots compared to Instrument tracks. In this case the setup is more robust when tracks are moved around.

If working with an Audio tracks the procedure is also much the same. Skip step 1 and start by adding an Audio track. It may be a good idea to put the audio and MIDI tracks in a folder to keep them together.

Step 5 : Set up mappings of CC to Automation

  • Open the “Mappings-1” folder and select the “M1-01” track.
  • Open the “QuickControls” panel.
  • In QuickControl slot 1 <ctrl> click.
    • Select “VST Mixer” > “VST Instruments” > Etc.
    • Select the automation parameter to automate.

Freeze Tracks

The standard Cubase “freeze” function does not work for tracks that use automation via midi CC. If the standard “freeze” function is used, the track will be “frozen” without automation. There are two ways to workaround this.

  1. Record the midi CC automation as normal automation and then freeze the track.
  2. Record the audio output of the track on a group track. This solution seems to work best.

Convert midi CC automation to normal automation

Before freezing an instrument record the midi CC automation on the instruments automation track.

Before Freeze:

  1. Record Automation.

After Unfreeze:

  1. Delete Automation

Notice that MIDI CC automation “jump” to new values and track automation slide to new values. This may create audible differences! To avoid this problem make sure that there is only a very little distance between to new and the old CC value. This is done by repeating the previous CC value (min 3 times) just before the new CC value. It would be nice if there was a more automatic solution to this problem.

Overlapping Parts

Since automation is used to mute the track with the repeating pattern it is only possible to see how much of the track is muted in the arranger window. If the MIDI parts in the overlaying track is set to the same size as the muted area, it makes it a lot more easy to work in the key editor.

Pre or Post MIDI Sends

MIDI sends set to pre will not be affected by MIDI inserts. This means that the special MIDI insert used to “mute” MIDI events will not affect them. This means that MIDI sends set to pre must be muted by deactivating that MIDI send, and that MIDI sends set to post can be muted by activating the special “MIDI Mute” insert.

Recording Automation as MIDI CC

If automation is received on “Mapping-1” channel 1 it is transmitted on “Mapping-1 Out” channel 1. This enable recording of automation as MIDI CC. Notice that automation received as MIDI CC does not generate any output, only automation generated otherwise.

Set the QuickControl of tracks to manipulate the automation parameters directly. The QuickControl the update their values both the the parameters are changed using MIDI CC and when they are changed using normal automation or the mouse.

Mapping one CC to multiple parameters

By adding more MIDI sends (or inserts) to the MIDI track it is possible to control multiple parameters with one MIDI CC.

How to use 14bit CC in Remote Controls

There is, indeed, a bug in Cubase which affects the 14bit NRPN messages on the receive side, however, this bug rests in the Generic Remote GUI rather than in the underlying control functionality. For a workaround, open the Generic Remote setup XML file, find the corresponding CTRL item in the CTRLTABLE section, and add 16 to the value of the FLAGS attribute. This is the trick which makes the 14bit NRPN messages being received properly. The Generic Remote GUI sometimes does not write the correct value of the FLAGS attribute into the XML setup file.

An example: If I set “Fader 1” to NRPN-Ctrl with the “R” (Receive) tag and the maximum value of 16383 then the corresponding item in the XML file looks like that:

<ctrl> 
  <name>Fader 1</name> 
  <stat>2</stat> 
  <chan>0</chan> 
  <addr>1234</addr> 
  <max>16383</max> 
  <flags>1</flags> 
</ctrl>

Now, when I change the FLAGS value from 1 to 17 (1+16) and reimport the file into Generic Remote then Cubase starts responding to the incoming 14bit messages correctly! What a magic!

Modifying Remote Control Devices

Cubase only register changes to a Remote Control device when the device is saved. So until the bug is fixed remember to save your Remote Control device when you change it.