How To Extract Tempo Data From Unmetricised Audio

Last month we explained how to derive a Cubase tempo from freely played MIDI. This time, we look at how to extract tempo data from unmetricised audio...

The Master track after Time Hitpoints have been input, one hit per bar: note that the MIDI icon is active in the Function bar.
Something lots of musicians want to do at one time or another is centre a MIDI arrangement around an audio recording that was played freely without a metronome. Perhaps you've an old song recording you want to develop, or maybe you just hate playing your guitar to a click. Fortunately, there are various tools in Cubase that allow you to give the sequencer the tempo references that it needs in order for MIDI tracks to stay in time with an audio recording. The various tools mean that there's more than one way of doing the job. If the audio in question is very rhythmic ideally with a prominent drum part Cubase can successfully detect rhythmic peaks in it and generate reference points, called Match Points, which you can edit manually to refine the resulting tempo map. This method works well and will be discussed in a future Cubase Notes. However, for audio with less strong rhythmic content, such as the acoustic guitar/vocal songs I often need to work with, automatic peak detection (even with subsequent user editing) is rather problematic, which is where the following method comes in. It's not very automatic at all, but it does provide you with a lot of control over your tempo map, by allowing you to generate reference 'Hitpoints' manually. Also, once you're used to the process it doesn't take that long.

The Hitpoint Audition dialogue box, which lets you set up a test 'metronome' to audition your manual hitpoints.

Keep Your Tempo
's Graphic Master track editor is incredibly useful for working with tempo maps. Initially, when it's opened, and before any tempo information has been generated for the Song, it's a plain screen whose bottom half is coloured in solid blue. When a tempo map has been constructed, tempo changes are revealed graphically by peaks and valleys in the blue area, making it very easy to see what is happening to tempo through the course of the audio segment. The Graphic Master track is where much of the following process is undertaken.

1. The first step is to record or import your audio into an audio track in Cubase. It's then a good idea to edit the audio to remove dead space at the beginning, before lining up the start of the audio with Bar 1, Beat 1 in Cubase's Arrange window.

2. Open the Graphic Master track editor by double-clicking on the Master button at the bottom right of the Transport bar or using Apple-M on a Mac keyboard (Ctrl-M on a PC).

3. Click on the MIDI icon on the right-hand side of the Function bar to enable the MIDI note-input facility. You need to have a MIDI keyboard or other MIDI input device (such as MIDI drum pads, for example) connected to the computer for this method to work.

Fill Meter Hits results in Meter Hitpoints appearing in the Meter Hitpoint Strip: note the snap resolution of '1', so that a Meter Hit is only generated once every bar.
Start playback of the audio and as soon as possible begin tapping any key on your MIDI keyboard (or pad on the drum controller) in time with it. For each tap of a MIDI note, a 'Time Hitpoint' (they resemble little lollipops) should appear in the grey Time Hitpoint strip that runs along the bottom of the Graphic Master track editor. It's up to you how many beats to the bar you tap in; on a 4/4 song I've tried tapping on every beat, every other beat, and finally, just the first beat of each bar. I find that two beats to the bar works well, but just tapping in the downbeat is actually better and produces quite a natural feel. You'd think that tapping every beat would be the most accurate way, but I found it creates a rather lumpy result. You may want to experiment, depending on the material being worked with.

Note that because you won't be able to use a count-in it will usually be necessary to manually input a Time Hitpoint for the first beat of the song. If you can make a good guess as to the initial tempo of the audio, you could use Cubase's metronome on the pre-count only, so that you'll at least know when to start generating the Hitpoints. Failing that, you can input the missing Time Hitpoint(s) by clicking on the strip where you want it (or them).

Meter and Time Hitpoints have now been linked.

The Meter and Time Hitpoint links have been straightened up, and the Master track should now generate an accurate tempo that follows the freely-recorded audio.

At the end of the audio playback, you should have a Time Hitpoint strip filled with Hitpoints. To find out how accurately you've placed them, you can now ask Cubase to give you some audible feedback, by choosing Edit Hitpoint Note from the Do menu. This rather unintuitively-named option brings up the Hitpoint Audition dialogue box, which allows you to set a MIDI note (with velocity value) to trigger on each of your Time Hitpoints. If any of these Hitpoints are seriously astray, it should be obvious as the MIDI note triggers alongside audio playback. (You'll notice that you can also set a MIDI note and velocity for 'Meter Hitpoints'. Ignore this.) If any of the Hitpoints are unsatisfactorily placed, move them to the correct locations by clicking and dragging. Hitpoints can also be deleted like any other Cubase data.

