You are here

Connecting Audio + MIDI Signals Inside PC Music Software

PC Musician By Martin Walker
Published May 1999

Far from simplifying things, sometimes it seems that adding soundcard DSP features can initially make things more complicated. This is the Cubase VST internal mixer set up to route 12 independent audio channels to the SW1000XG hardware mixer. These can then have hardware effects added and be mixed down to stereo using a utility like XGedit (shown on the right‑hand side of the screen). For more details see the Soundcard DSP Mixing section in the main text.Far from simplifying things, sometimes it seems that adding soundcard DSP features can initially make things more complicated. This is the Cubase VST internal mixer set up to route 12 independent audio channels to the SW1000XG hardware mixer. These can then have hardware effects added and be mixed down to stereo using a utility like XGedit (shown on the right‑hand side of the screen). For more details see the Soundcard DSP Mixing section in the main text.

Multiple inputs and software‑based mixers allow both audio and MIDI signals to travel some convoluted routes inside the PC. Martin Walker untangles his virtual cables to explain how best to get them out at the other end.

When MIDI sequencing was in its infancy, a single MIDI Out supporting up to 16 different simultaneous sounds was considered absolute luxury. Most of us started with this configuration, and wondered why on earth anyone would ever need to use more than 16 different instruments — indeed, for many musicians this is still quite sufficient. The problems started when musicians began to use multiple MIDI modules, since it was often difficult to make sure that data sent on one channel only resulted in sounds from one module. Separate MIDI Outs started to be dedicated to particular keyboards or modules to avoid these problems.

This also made housekeeping easier, since it also avoided having to select a unique MIDI channel number for each track — if you wanted to run one different instrument on each of eight MIDI synths by selecting channel 1 on each of your eight MIDI Outs, that was up to you. However, this did make the signal path potentially more confusing — more often than not if nothing was emerging from the MIDI Outs it was because the data was being sent to another port by mistake!

When computers became powerful enough to add audio recording and playback facilities to MIDI sequencers, many more signals started to be routed through single systems. The latest MIDI + Audio sequencers can handle 32, 64, or even 96 audio channels, while simultaneously juggling hundreds of possible MIDI channels. A further complication is that there are real and 'virtual' tracks — the differences between these two can initially be a great cause of confusion (see later). Moreover, over the last year or two the equation has become even more complicated, with the arrival of audio plug‑ins, hardware DSP‑based plug‑ins, software sampling, and real‑time synthesis.

Multiple Signals

This is the Tools/MIDI Devices window from Cakewalk, and shows a variety of entries. Notice that the Seer Systems' Reality software synth only has a MIDI Output, but that Native Instruments' Generator has both an Input and Output (see main text for more details).This is the Tools/MIDI Devices window from Cakewalk, and shows a variety of entries. Notice that the Seer Systems' Reality software synth only has a MIDI Output, but that Native Instruments' Generator has both an Input and Output (see main text for more details).

A single PC may be called on to simultaneously run software sampling, software synthesis, MIDI sequencing, and audio recording and playback. Apart from the strain put on the processor and hard drive, this also creates a huge number of possible routes for music signals to pass through the system. Apart from the performance data that the PC may be receiving from MIDI and Audio inputs, and the previously recorded MIDI sequence tracks that are now being sent to multiple MIDI outputs, and the multiple audio streams being read from the disk drive, other software applications may also be generating audio data in real time that needs incorporating into the final mix. Even at this stage there is lots of potential for routing problems, but it gets worse.

If you are using a real‑time software synth or software sampler, the routing may be even more complex, since these are mainly MIDI‑controlled. The output from a sequencer MIDI track will then need to be routed internally to the input of this additional real‑time application, with the audio output of the real‑time application either routed to a soundcard hardware output socket (so that you can mix the signals externally using an analogue mixer) or internally to your sequencer (so that you can use its own mixing and effects engine).

Complications can arise if both your MIDI + Audio sequencer and the software synth want to access the same soundcard output. At best you may get a polite error message from one or other application, but even with a multi‑output soundcard you won't always get the option to allocate some of the outputs to one application and the remainder to the other.

