Logic Pro 8 Midi timing problem

I'm having a midi timing problem on a current project. Using a Yamaha SO8 synth as a controller. When I record midi the notes show up around 1/32 note late in the piano roll. Note that there is no audible delay when using the synth's built-in sounds. If I then quantize, the notes clearly play too early. I then must choose "+99" in the delay parameter in the inspector. I was originally alerted to this problem when I attempted to play the EVB3 and heard an unusually audible delay between striking the key and hearing the sound. I understand that with that particular instrument, some latency may be expected, but I've never experienced anything like this.

I've checked all the preferences I can think of. This problem does not exist in other projects. Clearly I've caused havoc with this project, but can anyone make any suggestions as to how to fix it?

Logic Pro 8.02, MacBook 2.0, audio & midi interfaces which have never presented these problems.

A couple added details. First, I uninstalled and reinstalled the midi driver (Edirol UM-1SX) which made no difference. (Not a big surprise given that on other project the midi works fine.) Also, notes are showing up about 145 ticks late.

Solution & Suggestion

Fixed it. Changed the "Plug-in Delay Compensation" setting from All to Audio and Software Instrument Tracks." Midi now arrived on time as as expected. The manual states that Plug-in delay compensation works seamlessly during playback and mixing." But that it "may lead to problems if you decide to make further recordings after setting plug-in delay compensation to All, and inserting latency-inducing plug-ins in auxes and outputs" (pp. 850-851). I did both. The manual goes on to suggest numerous fixes, including the one I eventually stumbled upon.

Once again--read the manual, idiot. (In this case, I'm the idiot.)