Old 12-18-2017, 12:58 PM   #1
Tycho
Human being with feelings
 
Tycho's Avatar
 
Join Date: Jan 2011
Location: San Francisco
Posts: 360
Default MIDI Delay Compensation

When recording midi, all events are placed on the timeline before they were played, with the offset increasing as the buffer size is lowered. For instance, at a buffer size of 256, midi notes played will show up on the timeline about 1/16 of a note (at 120bpm) ahead of where they were actually played. At 64smpl buffer they will show up around 1/8 note ahead of time. I always have to go in and slide all the notes over to the right to get them to line up. This does not happen with audio, only midi.

In the attached image you will see first a midi track, which is clearly shifted forward on the grid, then an audio track which, save for some sloppy playing, is generally in the correct position. and finally the grid quantized click track I was playing to.

The offset is not variable, all notes are placed on the timeline at a fixed offset ahead of where they were played, meaning I can just bulk slide all of the material and that fixes it.

I have "Use Audio Driver Reported Latency" checked with "0" for both output and input manual offset. Unchecking it doesn't fix the issue. setting the manual offset has no effect. setting the midi input driver mode to "QPC" in timestamp options has no effect.

this happens with all the midi interfaces I have, integrated usb interfaces on the midi controllers themselves as well as an iconnectmidi2. this issue has persisted across three machines and various versions of reaper. can't quite remember when it started but it's been a few years I think.

I appreciate any insight anyone might have on this issue.
Thanks
-Scott
Attached Images
File Type: jpg midi offset.jpg (52.1 KB, 349 views)

Last edited by Tycho; 12-18-2017 at 01:03 PM.
Tycho is offline   Reply With Quote
Old 12-18-2017, 01:02 PM   #2
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,663
Default

right click the arm record button6 on the track, what is your setting on the track to Preserve PDC delayed monitoring? Try changing it.
heda is offline   Reply With Quote
Old 12-18-2017, 01:07 PM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,369
Default

This kind of a blind shot but you could try enabling "Preserve PDC delayed monitoring in recorded items" (rightclick on a track's record-arm button to get there), if not already enabled.

Here's one (admittedly old) report when it seems to have helped in a similar situation:
https://forum.cockos.com/showthread.php?t=128965

edit:
heda beat me.
nofish is offline   Reply With Quote
Old 12-18-2017, 01:11 PM   #4
Tycho
Human being with feelings
 
Tycho's Avatar
 
Join Date: Jan 2011
Location: San Francisco
Posts: 360
Default

thanks guys. tried that but enabling "Preserve PDC delayed monitoring in recorded items" didn't seem to help. in fact it doesn't seem to have any real effect at all.
Tycho is offline   Reply With Quote
Old 12-20-2017, 04:19 PM   #5
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,628
Default

This is consistent with the audio driver under-reporting the output latency

1) Make sure Prefs/recording/use audio driver reported latency is set, and the manual offsets set to 0.
2) Record some MIDI
3) measure how early it is (maybe measure multiple note hits in order to get the average)
4) Enter that value in the "output manual offset" field (Either in samples or msec)
5) Try testing and hope it works right

If that latency increase makes the audio incorrectly aligned, you might want to enter a negative copy of that value in the "input latency" field, to correct the audio (it's possible that your audio device is reporting the correct total latency, but putting too much of it on the input side rather than the output side).
Justin is offline   Reply With Quote
Old 12-26-2017, 08:35 PM   #6
Tycho
Human being with feelings
 
Tycho's Avatar
 
Join Date: Jan 2011
Location: San Francisco
Posts: 360
Default

Thanks Justin. Tried this without any luck. I think there must just be something fundamentally wrong with the way I record midi or something. Will keep using the workaround.
thanks for the help everyone!
Tycho is offline   Reply With Quote
Old 12-30-2018, 06:41 PM   #7
explodingPSYCH
Human being with feelings
 
Join Date: Sep 2015
Posts: 221
Default

Quote:
Originally Posted by Justin View Post
This is consistent with the audio driver under-reporting the output latency

1) Make sure Prefs/recording/use audio driver reported latency is set, and the manual offsets set to 0.
2) Record some MIDI
3) measure how early it is (maybe measure multiple note hits in order to get the average)
4) Enter that value in the "output manual offset" field (Either in samples or msec)
5) Try testing and hope it works right