6. If you're happy with the way your Hitpoints work with the audio, the next step is to select Fill Meter Hits from the Do menu. It is important before doing this that you have Snap in the Function bar set to the correct value for the Time Hitpoints you've already entered. For example, in a 4/4 song, if you've tapped just the first beat in the bar, the snap value should be 1 (a whole note); if you tapped every other beat in the bar, the snap value should be 2 (half note), while if you tapped every beat it would be 4 (quarter note). If you're working with a 3/4 song, and you've generated a single hit at the beginning of each bar, you'll need to set the Snap value to a dotted half-note (which is equal, of course, to three quarter-notes).

The 'Fill' process causes Cubase to automatically generate Meter Hitpoints (denoting bars and beats) at the selected value along the top (Meter) Hitpoint strip. Note that you must have the left and right markers in the song window encompassing all the audio: Meter Hitpoints will be generated only for the marked section.

7. Now select 'Link One By One' from the Do menu (this function is sometimes called, more correctly, 'Link One To One' in the Cubase manual). This causes a vertical line to be drawn between each of your Time Hitpoints along the bottom strip and the closest corresponding Meter Hitpoint along the top.

The hi-hat hits imported into the Master track's Time Hitpoint Strip.
Choose 'Straighten Up' from the Do menu. While you wait, Cubase moves its Meter Hitpoints to match exactly in time with your Time Hitpoints, consequently straightening up the lines it has drawn on the display. At the same time the program is calculating the tempo changes that need to occur between each Meter Hitpoint so that bars and beats fall on your Time Hitpoints.