When it comes to soundcards that feature onboard digital mixers and effects, the possibilities can multiply even more alarmingly. Some soundcards have many hardware inputs and outputs; others have only a single stereo input and output, but many internal audio channels that provide extra DSP features. Sometimes getting any audio to emerge from your monitor speakers at all is a pleasant surprise. Let's break everything down into more manageable chunks, and see how it all connects together.

Multiple Applications

Routing a software synth like Seer Systems' Reality can be tricky since it uses both MIDI and Audio, and often needs to run on a separate soundcard to the one used for hard disk recording. However, with some multichannel cards you can allocate a single stereo pair of channels as shown here. Deactivate one of the Wave stereo pairs normally used by the VST sequencer in Audio Setup (left window), choose this as the audio output in Reality (centre window), and then activate the reality MIDI output using Setup MME (the window on the right). More details in the main text.Routing a software synth like Seer Systems' Reality can be tricky since it uses both MIDI and Audio, and often needs to run on a separate soundcard to the one used for hard disk recording. However, with some multichannel cards you can allocate a single stereo pair of channels as shown here. Deactivate one of the Wave stereo pairs normally used by the VST sequencer in Audio Setup (left window), choose this as the audio output in Reality (centre window), and then activate the reality MIDI output using Setup MME (the window on the right). More details in the main text.

As long as you are only running a single music application, operation should be relatively straightforward (especially if the user interface has been well designed). All of the functions can be accessed from a single set of drop‑down menus, and the internal routing of signals will soon become familiar. However, more and more musicians are finding that they need to run several applications so that they can access every aspect of their system. Modern soundcards with onboard digital mixing often need a secondary utility to access their full range of features, and of course special‑purpose applications such as software sampling and synthesis will also need their own application running — even if you are not editing or loading sounds, the application will still need to be running in the background to continue to create the audio streams.

You can in many cases switch between several applications when you need to tweak a sound or effect, and in this instance it is comparatively easy to understand what is happening — you start playback in the sequencer, switch to the synth editor or softsynth, adjust some onscreen controls or load in a new sound from your hard drive, and then return to the sequencer. In essence, this is an either/or situation — either you are in the sequencer, or you are in the editor.

When it comes to routing your music signals between multiple applications, a much bigger leap of understanding may be required. For instance, if your soundcard has an onboard digital mixer as well as your sequencer, do you use them side by side, or do they have to be used one after the other? What happens to your audio signals is now determined by the combination of two applications, and you have to consider them both simultaneously.

Entering The Virtual World

Integrated systems such as the Creamware Pulsar provide a versatile graphic environment. Its Project Window shows all currently loaded modules, and how they are interconnected, which certainly makes wiring easier to understand than when using a selection of applications from different developers.Integrated systems such as the Creamware Pulsar provide a versatile graphic environment. Its Project Window shows all currently loaded modules, and how they are interconnected, which certainly makes wiring easier to understand than when using a selection of applications from different developers.

However, before we talk of the mixing possibilities, it is important to understand the distinction between real and virtual tracks. For instance, most hard‑disk recording software allows you to record far more discrete audio tracks than you have hardware audio output sockets. This is because modern processors have sufficient power to add together all of the data from dozens of tracks in real‑time, reducing them (at the simplest level) to a single stereo output signal which then gets routed to your soundcard stereo output. Even with a cheap stereo consumer soundcard you can still work with dozens of virtual tracks, and it is up to the musician to decide how many discrete tracks should be played back simultaneously. The maximum possible number largely depends on the speed of your hard drive (see the Easy Access PC Musician feature in the December '98 issue for more details on this).

Although many sequencers claim 'up to 256 virtual tracks' and 'up to 256 MIDI tracks' this is rather academic, since although the developers may have written their software to cope with these maximum figures it is highly unlikely that anyone will ever be able (or even want) to achieve them. In the case of MIDI, 256 tracks means using 16 separate MIDI Outs, and this is certainly feasible, but there is still a big difference between supporting a large number of MIDI Outs and transmitting 16 instruments on each and every one. When it comes to audio, few people will venture beyond 64 audio tracks, and most will be more than happy with 32 or fewer.

Multiple Hardware Outputs

Connecting Audio + MIDI Signals Inside PC Music Software

Many people find it initially confusing when they upgrade to a soundcard with multiple outputs, expecting to find a drop‑down list of these outputs when they select an audio channel for playback. Although it would be possible for a hard disk recorder to have each playback track hardwired (directly routed) to a hardware output, you would immediately lose the advantages of virtual tracks. For many musicians, the most important of these is that you can record and playback far more tracks than you have physical output sockets — in this respect the hard disk recorder is very unlike a hardware‑based audio recorder like an ADAT, where each input is permanently connected to its own track.

Another advantage of virtual tracks is that you don't have to record a separate instrument on each one — you could have several different takes of the same instrument on different virtual sequencer tracks, but route them all to the same hardware output. This allows you to piece together the perfect performance without having to worry about having it all in one long recording, and there are no problems even if some areas overlap, as long as each is played back using a different virtual track.

Although many sequencers claim 'up to 256 virtual tracks' and 'up to 256 MIDI tracks' this is rather academic, since although the developers may have written their software to cope with these maximum figures it is highly unlikely that anyone will ever be able (or even want) to achieve them.

If you are careful you can also record several tracks during the course of a song using the same virtual track, as long as the individual sections don't overlap. This has the advantage that your hard drive won't be working quite so hard, since each virtual track is a single stream of audio from your hard drive. If there are any overlaps, your sequencer will have to choose which audio stream to continue with where the two coincide. Normally the 'most recent' recording will be used, so for instance if you start your song with piano, and then later on introduce a guitar solo using the same virtual track number, the guitar solo will override any remaining piano part. Even if the two tracks show up as different horizontal strips on your Arrange page, it is the virtual audio channel number that counts.

Virtual MIDI

Most software synths will install a virtual MIDI port, so that you can treat them just like any other MIDI module. But how do you connect it to your sequencer if it has no MIDI sockets? We now enter the world of virtual routing, where software applications talk to each other without the aid of physical cables.

All PC MIDI interfaces need driver software, and Windows provides a standard way to let any music application access them. The MME (MultiMedia Extensions) allow any physical MIDI device to have one or more entries that appear in the Multimedia section of your PC's Control Panel (although only the MIDI Outs are listed). With basic applications like the Windows Media Player that can only access a single MIDI interface, it is the highlighted output that is used during playback. However, nearly all modern sequencers bypass this highlighted Control Panel/Multimedia choice, and instead provide simultaneous internal access to every available MIDI In and Out — Steinberg even provide a separately launched utility called Setup MME, so that you can decide which combination of inputs and outputs you want to appear inside Cubase VST.

When you install a software synth or virtual sampler — in fact any piece of software that provides MIDI control of a software generated signal — the same situation applies. Extra entries may appear in both the MIDI Input and Output list, but in this case they will be 'virtual' MIDI ports, since they don't physically exist as sockets. However, they act in exactly the same way: if you want to hear a sound from a software synth, you need to send note information to the appropriate MIDI port. To do this you simply select the new virtual port from inside your sequencer and treat it just like an external MIDI keyboard or module.

Some software synths can also generate MIDI data, or modify existing data being passed to it. Native Instruments' Generator is one such, and its 'Generator internal Midiport' therefore appears as an extra port in the Input side of your sequencer. You can use this to receive any MIDI data emerging from Generator, so that you can record it in your sequencer.

Internally Generated Audio

The main complication with this type of software is that apart from its internal MIDI connections, it is also carrying out all the calculations (or reading and manipulating existing sample data) to generate audio waveforms, and so must normally be routed to a soundcard before it can be heard. The easiest option is to have a separate soundcard used solely for this purpose, and either mix its analogue output with the rest of the music using an external mixing desk, or connect its digital output (if available) to the digital input of a second soundcard, and then use the first card to provide the master clock (see the Deck of Cards PC Musician feature in the February '99 issue for more details on this latter approach).

Attempting to run a software synth simultaneously with a MIDI + Audio sequencer by sharing the same soundcard is trickier to do. ASIO soundcard drivers can only be accessed by a single application in most cases, which rules out this approach. However, both MME and DirectSound drivers normally allow you to allocate multi‑channel soundcard ports in stereo pairs, and so you can send the output of a software synth to one stereo pair of outputs, and still use the remaining outputs to replay hard disk audio tracks.

Integrated Audio

When it comes to hard disk audio recording and playback, the routing possibilities instantly become more complex, largely because of real‑time plug‑ins. These can now be inserted at various points in the virtual audio chain. The simplest approach is to use either DirectShow plug‑ins, or those that are integrated with your sequencer (such as VST plug‑ins for users of Cubase and other VST‑compatible sequencers). This lets you work entirely within a single application, which certainly makes the routing a lot simpler to understand.

A single PC may be called on to simultaneously run software sampling, software synthesis, MIDI sequencing, and audio recording and playback. This creates a huge number of possible routes for music signals to pass through the system.

Cubase VST, for example, can have up to four effects inserted in each channel (with plug‑ins configured as insert effects, the entire signal passes through the effect, and any dry/wet mix must be adjusted in the plug‑in window). In addition, there are up to eight effect sends provided for each hard disk playback channel. These are normally set up to be totally wet, and are then combined with the dry amount set by the channel fader position. You could however turn the channel fader completely down, select pre‑fader for the effect level, and again control the wet/dry mix using the plug‑in alone. These sends can also be used to set up several different monitor mixes that could each be routed to an individual hardware output if you use a soundcard that provides multiple outputs (more details on this in a moment). Finally, the Master Channels also have up to eight Insert effects, for global changes to the overall mix.

Sometimes manufacturers provide tight integration between their soundcard and a particular sequencer — a good example of this is the Lexicon Studio system, where the twin PCM90 reverbs simply appear as VST‑compatible plug‑ins. However, such integration is rare between different products, and this is where the routing becomes more complex.

Soundcard DSP Mixing

So far, the typical audio signal path is very similar to that of an analogue mixer, but the situation gets more complicated when you have a soundcard that features its own all‑singing, all‑dancing digital mixer. With complex hardware DSP‑based digital mixers and effects, you are often faced with routing your audio first through the 'in‑house' mixer provided by the MIDI + Audio sequencer, and then routing your audio through multiple output channels into a second mixing utility that controls the DSP‑based routines running on the soundcard itself.

Here you may be faced with a multitude of choices, since you could for instance use the sequencer EQ and effects, the soundcard EQ and effects, or a combination of both. I suspect that most people use a combination of both, since most soundcard manufacturers provide a fixed set of effect options that run inside the DSP chips on the soundcard, and you can supplement these with a selection of more exotic third party plug‑ins. For instance, nearly all music needs at least one decent reverb (even if you are going for an upfront 'dry' mix, you will still need some ambience to add depth). Reverb is one of the most processor‑intensive of all effects, and if you have the option to use one based in DSP chips then go for it. Because their DSP resources are not shared with other functions, on‑card effects can also afford to splash out more DSP power on a single effect than can the designers of software plug‑ins, so you can sometimes get a significant improvement in audio quality.

Even more flexible are products such as the Creamware Pulsar and Soundscape Mixtreme, since you can also choose which plug‑ins to run in the DSP chips. Any combination of supplied or third party plug‑ins can then be used in tandem. Using those of the soundcard will minimise the processor overhead, since they use the DSP power of the soundcard itself.

Software To Hardware Routing

Whatever combination of sequencer and soundcard mixing, EQ, and effects you choose, you will still need to route your audio signals through both. There are many combinations of sequencer and soundcard, and of course some of them provide specific support for each other. However, the most complex example is when you have two completely separate mixers to configure — if you understand this then the other possibilities are comparatively easy to follow.

A typical example (and one that I use myself) is the combination of Cubase VST and the Yamaha SW1000XG soundcard. There are five effect busses available on the 'SW1k', and 12 internal audio channels available through the standard Windows MME drivers as six stereo pairs. Although you can use as many virtual tracks as you like from your hard drive, only 12 mono (or six stereo) channels can be sent individually to the SW1k. However, you don't need to buy another soundcard to have more tracks in your songs — you could create submixes to one or more stereo pairs if desired. You might for instance use the VST mixer to add EQ and DirectShow or VST‑compatible effects to a group of playback channels, and then route this entire submix to a single pair of SW1k hardware channels, leaving the remaining ten free to have individual hardware effects added.

To route the VST tracks individually to the SW1k, you need to arrange the signal routing so that each separate VST Monitor mixer channel is sent to one (and only one) soundcard mixer channel. It will help if you refer to the screenshot on page 68 during the following explanation. First you need to enable the extra output busses, by clicking on the relevant 'Active' buttons on the Master channel. When the stereo Master and the five additional busses are active, you will find all six stereo busses available when you click on the Output routing buttons found at the bottom of each monitor mix channel. It may help to name these busses — apart from the Master buss, all the others can be renamed, and in the screenshot I've changed them to Wave2 through to Wave6 so that they relate directly to the soundcard mixer names.

Now, starting at the left‑hand side of the VST Monitor mixer, you change the output routing of the channels in pairs — one pair to each stereo buss. To make sure that only a mono signal is sent to each of the 12 soundcard channels, you also need to set the Monitor mix Pan positions alternately hard left and hard right. This ensures that each playback channel only gets routed to a single mono channel in the soundcard mixer. For instance, VST channel one would be set to hard left and routed to Master, channel two to hard right and Master, channel three hard left and Wave 2 (bus 2), channel four hard right and Wave 2 (bus 2), and so on. You can see the entire set in the screenshot.

Having done this, the output from each VST playback channel will now appear on a single channel inside the soundcard digital mixer. From this moment on you could forget about the VST mixer, and instead adjust EQ, effect sends, and overall levels using the soundcard mixer. In this case I have shown the 'analogue' mixer from XGedit, which provides access to every aspect of the SW1k.

However, there are various options for the fader positions. You could set each VST monitor channel fader to 0dB and do all the mixing on the soundcard, or you could use the VST fader automation and leave all the soundcard faders at similar nominal positions. Since in the case of the SW1k its faders can also be automated using MIDI controllers, there is also an argument for taking this approach — this would certainly allow you to use some sort of hardware controller more easily.

This combined sequencer/soundcard mixer approach is the same whether the second mixer is designed by Steinberg (such as the integral one for Yamaha's DSP Factory) or if it is a completely standalone application (such as the SW1000XG used in this example, or the Emu APS, Soundscape Mixtreme, and Creamware Pulsar). Although the setup procedure is initially a bit fiddly, you don't ever have to launch the VST mixer again if not required — you can mix entirely within the third‑party application if you prefer.

Hardware Routing

Many soundcards like the ones mentioned above provide plenty of internal facilities, so that the majority of users may never need to send audio signals back into the outside world. However, many musicians still have plenty of expensive and irreplaceable outboard gear, or want to route multitrack recordings to another recorder such as an ADAT. In this case you need a soundcard with multiple outputs. Most ADAT owners will prefer to use a card with 8‑channel optical connectors for this purpose, but whatever the type of output, the principles of routing remain the same.

Exactly as before, you enable any required additional output busses, and then route your Monitor Mix channels in stereo pairs with hard left and right Pan positions. The only difference is that rather than appearing as another channel inside an internal soundcard mixer, the audio signal will emerge from the hardware output socket in question, where it can be connected to whatever external gear you need.

Future Integration

Steinberg have already announced that the next PC release of Cubase VST (version 3.7) will feature a much more integrated approach to adding software synths. They will simply appear as extra audio streams as Rebirth does currently. This should overcome many current problems, and be welcomed by users.

As I discussed in April's PC Notes, Cakewalk's AudioX is a driver specification that should also allow soundcard manufacturers to get many of their special soundcard features more integrated into the sequencer itself, rather than run from separate utility programs. Again, this should simplify routing problems. There are also many hardware control surfaces appearing, and while these don't affect routing, it will mean that there is more pressure on sequencer manufacturers to make their mixer EQ and faders accessible using MIDI controllers. This should help with integration, by allowing you to access more features from within a single software package.

It only remains for MIDI interface and soundcard manufacturers to realise the importance of multi‑client drivers, and for multi‑channel audio drivers to be more accessible to multiple applications, and we should find the problems of routing far less daunting.

Taking On More Clients

Despite the many advantages to the user, there are still few MIDI drivers that have multi‑client capability. When you want to connect both your sequencer and a synth editor to the same MIDI output, so that you can play back while tweaking the sounds, both applications have to access the same MIDI port simultaneously. With a multi‑client driver you simply select the same MIDI port in each application and get on with some creative work. If the driver doesn't have this capability you will get an error message when you attempt to open the second application, along the lines 'Device already allocated!'.

Thankfully, there is a workaround for this problem. Various helpful developers have written small freeware or shareware utilities that 'sit on top' of the MIDI driver, intercept multiple streams of MIDI data, merge them together, and then pass on a single stream to the original driver. It's a bit of a fiddle to have to use these, but they do make life an awful lot simpler in the long run. One of the best known is Hubis Loopback, and I use this myself with my SW1000XG, to run both Cubase VST and XGedit95.

There is a multitude of possible options when configuring multi‑client overlays, depending primarily on whether you merely want to tweak the sounds during playback, or whether you want to record the real‑time movements made in the synth editor using your sequencer. Thankfully the authors of such utilities know all the options, and one example of a web site showing many of the possible options is that of Gary Gregson, developer of the popular XGedit (see screenshot, below).

Adapting To The Task

One of the big potential problems if you decide to base the bulk of your studio in the virtual environment of a PC is the huge number of controls that have to be accessed using a mouse. It's hardly surprising that so many hardware control surfaces are appearing — these provide a much better hands‑on interface, as well as making it far easier to alter a variety of different controls in a short space of time.

However, there are various things that the software developer can do to streamline the onscreen experience. In my opinion one of the most effective is the Adaptive mixer, as used by both Emagic in Logic Audio and Cakewalk in their sequencer range. Rather than showing a huge number of mixer channels on screen, only the ones used by a particular song are displayed. This avoids constantly having to resize multiple windows and arrange them side by side to show the whole mixer — when you launch the Mixer (or Console view in Cakewalk) the entire mixer appears in a single window, making it far quicker to use. Some studio owners may want to display a hundred virtual mixer channels to impress their clients, but most of us would I'm sure much prefer only to see the active mixer channels for the current song.

The other big limitation with many software mixers is having a fixed set of dimensions. When you really do need to get 20 software mixer channels displayed side by side, but only 16 will fit across your monitor screen in the current resolution, the only alternative is to change the resolution. The Echo Console utility supplied with the Event soundcards is an example of a mixer that can be resized at will — the disadvantage of this approach is that it never looks as elegant, and it is harder to implement. Far easier to produce, and a system that some developers are starting to use, is to provide small, medium, and large display options for the mixer that can be switched at any time. Even better would be a zoom feature like those in some graphic packages, where you could click the zoom tool at the section of the mixer that you need to view more closely, and the entire mixer would expand around this point, so that your mouse is still sitting on the same (but now larger) control ready for tweaking.

Integration

For a more complete picture of your audio environment, a graphical approach is probably the most effective. It does have the disadvantage of requiring extra memory, but there is nothing to stop developers launching it on demand as a stand‑alone utility as and when required (although it would take several seconds to appear). A point‑and‑click graphical interface such as that provided by Creamware with their Pulsar system (see screenshot, left) really does make it far easier to see at a glance just what is connected to what. The limitation is that Pulsar only knows about items within its own world.

It gets more complicated if you want to have a full picture of your system, as you would have to tell the application just what is connected. A prime example of this approach is found in Emagic's Logic Audio. Its Environment page is extremely comprehensive, and once new users have battled through its intricacies the first time, they are rewarded with a MIDI + Audio application that knows all about every hardware component connected to the user's system.