Computer-aided music

Today I hooked up the MIDI output of my Yamaha digital piano to a USB MIDI interface attached to my Windows XP computer. My first baby steps towards integrating computers and music. I tried playing some of the soft synths that came free with Cakewalk Sonar. However, they seemed to have an extreme amount of latency between me pressing the key and the sound starting. Since the computer is a dual-core Athlon running at 2.4 GHz and has two gigs of RAM, I suspect that the computation is not the bottle-neck. There are plenty of places the latency could be coming from - the keyboard generates a MIDI note-on message, which propogates over a 30' cable, which gets read in by the USB device, sent down the USB stack, read by the program, a waveform is generated, and sent out the sound card, which propogates up a short cable to my speakers, and finally the sound travels back across the room from the computer to the keyboard. The only parts of this I can quantify the latency for are the electrical propogation of the MIDI message, which should be well under a microsecond, and the propogation of the sound waves back across the room, which should be about 15 ms. No doubt having the speakers closer to the keyboard would help, but I feel like the delay is hundreds of milliseconds total.

From the brief research I've done online, it seems like making sure I have the latest drivers for the USB chipset on the motherboard and the Yamamaha USB interface would be a good first step. The USB stack is quite often found to be the culprit in these situations. I shall investigate further tomorrow.

Tag:

Comments:

interesting dilemna - Haven't done MIDI in a while, but considering I don't recall any lag on a Mac SE 30 (like I said: a while) I would agree computation's not likely the bottleneck. would be interested in developments.

Posted by dilly on September 19, 2005 at 02:24 PM PDT #

Check your soundcard drivers. If they support ASIO or WDM, make sure that Sonar is set up to use one of those interfaces, rather than MME. MME (ye olde waye for Windows apps to drive soundcards) typically has awful latency. If your drivers are decent, ASIO should get you to under 10ms of latency on the sound output side of things.

If that does no good, or if the latency is improved but still a problem, USB drivers would be the next thing to try.

Signal propagation down the 30' MIDI cable will add ~ 30 nanoseconds. :-) Sound travels at about 1 foot/millisecond, so that's not a problem for your setup either.

It can be a problem outdoors though: my brother recently attended a dance music festival where they had four sets of speakers pointing inwards at a large dance area, and he found that if he moved away from the "sweet spot" equidistant from the speakers there was noticeable phase cancellation in the bass, and this turned into a horrible "slapback" style echo if he moved even further from the centre. Very poor sound engineering!

Posted by Jason Ozolins on September 19, 2005 at 08:30 PM PDT #

Jason, thanks for the tips! It looks like I am using WDM, so probably the sound card isn't the problem. With regard to cable delay, <nitpicking>I think you forgot that the dielectric in the cable causes about a one-third slowdown - so the delay would be 40 ns</nitpicking> :-) :-) As you say, it is completely negligable.

Posted by Terry Heatlie on September 20, 2005 at 12:34 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

terryh

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today