You've now generated a tempo map for your audio, and the program's metronome should play back in time with it. (You'll want to disable the audition click you set earlier to test the placement of the Time Hitpoints.)

The MIDI Method
Now that you understand how all this works (and once you've done it once or twice, it really does become very transparent), there is actually a better way of generating Time Hitpoints than by tapping directly into the Graphic Master track, and this is it. First, create a MIDI hi-hat track that plays in time with your audio, by recording the part as you listen to the audio. (You don't have to use a hi-hat, of course; any suitable percussive sound will do.) In the piano-roll editor, edit the hi-hat hits, if necessary, to be perfectly in time, then copy all the notes in the part and paste them directly into the Master track Graphic Editor. Make sure that Cubase's transport is set to the beginning of the song, so that the MIDI data will be pasted at exactly the right place. The MIDI notes turn up in the Time Hitpoint strip as Hitpoints, labelled 'MidiData', and you can proceed from step 6 onwards.

The advantage of this approach is that you get to hear something make a noise while you're generating the hits, and you are able to see the putative Time Hitpoints (the hi-hat notes) in a familiar editor environment and edit them using your normal editing tools. Of course, when you're moving the MIDI notes about in the piano-roll editor you have to have snap turned off and move them 'freehand'. But the sort of judgement required to move notes by the correct amounts quickly becomes second nature. In fact, having generated Time Hitpoints in both ways, I would certainly favour the MIDI note method over the other one. Derek Johnson

Cubase TipsThe Audio Pool can be quite a confusing place, but there are a few ways of making it easier to use. To see easily which file in the Audio Pool corresponds to which sound in your arrangement, select the file or segment in the Pool and click on Find Parts in the Do menu. The corresponding parts will be selected in the Arrange window. You can highlight multiple files and segments in the Audio Pool and then use this function, but in a complex arrangement this might add to your confusion. If you just need to know whether a bit of audio in the Pool is being used or not (so that you can delete unused segments, for example), the speaker icon next to a segment's name will be greyed out if the segment is not being used. Incidentally, the number next to the speaker icon of an active segment tells you how many times that segment is used in the current Song. Derek Johnson

If you have Confirm Record selected in the Audio Setup sub-menu of the Options menu, a dialogue will come up after every take recorded, asking if you want to keep the take or skip it. If you skip it, the file will never even appear in your Arrange window, which saves you pointless deleting if you know the take you've just recorded was no good. Derek Johnson

If 'Double-click Title Bar to collapse windows' what used to be called Windowshade is activated (under the Options tab of the Appearance control panel), you won't be able to double-click on the title bar and rename your Cubase Arrangement. I spent a while wondering why I couldn't rename an arrangement before I realised what was going on! Derek Johnson

September 2001

Master track; Meter Hitpoints; DR-Verb

This month, we explore the murky world of Cubase's Master track in a bid to teach it the tempo of a MIDI part. There's also some hot news about updates and an excellent shareware reverb plug-in, as well as the usual tips and tricks.

As Cubase grows ever more complex, it's sometimes the case that you have to puzzle for hours to find a way of doing something that ought to be quite simple. 'It's a real pain finding the right tempo to start a project in,' I thought the other day. 'Surely there must be an easy way of recording a MIDI part in without a click, then setting Cubase's Song tempo to match what you've played?'

Half a day's work later, I did find a way of doing this, although I wouldn't describe it as simple. It does, however, serve as a useful introduction to some of the features of Cubase's Master track. This has been part of the program since version 4 on the Mac, and provides a graphical overview of the tempo of your song, which can be edited to fit significant points in, say, a video you're working with.

The Master Track
By default, the Master track is inactive (although it can still be edited), and Cubase simply takes its tempo from the indicator in the transport bar. Below this, however, is a button labelled 'Master'. Clicking this forces Cubase to derive its tempo information from the Master track instead. The Master track can be viewed and edited in graphical or list form: the former is the more user-friendly. Pressing Apple+M (Alt+M on PCs) brings up the graphical Master track editor.

So let's suppose that you want to base your song around a MIDI phrase of a few bars, which you're just going to play in to Cubase without reference to its existing tempo. With the left locator at the very start of the Song, the click turned off and the Master track turned on, record your part onto a MIDI track, then double-click to open the piano-roll MIDI editor. Since you're not working to a click, you'll probably find that there's a gap at the start of your part where recording started before you began to play. You'll want to edit your recording so it starts right at the beginning of the part the easiest way to do it is to select all the notes, cut them to the clipboard, place the Song Position Pointer at the start of the part (by pressing 1 on the numeric keypad) and then paste them back in.

For the purposes of matching the Song tempo to the part you've just recorded, you'll need to select a few important notes which, musically speaking, fall exactly on the bar or beat (although, of course, they won't yet be on the beat with respect to Cubase's tempo). One must fall on the first beat of the entire part. Two is enough in total, although you can use more if you prefer, and the further apart they are, the easier it will be to match the tempo precisely.

When you've selected these notes, choose Selected to Hitpoints from the Do menu in the piano-roll editor. Cubase Hitpoints come in two flavours Meter and Time and this function creates Meter Hitpoints that correspond with the selected notes. We know that these points correspond with musically important events such as the first beat in every bar; Cubase doesn't yet, but we're going to tell it... You can show Meter Hitpoints in the piano-roll editor by clicking on the H symbol in the panel at the top right.

PC users may find that they don't have either a H symbol or the option to choose Selected to Hitpoints. In this case, press Ctrl-C to copy the selected notes. Then, when you return to the graphical Master track editor after tempo-locking your MIDI track (see next step), you'll need to click in the ruler above the tempo display, where Meter Hitpoints live, and press Ctrl-V. This should convert your notes to Meter Hitpoints, and you'll be able to follow the rest of the process from then on.

When you've created suitable Hitpoints, close the piano-roll editor and return to the Arrange page. At this point, you need to lock the tempo of the track containing the reference MIDI part we've been working with. This is done by clicking in the T column immediately to the left of the track name, which makes a lock symbol appear (see screen, below). When we make changes to the tempo in the Master track, tempo-locked MIDI tracks retain their original speed. This is fortunate, because it allows us to adjust the Master track tempo until it matches the 'natural' tempo of this part. (If you could do this without using the Master track tempo, the whole exercise would be a lot easier. Sadly, though, tempo-locking doesn't do anything unless you have the Master track switched on.)

Enter The Master Track
Now, open the Master track's graphical editor. This shows the tempo in blue, with a Meter scale above and a Time scale below. You'll notice that your Meter Hitpoints appear on the Meter scale. Make sure the Song Position Pointer is still at the start of your part and choose Split Tempo at Song Position from the Do menu in the Master track editor. (For some reason, if you don't do this, tempo changes are scaled from a point before the start of your song, which makes them impossible to line up...)

Select all your Meter Hitpoints by clicking on them or drawing around them with the mouse, and choose Mirror and Link from the Do menu. You should see a matching set of Time Hitpoints appear on the Time ruler below the tempo display. If you have Show Hitpoint Links enabled in the Options menu, you should also see solid lines connecting the Meter and Time Hitpoints, as in the screen shot shown but for our purposes, we'll need to have Show Hitpoint Match selected instead. With this option enabled, you should see vertical dotted lines extending upward from the Time Hitpoints. At this stage, it's also a good idea to turn off Snap and Quantize.

A little explanation may be in order here. The original Meter Hitpoints we created point at important musical events in our MIDI part, such as the start of each bar, and what we want to do is adjust the tempo in the Master track, without changing the speed of this part, so that these events line up with the bar markers in the Meter ruler at the top of the display. However, even though the tempo of the MIDI part is locked, you'll notice that the Meter Hitpoints we've derived from our MIDI part are not fixed in time they follow any change of tempo. What we need to do is create Hitpoints that still correspond to our important musical events, but which are fixed in time regardless of any tempo changes. This is where the Mirror and Link function comes in. It has created a Time Hitpoint for each of our selected Meter Hitpoints, and you'll notice if you change the tempo that while the Meter Hitpoints stay in the same place, the Time Hitpoints change position with respect to the markings on the Meter display. In other words, while Meter Hitpoints get closer together or further away in time as the tempo is increased or decreased, Time Hitpoints remain the same distance of time apart.

When you move the cursor to the left-hand side of the Master track editor, it should change into a pencil. Clicking and moving up or down will allow you to adjust the tempo of the section of the song you're working on. As you do so, the Time Hitpoints along the bottom will scale upwards or downwards, moving horizontally with respect to the Meter track above the tempo display. To find the right tempo for your song, adjust the tempo with the pencil tool until the dotted lines above these Hitpoints line up with the appropriate markings in the Meter track for instance, if you originally took your Hitpoints from the first note in every bar, you should adjust the tempo until each of them lines up with a bar marker. You may find it helpful to increase the zoom values using the controls at the bottom right of the window to allow you to adjust the tempo more finely.

Final Tweaks
You should now have a Master Track tempo that matches the speed of your original part. If you want to check, try activating the click in the Cubase transport palette you should hear the clicks in time with your part. If you like, you can now unlock the tempo of your original MIDI part in the Arrange page, whereupon it will follow any further tempo changes you make in the Master track. Since your part was originally played in without a click, the timing will be fluid, so you may want to quantise it.

If you want to do normal cut-and-paste operations in the Arrange page, and especially if you want the original part to loop, it's a good idea to trim the end of this part with the scissors tool so that it occupies an exact number of bars in the arrangement 'dead space' at the end can be a pain when you come to paste copies of the part.

This is a somewhat cumbersome way of achieving what ought to be a simple end (if anyone knows a better way, do get in touch!), but sometimes the price you pay for having powerful features is that they're not so simple to use. Once you've done it a few times, it doesn't actually take very long, and if nothing else it provides a useful insight into the workings of the Master track. When you've got your head round the idea of Time and Meter Hitpoints, the Master track can be a life-saver, especially if you're working with film or video. As always, check out the Cubase documentation for more details... Sam Inglis

Cubase Tips
You can derive a Master track tempo from an audio part in a similar way as described in the main text. Either use Cubase's Get M-Points function to automatically generate Match points from your part, or enter Hitpoints manually at appropriate places see the documentation for more details. If you're working with a small loop, you can also use Fit Event To Loop Range, as described in Simon Millward's article on groove quantising last month. Sam Inglis

The method described in the main text involves splitting the Master track tempo at the start of your MIDI part. If this isn't right at the start of your song, of course, anything earlier can end up in a different tempo. However, once you've fixed the tempo for one section, it's easy to adjust the tempo of the preceding section to match. Sam Inglis

One of the ways in which Cubase's mixer has always differed from real ones is that you can't chain aux send effects. You can, however, achieve similar results by setting up a chain of effects as inserts in a group channel, and then choosing that group as a destination to send to. Sam Inglis