Using MIDI and audio during composition

Keeping it all together

Hi all,

This has always slightly annoyed me about nTrack and I wonder if anyone else faces the same dilema?

I usually leave recording drums until near the end of my recording process. I tend to create a basic drum track by simply entering ‘notes’ into the midi piano roll. I keep this through the recording audio stage and then develop a drum track that I think compliments the music near the end. The problem is that with the addition of more audio tracks, midi increasingly loses synchronisation with audio…begins to lag I suppose more accurately. This is not a great problem as I can drag the midi file forward, basically introducing a compensation factor.

But, here’s my problem. When it comes to adding more drum voices/patterns/fills etc… at the end of the recording process, the piano roll grid is no longer lined up with the notes. Therefore, snapping becomes useless and I have to meticulously place each ‘note’ in the right place. I realise that I can move the midi file back to it’s original position, but then auditioning each change is not possible (because it’s all out of time with audio).

A solution in my mind is to allow manual manipulation of the positioning of the midi piano roll grid. Perhaps this could be done by entering a compensation factor number in a box somewhere.

The midi lag becomes worse as I increase the ASIO buffer on my M-Audio Audiophile 2496 to accommodate for more audio files. My midi synth is a SBLive with Kx drivers running the digital out into the digital in of the Audiophile.

Perhaps some resource conflicts are causing a problem that is only evident when the system is strained? I don’t know.

Does anyone have any ideas how to over come this problem?

I’ve used Cubase SX and it seems to self compensate with no lag issues. But the copy was not mine so I need to use nTrack.

Cheers in advance,


I use an SB Live for midi but don’t use it for audio.
I use an edirol DA2496 for audio and like you have the digital out of the SB Live go into the digital in of the DA2496.

I don’t use the KX drivers for the SB Live (I don’t have it selected at all in the audio devices)

I only have th DA2496 ASIO driver selected in teh audio preferences.

I don’t have any problems with the SB Live midi being out of sync…

Sometimes I get sync problems when I have plugins that introduce latency… What I do though is I usually get all tracks recorded (including converting midi tracks to wav) before applying fx.

Then if I need to go back and do more tracking I disable the fx (the little green “Fx” button on the timeline) before I record any more tracks.

Maybe try using the normal SB Live driver - if you aren’t using the SB Live as an audio device I don’t think you really need to use the KX driver - that is more if you want to use ASIO withthe SB Live…
I may be wrong though as I haven’t played with the KX driver much… the normal driver worked beter for me


Your SBLive is fixed internally at 48khz.
Anything that goes through it is rendered internally at 48khz and back again.

You might want to try out doing everything at 48khz and see if that solves your synch problem, then your final step before making a CD would be to convert the final .wav to 44.1khz.

Thanks Tim and Rich for your replies.

Everything is a 48khz thanks Tim.

I don’t use the kx audio drivers, although I did before I got my Audiophile. I’ve always been under the impression that Creative drivers don’t play nice while other soundcards are installed. But if you’re having no problems Rich, it’s worth a go. I’ll have a look at he fx thing too. I do sometimes stick the occasion plugin in while recording.



Gramps, your problem is you have two clocks and they’re not synchronized. This kind of thing would happen if you were doing audio on both cards too. Has nothing to do with MIDI. (It should have nothing to do with buffer config, either, but one never knows … these dang computers are complicated!)

If your cards have S/PDIF in/out (and I believe they do), connect the S/PDIF output from card A to the intput of card B, and set card B to use S/PDIF input for clocking. This will rigidly lock the two soundcards together.

Also, if you haven’t done so already, in “Preferences -> MIDI Settings -> Devices -> Advanced” (or something like that), set it to use WAVE timer. In “Preferences -> Options”, uncheck both boxes labeled “Use system timer for”. You want to use your soundcard timers for all timing in n-Track.

Finally: As soon as you create a MIDI track you’re happy with, like the initial drum track, render it to a wave file, import the wave file, and mute the MIDI file. Due to limitations of PC interrupt timing, MIDI timing won’t ever be exact, and the exact timing of the MIDI notes will vary (I believe as much as 10 msec range) from run to run. Eliminate this variable by rendering it to wave early on. This should be a minor point (10 msec is pretty small). But this way, you can also use the wave track as a visual guide when editing.

Note that there may be more going wrong in your system than the things I’ve mentioned. None of what I’ve mentioned should have anything to do with the number of tracks or the amount of buffering (if I understand it correctly, which I may not!) You may also be having basic synchronization problems, which I believe are caused by some kind of software gremlin.

Try the following synchronization test. Loop your soundcard’s output back to its input. Be sure to turn off direct monitoring for that input! (If you don’t know how, ask.) Play a wave file like a drum track (one with nice visual peaks) and record it. Compare the original track to the recorded track. Do this a number of times.

Zoom way in and see what the time difference between the original and recorded tracks. Also, note how much variation there is in the recorded tracks. If the delta is large but the variation is small, you can compensate this using the “Compensation” field (I forget where it is, but try audio devices -> advanced).

If the variation is large, you’re hosed. Reload your whole machine, kill all tasks that are unnecessary, load the latest drivers from the soundcard manufacturer, search the web for optimizing your OS for audio recording, and pray. (Well, first try loading the latest drivers, along with a few n-Track options, and try different buffer styles – ASIO/WDM/MME.)

If you end up using a compensation amount (which is in units of samples, BTW), be sure to test again using different buffer settings to see if that matters.


Hi Learjeff. Thanks for your reply.

The cards are synchronised. The M-audio has the master clock set to SPDIF In, ie. to the digital out from the SBLive. So everything runs off the SBLive clock. All at 48khz. This is in fact the only way you can get a digital signal into the m-audio…it must be synchronised to the external source clock. Correct me if I’m missing something.

Everything is set to the wave timer (recording, playback and MIDI). Although, in trying the system timer option, things almost seemed to run smoother…not well enough though :)

For a while I have been under the impression that combining MIDI/audio tracks must just be a very difficult technical/programming issue. But after trying Cubase SX I’ve learnt that it is possible. There seems to be no detectable lag in Cubase with many audio tracks and MIDI. There’s a lesson in this, you should never play with something you can’t have…:slight_smile:

My system is XP (Duron 1300) dual boot with most of the tweaks recommended for DAW.

I’ve tried the Creative drivers with the same issues.

It might be time to format that partition and reinstall everything and then try Creative drivers from scratch.

Today I’ll start pulling the soundcards out and placing then in different PCI slots…who knows, that might help.

Anymore suggestions would be appreciated,


A long shot, but also try both settings for “keep devices open”. There’s also a MIDI “keep devices open”, meaning 4 combinations to try. Otherwise, sounds like you’re doing all the right things. Bummer.

Did you record in loopback and measure the lag? Does it vary a lot or is it constant? (If it’s constant you can compensate for it.) Is it just the MIDI notes that get thrown off, or does it happen with just audio only?

Hey Learjeff,

No, I haven’t given the loop back recording a go yet. I will though after I’ve thought about it enough to ensure I don’t get some kind of ear deafening feedback :)

Audio in nTrack hasn’t been a problem. It’s just midi that basically misbehaves when my ASIO buffers are set to very low or very high. This ‘very low’ setting is new information…I always forget to mention everything in these posts :confused:

I’ll try the ‘keep devices open’ on midi. ASIO drivers run with this option checked for audio and it’s not user alterable.

Thanks again for all the ideas,


If you are using ASIO then you nede to set your buffers via the ASIO control panel for your soundcard.

The buffer settings in N won’t do anything and will be over-ridden by your ASIO settings in your soundcard control panel.

If you are using WDM then the N buffer settings will control your buffers.


Hi Rich,

Yes, I’m aware of that. Thanks all the same :)

I think what I’m really getting at is this. In cubase, if you record a midi track at the beginning of a recording (or enter notes manually) then this track seems to remain syched to audio, despite how many audio tracks you might add with the accompanying increase in ASIO buffer size you might have to make…breath…

In nTrack, as I increase ASIO buffer size to accommadate more audio tracks, that initial midi track becomes delayed, or on some buffer settings (in this case very long buffer settings) then it is delayed and out of time.

The point should be made that if I start playing on my midi keyboard with large ASIO buffer settings, then there is a definite latency in Cubase and nTrack both. This is to be expected and not my point.

So, my hypothesis is; Cubase compensates that initial midi track (ie. plays the midi notes earlier) as ASIO buffers increase…this seems doable to me…and as I understand it Steinberg pretty much invented ASIO so they probably have thought of this and know how to do it.

I might be talking out my … But this is the conclusion I’ve come to.

From memory the issue is not so much of an issue with WDM drivers…but I like to use ASIO as M-audio have good ASIO drivers and lactency is low…also the VU meters work in ‘real time’ with ASIO…hehehe…I like that :)