If that latency increase makes the audio incorrectly aligned, you might want to enter a negative copy of that value in the "input latency" field, to correct the audio (it's possible that your audio device is reporting the correct total latency, but putting too much of it on the input side rather than the output side).
Any update on this issue? I'm running the newest version of Reaper and still having this problem.

I've tried these steps and it will align my midi, but then my audio is lagged. My midi seems to align with Output Manual Offset set to -45.00, but my audio is aligned at 12.0 and 8 samples.

When my audio is aligned all my recorded midi is, like Tycho said, ahead of the beat by a significant amount that is jarring. When my midi is closer to aligned (though it's hard to ensure it's completely accurate) the audio is lagged when doing a pass through test.
explodingPSYCH is offline   Reply With Quote
Old 01-17-2019, 12:08 AM   #8
drichard
Human being with feelings
 
Join Date: Jun 2016
Posts: 446
Default

This is an old thread, but I'm seeing some issues as well with MIDI. Somehow the audio and MIDI recording compensations differ.

Audio works, or at least I can make it work perfectly. Following Justin's advice I was able to get audio to be sample accurate. I compensate at the output manual offset. In my case, 26 samples of compensation gives sample accurate audio recording.

But I am not seeing a solution to the MIDI compensation problem. I looped a MIDI output back to a MIDI input, created some 1/4 notes exactly on beat, and recorded them to a new track via the loop. In the new track the MIDI notes are ahead of the beat by a fairly significant amount. I tried various output compensation settings, but they did not help the problem. While changing the output compensation offset didn't seem to help the MIDI timing, it does mess with the audio timing.

I can work around this. When choosing between MIDI or audio record accuracy, accurate audio timing/compensation is much more important to me than MIDI. I'm not a very precise keyboard player so I tend do edit my timing anyway, and this is simply one extra step. But I think it's something that Justin and Schwa should be aware of.



Quote:
Originally Posted by Tycho View Post
When recording midi, all events are placed on the timeline before they were played, with the offset increasing as the buffer size is lowered. For instance, at a buffer size of 256, midi notes played will show up on the timeline about 1/16 of a note (at 120bpm) ahead of where they were actually played. At 64smpl buffer they will show up around 1/8 note ahead of time. I always have to go in and slide all the notes over to the right to get them to line up. This does not happen with audio, only midi.

In the attached image you will see first a midi track, which is clearly shifted forward on the grid, then an audio track which, save for some sloppy playing, is generally in the correct position. and finally the grid quantized click track I was playing to.

The offset is not variable, all notes are placed on the timeline at a fixed offset ahead of where they were played, meaning I can just bulk slide all of the material and that fixes it.

I have "Use Audio Driver Reported Latency" checked with "0" for both output and input manual offset. Unchecking it doesn't fix the issue. setting the manual offset has no effect. setting the midi input driver mode to "QPC" in timestamp options has no effect.

this happens with all the midi interfaces I have, integrated usb interfaces on the midi controllers themselves as well as an iconnectmidi2. this issue has persisted across three machines and various versions of reaper. can't quite remember when it started but it's been a few years I think.

I appreciate any insight anyone might have on this issue.
Thanks
-Scott
drichard is offline   Reply With Quote
Old 03-26-2019, 12:00 AM   #9
Masterlands
Human being with feelings
 
Join Date: Nov 2017
Location: Catalonia
Posts: 28
Default

I completely subscribe your words Drichard.
I'm having this offset when recording midi via Reavoice with my keyboard. Recorded midi file is around 1/4 uncompensated. The poblem is also that I don't have any way to calculate the real offset, so correcting manually this offset becomes a headache because the audio carrier is a real voice track, not qiantized.
This should be adressed, or at least, to have a method to out the exact value of this offset.
Not having problems with midi recorded with other Vsti instruments or samplers.
Masterlands is offline   Reply With Quote
Old 03-26-2019, 07:53 AM   #10
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 8,461
Default

If this really is a bug (according to Justin's post above), you should file a qualified bug report in the appropriate forum.
-Michael
mschnell is offline   Reply With Quote
Old 06-25-2019, 06:07 AM   #11
composerguy78
Human being with feelings
 
Join Date: Nov 2018
Posts: 90
Default

I am experiencing a problem very similar to the OP here.

I have noticed that I need to use JS: Time Adjustment Delay plugin When I record midi at higher tempos (ie. 130 bpm). Upon closer inspection I noticed that nearly all of the midi notes are recorded just before gridlines. See this screenshot:
https://i.imgur.com/hJCDdcx.png - Let's call this midi region A

I tried enabling the "Preserve PDC delayed monitoring" as suggested in a reply here but that then records the midi notes after the gridlines like this: https://i.imgur.com/zQKLo8w.png - Let's call this midi region B

The issue gets more complicated which may be key to this issue I am guessing:
When I playback the midi region B WITH 'Preserve PDC delayed monitoring enabled' The region SOUNDS IN SYNC with the metronome. However, as you can see, the midi notes are noticeably delayed.

Not surprisingly, midi region A sounds about a 16th note early with 'Preserve PDC delayed monitoring' enabled. When 'Preserve PDC delayed monitoring' is NOT enabled, the midi recorded sounds like what it looks like. ie. if the notes are on the grid it is sounds in sync.

So I guess the simple explanation is that the notes are being recorded early. What setting(s) do I need to change here?
composerguy78 is offline   Reply With Quote
Old 06-25-2019, 06:30 AM   #12
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 8,461
Default

Quote:
Originally Posted by composerguy78 View Post
So I guess the simple explanation is that the notes are being recorded early.
What exactly defines the time relation between the Midi stream to be recorded and the grid line ?

-Michael
mschnell is offline   Reply With Quote
Old 07-13-2019, 11:13 AM   #13
Rims
Human being with feelings
 
Join Date: Apr 2016
Posts: 30
Default

Can someone explain in more simple or thorough terms what is happening here?

I have the same issue as the other posters, with midi getting recorded about 20ms ahead of an audio track of the same input source, and the audio track being the correct timing

I can't tell from the thread if this is an audio card or Reaper issue.
Rims is offline   Reply With Quote
Old 07-14-2019, 11:37 AM   #14
Rims
Human being with feelings
 
Join Date: Apr 2016
Posts: 30
Default

****AFTER FURTHER REVIEW****

In my case recording midi with "Preserve PDC delayed monitoring in recorded items" does move the recorded midi back to where I thought I was playing it.

From what I can tell PDC means:

1) If there are delays incurred in playback of tracks caused by plugin processing, Reaper must delay all the tracks in playback so that they can play synched up.

2) When recording to this playback, Reaper will see when you pressed a note, and place it on the grid forward by the amount of latency it added due to plugin processing.

3) "Preserve PDC delayed monitoring in recorded items" means Reaper will put the note on the grid based on when you actually pressed it.


The metronome also seems to click to the delayed beat. I can't see why you would want Reaper to remove the latency when recording since you are playing to the delayed playback, and this moves the notes ahead of the grid

Are there circumstances where you want Reaper to write the midi forward when recording? Because that is the default setting, it makes me think I don't really understand.
Rims is offline   Reply With Quote
Old 07-22-2019, 01:27 PM   #15
davek
Human being with feelings
 
Join Date: Apr 2017
Location: Liverpool, United Kingdom
Posts: 17
Default

I have the same issue, and I get around it by using ASIO4ALL for my audio set at 320 samples and when using midi, I turn off "Use audio driver reported latency" under prefs/recording.

It seems to work fine, but its not convenient.
__________________
Original Music on YouTube : Original Music on Soundcloud : Original Music on Bandcamp
davlinste is the solo work of Dave Kelly, an English songwriter based in Liverpool UK.
davek is offline   Reply With Quote
Old 08-10-2019, 02:00 PM   #16
explodingPSYCH
Human being with feelings
 
Join Date: Sep 2015
Posts: 221
Default

Checking in on this bug again. I'm surprised it's still and issue. Seems like core functionality to have the audio recorded at the correct time/sync!

I'm noticing variation in the recorded audio's lag based on buffer size. Selecting "Use Audio Driver reported latency" helps a lot, but does not stay sample accurate across all buffer sizes. For example, at a buffer size of 128 I find my audio to be 5 samples late, but at 2048 I find the recorded audio 13 samples late.

I still measure 66 samples lag on my MIDI in/out tests which doesn't seem to be affected when I try to add 66 samples to the values to the manual offset.

Any hope for making audio sample accurate across all buffer sizes?

Any updates on making MIDI accurate as well?
explodingPSYCH is offline   Reply With Quote
Old 08-11-2019, 05:46 AM   #17
Doc Brown
Human being with feelings
 
Doc Brown's Avatar
 
Join Date: Jul 2012
Location: Minnesota
Posts: 1,654
Default

I'm hoping this gets fixed in v6 but if not I'm most likely switching to Bitwig. I am using hardware synths mainly now and I like that Bitwig handles that task really well and also incorporates Ableton Link as well. I think Reaper is the best daw out there for the money but not the best for using external hardware or midi in general. I'll still use Reaper but for hardware synth projects I'll use Bitwig. I'm crossing my fingers that v6 is the fix I need for hardware integration.
Doc Brown is offline   Reply With Quote
Old 08-11-2019, 06:22 AM   #18
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 8,461
Default

If you really are sure that this is an issue that Reaper itself imposes, and not the configuration used, this should be discussed in the "Bugs" subforum.

-Michael
mschnell is offline   Reply With Quote
Old 08-11-2019, 08:41 AM   #19
explodingPSYCH
Human being with feelings
 
Join Date: Sep 2015
Posts: 221
Default

Quote:
Originally Posted by Doc Brown View Post
I'm hoping this gets fixed in v6 but if not I'm most likely switching to Bitwig. I am using hardware synths mainly now and I like that Bitwig handles that task really well and also incorporates Ableton Link as well. I think Reaper is the best daw out there for the money but not the best for using external hardware or midi in general. I'll still use Reaper but for hardware synth projects I'll use Bitwig. I'm crossing my fingers that v6 is the fix I need for hardware integration.
I'm in exactly the same situation.
explodingPSYCH is offline   Reply With Quote
Old 08-11-2019, 09:17 AM   #20
Doc Brown
Human being with feelings
 
Doc Brown's Avatar
 
Join Date: Jul 2012
Location: Minnesota
Posts: 1,654
Default

Quote:
Originally Posted by mschnell View Post
If you really are sure that this is an issue that Reaper itself imposes, and not the configuration used, this should be discussed in the "Bugs" subforum.

-Michael

I'm not interested in moving anything to a bugs subforum. This forum is for all things Reaper and life so the original Tycho thread should have been moved immediately if that is the case. Justin and Co have a vision and I respect that and realize it is mainly audio and instrument recording oriented but also includes midi improvements.

I'm not bashing Reaper or it's devs as I believe it is probably the best DAW in terms of features per dollar bar none. Reaper is probably the most customizable daw bar none as well. It's also a fact that Reaper is not at the top in regards to midi and hardware integration and that's just a fact and is well known. Is Reaper perfectly fine for all things audio and midi? In my opinion yes it is and it's very stable at that. That doesn't mean that it is the best choice for hardware and midi either and Ableton's "Link" is probably the standard going forward.

Bitwig and Ableton took another direction in developmental focus and that's hardware integration and live performance. I hope Reaper has some improvements in these areas in v6...
Doc Brown is offline   Reply With Quote
Old 08-11-2019, 11:13 AM   #21
Goldreap
Human being with feelings
 
Join Date: Feb 2009
Location: UK
Posts: 1,046
Default

My understanding:

In order to grid sync both MIDI and audio input, REAPER treats MIDI input latency as being equal to audio input latency.

Justin mentions in post #5 above that an audio device might report correct total latency but mess up the relative amounts of input/ output.

Bear in mind that output offset moves both MIDI and audio in tandem but input offset only moves audio. This allows you to juggle them to sync both MIDI and audio to the grid.

Last edited by Goldreap; 10-16-2019 at 07:39 AM.
Goldreap is online now   Reply With Quote
Old 08-11-2019, 01:55 PM   #22
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 8,461
Default

Quote:
Originally Posted by Doc Brown View Post
I'm not interested in moving anything to a bugs subforum....
The general forum is for discussion - mainly between users.

The bugs forum is for reporting bugs that should be reproducable and clearly an issue of Reaper itself.
Hence the location of the messages does matter.
-Michael
mschnell is offline   Reply With Quote
Old 09-03-2019, 02:44 PM   #23
explodingPSYCH
Human being with feelings
 
Join Date: Sep 2015
Posts: 221
Default

Bug Report Posted here:

https://forum.cockos.com/showthread....19#post2177719

Please add any additional thoughts!
explodingPSYCH is offline   Reply With Quote
Old 11-17-2019, 08:48 PM   #24
panicsurf
Human being with feelings
 
Join Date: Nov 2019
Posts: 1
Default I have the same issue

I used to think that the problem was in my way of playing, but I realized that the problem is reaper. It is a bit disappointing to see that a fault like this has not been fixed yet, hopefully fix it soon in some update. sorry if my english is not the best
panicsurf is offline   Reply With Quote
Old 11-19-2019, 10:29 AM   #25
Philbo King
Human being with feelings
 
Philbo King's Avatar
 
Join Date: May 2017
Posts: 1,771
Default

Quote:
Originally Posted by Goldreap View Post
My understanding:

In order to grid sync both MIDI and audio input, REAPER treats MIDI input latency as being equal to audio input latency.

Justin mentions in post #5 above that an audio device might report correct total latency but mess up the relative amounts of input/ output.

Bear in mind that output offset moves both MIDI and audio in tandem but input offset only moves audio. This allows you to juggle them to sync both MIDI and audio to the grid.

This is very helpful. I've never seen the distiction between input and output offset clearly explained before. Thanks!
__________________
Tangent Studio - Philbo King
www.soundclick.com/philboking - stream music
www.facebook.com/philboking - gigs and news
Philbo King is offline   Reply With Quote
Old 11-21-2019, 02:17 PM   #26
KosmicEarth
Human being with feelings
 
Join Date: Nov 2019
Posts: 2
Default Due Diligence before I buy

Hi First post from UK music maker....
Been diving into Reaper last week & loving it. (BTW The TUTS are awesome - Love the NY accent, very happy memories of my time there from the golden period of 1981 in Central park listening to Simon Garfuncle live

I am about to plunge into the Galaxy known as Reaper after a break of 20yrs away from home studio recording. I was brought here from multiple forum posts Including this AWESOME post - https://forum.cockos.com/showthread.php?t=52382 and by many others highly recommending Reapers multiple VST stability regarding CPU issues like crashes, clicks, etc. on large track recordings.

However Just catching up on this particular thread can you please confirm my Midi Sync to Audio will be hassle free? You see I have x12 External midi driven "Real World" machines (Everything from Multiple M1R's to Old CasioFZ1 samplers, etc) that I wish to combine as I construct my EDM with the very best of the VST world (Kontakt. Dune3,Omni 2.5, Serum, Uhe Repro 1, etc) I know things have moved on but I never want to face the same issues I had with Sonar (And dare I say it the ISIS I/O card !). I am also about to buy a Pro Audio card (Something like the zero latency MOTU M4 but open to suggestions by the pro's here! )to bring me into the "Star Trek" Era : - ) Thanks in advance. (Brain HQ is Acer Nitro, i7, Win764, 8GB Ram, Nvidia GeForce GTX 4GB,SSD, etc. also I have several spare machines for driving other VST's via ethernet & copperlan) Thanks in advance.
KosmicEarth is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.