Midi Help Needed

Timing and tuning issues

I could use some help with my midi set-up.

I’m using an Optimus keyboard into a Delta 1010LT midi interface.

The VST instruments work fine with my keyboad EXCEPT:

1 - The instruments appear to be 1/2 to 1 step low out of tune. I tried adjusting this through the keyboard setting, but it doesn’t have any effect.
2 - When I play back one midi recording while recording a second, the two are out of synch. I don’t have this synch problem when recording multiple analog tracks.

Thanks in advance.

-TJ

What version of N ?

Is your midi timer in the midi pref’s set to wave or system (it should be wave).

What’s the specs of your PC ?

I had endless midi timing issues on my Celery 1gHz and 256 MB ram.
Since the upgrade it all gone …


W.

First, are you sure you’re playing the VST instrument, and not (by accident) the MS Wavetable synth built into Windows? By default, that’s what gets used, and that synth is no good for this purpose (plus it’s not what you intended to do anyway). Of course, you’d also hear a long latency when playing, so perhaps this isn’t it.

In the MIDI track properties, there’s a transpose box. Make sure that’s blank or zero (or whatever means “no transposing”).

And definitely use “wave” timing if you can. Some built-in soundcards don’t work in that mode (I had one once, 2 computers ago).

Finally, while it’s best to find and fix the latency/sync problem, sometimes you can reduce the effect of it by configuring for low latency. (If you’re using a MIDI keyboard and monitoring the VSTi, you have to do this anyway, or the notes are delayed.) The easiest way to get low latency is simply to select the ASIO driver for the soundcard (“Preferences -> Audio Devices”). Sometimes it’s not obvious which is the ASIO driver, so you can go to Advanced there and turn off every kind except ASIO.

If your soundcard doesn’t support ASIO, there are other ways. But note that I consider this a workaround rather than a solution, because you’ll still have the timing issue – only, it’ll be in milliseconds, not quarter notes. Close enough to live with if you can’t get to the bottom of the real cause.

your soundcard uses to play back the midi notes in audio set the buffers to 64 sample for fast playback timing - you can set it lower but you may get breakup - setting it higher will just add greater and greater delay to the time it takes the input note to be played back -

using the WAVE setting that everybody is talking about uses the timing supplied by the 1010 to sync N - system uses the PCs timing to sync N -

when you opened a VST instrument you should have opened it through the ‘add vst instrument’ function in ‘track’ dont open the VST instrument through the effects box - also you have to inset a blank midi track to the timeline - right click on this track and set ‘output to’ to your VST instrument, this makes sure that the MIDI is going in to and out of VST the correctly -

when you insert a new instrument track to N, no track appears just the VST GUI, if you accidently close the GUI you can only open it again by clicking in the lower box ‘GREEN TEXT’ on the fader for that track -

tuning is a far more dificult animal to tackle - first you have to ckeck through the presets on your leyboard as to what it is set to - if there is a dedicated tramspose knob or slider, the control should be set midway (slider) centre indent (knob) - also VELOSITY could be a problem you will come across, you may have to hammer the keys to get any volume level at all - if that is the case set the KBD velosity to off (or permantly set it to 127) - personally i think that the problem lies in N but you have to eliminate all other possabilities first -
i have noticed that N is very slightly out of tune (flat), not enough to be noticed by the untrained ear - this could be down to the setting (pitch) that N is programmed to, concert pitch is generally accepted to be 400hz (Middle C) but N could be set to 404hz, only a slight difference but noticable to the trained ear - check with Flavio -

there a a whole bag of MIDI problems with N, many of which have travelled through the versions from v3.3.0 - look out for faders 6 & 7 not working in control surface mode - Ns inability to understand SYSX MIDI instructions may criple a control surface by ignoring most of its controls -

MIDI tracks not lining up correctly (same as audio tracks not lining up correctly) LATENCY -

if you are playing your kbd while listening to track/s that are being played back - the recorded track will ALWAYS be out by the amount of time it takes the note to pass through your 1010 then for your PC to store the note on your hard drive - this will be noticable even at 64 sample rate -

ie - you hear note played back, you play kbd, ‘DELAY’, note is recorded -

ANSWER - faster PC, faster hard drives, 800mhz FSB. - NEVER use a laptop for MIDI recording -

PS - make sure MIDI input is always kept OPEN (in MIDI prefs)

yours Dr j

Dr. J,
(tommy, you can probably skip this)

I’ve been using a laptop for MIDI recording since 2003 and it works great. NEVER say NEVER! :wink:

In a properly working system (which I’ve sometimes had, and sometimes not had), audio driver buffer latency is NOT a factor in synchronization – it only affects the delay heard while playing (i.e., from a MIDI keyboard). Of course, it’s possible to have a not-properly-working system and configure low latency and get it to work well enough. This is a situation I had on the second of the three laptops I’ve used (IBM T20, T30, and T42).

It’s not enough to just talk about buffer size, you also have to discuss the number of buffers. The product of the two, divided by the sample rate, determines latency. Some ASIO drivers allow you to configure the number of buffers; others do not. All ASIO control panels are not alike.

Many folks fret a lot more about latency than necessary. The best way to talk about latency is in time, e.g., milliseconds (ms). Even using a built-in soundcard with ASIO4ALL driver (to convert it to ASIO), I can configure for 5 ms latency each way. When using a VST in LIVE mode on an audio track (for example, using an amp modeler for electric guitar), you have to add the input and output latency to get the whole latency. For MIDI, only the output latency counts. There are other factors too, such as the 1 ms serial transmission latency when using MIDI cables, that doesn’t apply when using USB, but these don’t add up to much more than a couple ms.

Now, let’s put the numbers in perspective. I’ve read posts where people talk about the importance of getting to 3 ms latency, but I think that’s BS in the vast majority of cases. Here’s why. Sound travels about a foot in a millisecond. If you can move your monitor speaker 10 feet further away and not notice the latency, then you can tolerate an additional 10 (well, closer to 9) ms of latency. This is a great acid test for your latency tolerance!

In other words, if you set up your keyboard to play its internal sounds, so there’s minimal latency to begin with, and you can move that speaker 10 feet further away than where it normally sits, and you can play without being annoyed by the delay, you can tolerate 9 more msec of audio latency. Assuming 2 msec of miscellaneous latency due to MIDI processing and computer internals, that leaves you 7 msec for audio driver output buffering latency with no problem.

Now try 15 feet away. I find I can do that without noticing a delay or my performance being affected.

Similarly, if two people are playing together and they’re 10 feet apart (without consolidated monitoring), the round trip latency (which is the important thing) is about 18 ms. Can they play tight? You bet, I’ve seen it many times.

Now, let’s do the math. At 44.1kHz recording, a 5 ms delay takes 2050 samples. With 2 buffers (which is typical), that’s 1025 samples per buffer. That’s equivalent to setting the latency to nearly nothing and moving the speaker about 5 feet farther away.

I find that a buffer size setting of 256 works fine on my system and I don’t detect any latency. Nor do any of the keyboard players who use my rig at blues jams (though, one might argue that blues musicians don’t count! :wink: ) At 512, I sometimes think I do, but I’m not really sure – I might just be fooling myself.

Every now and then it gets set higher for some reason, to 2K. When this happens, I do notice it when playing very percussive sounds like piano.

I have no idea what you could possibly mean when you say you think n-Track is “out of tune”. If n-Track played notes, it could be. But it doesn’t, it just replays audio or else instructs plugins to play notes. In the former case, the pitch input equals the pitch output, assuming your soundcard clock isn’t wildly unreliable and also assuming that if it’s doing “internal resampling”, that algorithm is correct. In the latter case, the only possibilities for incorrect pitch are poor programming of the VSTi or else your soundcard’s clock is extremely slow.

Your point about the relationship between synch and latency isn’t quite correct. In a properly working system, n-Track compensates for the input and output buffering delay automatically. (Input buffering only matters when recording audio.) Other delays, such as the time the sound spends traveling in the air between speaker and ear, it does not, and therefore if your speakers are 4 feet away, you’d tend to be 4 ms late. My timing isn’t good enough for that to be significant (few people’s are). If that’s the case for you, you can avoid this by using headphones. Yes, there are other delays that n-Track can’t compensate for, such as MIDI serial transmission latency of 1 ms (due to the baud rate and the 3-byte MIDI note-on message). I doubt these add up to more than 2 or 3 ms.

Have you noticed that, when playing using a MIDI cable and playing 6 notes at the exact same time, the 6th note to actually be played is 5 msec later than the first? No, me neither.

By profession I’m a real-time software engineer, with experience in automotive engine control and data communications. Buffer-induced latencies are basic stuff, stock in trade. It can get confusing, but I’m rather used to dealing with it in real-world situations where accuracy matters. For example, in engine control, if you’re early or late firing that spark, the engine fails EPA tests. One of the things I love about programming is that when I’m full of BS, I find out about it pretty quickly. Yes, that happens on a fairly regular basis! :laugh:

BTW, concert pitch is usually specified as 440 Hz for A above middle C. This gives middle C a frequency of about 261 Hz, according to my math, but I might not be adjusting properly for temperment.

440hz is as you say correct (sorry)

re buffers - first my pC has a 932meg pentium running win2k and USB1 - not the fastest thing in the universe but it works -

i plug in an Edirol USB kbd, start N, drop in a new instrument channel, choose my favourite synth (synth1) and play the kbd - under (default buffering) it is impossible to play as the latency is far to great - so i alter the buffering to Low and it works ok -

until recently i had a Delta 4/10 installed but i transfered that to my studio and i now use either a USB sound blaster or a USB Roland SP606 - when the delta was installed (using asio) i had to set it to 64 samples to play - there being no choice between recording and playback samples - there is just one setting for both - neither the Roland or the SB allow one to set the sample rate so i use Ns prefs for that - having had so many crashs in the past altering buffer size independantly i now always use the presets at the top which sets the buffers in the correct relationship to each other - i dont belive you stated what soundcard you are using ? - i have used both the Roland and the Edirol kbd on a Sony Vaio running XP (USB !) laptop - same story - thats all i can say -

one thing i did find out the other day recording Synth1 (arpeggiator activated) the recorded midi track did not show any arpeggiation) (its obvious now that to play back correctly the same instrument has to be used, but at first one has do a double check) this could explain why some MIDI files i have downloaded sound rubbish, it needs the same instrument installed (and the same settings) to play correctly -

DR J

All:

Thanks for the feedback on my initial post. Unfortunately, I’m on the road “Takin’ care of business” and can’t wait to get home and apply some of your suggestions.

I have a suspicion that the tuning problem I’m experiencing is caused by the VST plug-ins I’m using and not N-Track. I’ll have to do some more experimenting when I return home. I’m experiencing the problem with Dash Siganture’s Eve2 and Soundfont’s oragn and piano emulation VSTs.

Cheers - TJ

Try the free ‘sfz’ VSTi soundfont player. It’s simple and if you have soundfonts to play anyway should work out well. You can find it at http://rgcaudio.com.

Thanks, Lear. I’ll check it out when I get back home. I’ll let you all know if I make any progress.

Cheers - TJ

OH, about the half-step out-of-tune-ness.

Usually this is caused by taking a track recorded at 48kHz and playing it back at 44.1 kHz (or vice versa). Now, that shouldn’t happen with plugin instruments and n-Track, but perhaps for some reason your soundcard is not responding to N’s setting, instead using some internal setting, and the two aren’t running at the same rate. But I think this would cause even more problems for softsynths, so it might be a red herring.

Plus I’ve never heard of that happening with a 1010.

I have seen a few vst instruments (specific sounds) that were out of tune. The underlying cause of every one was samples that weren’t quite in tune from the get go. Not that this is the problem here, but it is a possibility especially if some sounds (use different samples) are in tune and others aren’t when using the same vst plug-in.

Also, make 100% sure there are no stray MIDI events that might be affecting tuning, such as pitch bend. A problem from long ago when using hardware synths was that once a patch was bent with pitch bend it would stay there until bent back up, even if a new MIDI file was opened an played, and to make things worse some synths would remember the bending through power-down and power-up. I can’t imagine any software synth doing that though, but existing MIDI files, especially old ones, are notorious for leaving the MIDI settings in odd states. I definitely don’t think this is the issue.

If it’s like a half step off I think Jeff may be on to it with the 44.1k-48k thing.

Lear:

I just returned home and changed my sampling rate of my 1010LT and N-Track from 44.1K to 48K and BINGO! Your suspicions were correct. This appears to have corrected both my tuning and timing problem. My keyboard and VSTs are now in tune. And, I was able to overlay several MIDI tracks with no timimg problems between tracks.

Once again - life is good. :D

Thanks Lear and all of the rest of the N-Track gang with your help.

TJ

Glad you’re sorted out, tommy, but something is odd here because you should be able to set the rate in n-Track to 44.1k and it should control the soundcard and is should work.

Note that if you stick to 48k, which is fine, you’ll need to convert to 44.1k to burn to CD. For that purpose, try r8brain; google to find it. The free version works great. n-Track has this feature too, but it’s one where the software really affects the sound quality, and most folks think r8brain sounds best for the money.

Thanks, Lear. Maybe I need to research this some more and determine why I’m having tuning/timing problems at 44.1K.
-TJ

Yeah, but enjoy a system that’s working for a while, before you mess with it! :laugh: