I am playing a midi track out to my digital piano and then routing audio back into Reaper. Track 1 plays midi, tracks 2 and 3 recorded the audio. On track 3 I set the "Preserve PDC ..." on it. Should I just expect to manually move the track after recording it or is there a way to adjust? Track 2 does not have "Preserve PDC..." but seems to arrive first.
The time gap between the midi event and the audio in track two is the time to transmit the midi event and the keyboard to receive and output audio.
You could change your recording offset in preferences so the audio is aligned with the midi event after recording. You would have to figure out how many samples that is and also add in the sample length of your audio buffer.
The time gap between the midi event and the audio in track two is the time to transmit the midi event and the keyboard to receive and output audio.
You could change your recording offset in preferences so the audio is aligned with the midi event after recording. You would have to figure out how many samples that is and also add in the sample length of your audio buffer.
If I recall correctly.
Okay and does it make sense that the track with PDC enabled actually was recorded later in time?
I suspect track 2 is the time you heard it and track 3 is the time it passed through your audio buffer into Reaper
so yes, track three is "when it was recorded" or more accurately "when it arrived in Reaper" which is slightly later than when you heard it because it had to work it way through the audio buffer.
I'm assuming you are monitoring the keyboard directly--not through Reaper.
I suspect track 2 is the time you heard it and track 3 is the time it passed through your audio buffer into Reaper
so yes, track three is "when it was recorded" or more accurately "when it arrived in Reaper" which is slightly later than when you heard it because it had to work it way through the audio buffer.
I'm assuming you are monitoring the keyboard directly--not through Reaper.
Tracks 2 and 3 were recorded at the same time and the MIDI was just being played back as it had been recorded previously. The audio was heard through Reaper with a sound on the keyboard turned off to its built-in speakers
You can manually move them or try ReaInsert to auto align them during the recording. I usually prefer to just manually move them when I'm not somehow tied to making changes and monitoring through that to/from loop. You could also pop JS:Time Adjustment on the track after measuring the latency but I think it's better to just move them so that the waveform visually aligns as well.
__________________ Music is what feelings sound like.
Not trying to highjack the thread, but there's somewhat similar thing I've seen:
I did some testing regarding Midi versus Audio after the audio latency was tuned to be sample-accurate.
One of the tests was to send a Midi note to a (hardware) Roland drum kit and record the varying arrival times of the audio generated by the drum kit. The audio arrived at varying times over 19 takes done in a loop.
The earliest audio was something like 1500 samples before the midi note, the latest was 76 samples after the midi. The latency drift had somewhat of a constant offset, forming a barber-pole appearance in the takes.
So... cool! I have a time machine, sort of. The music comes out even before I play it!
I am playing a midi track out to my digital piano and then routing audio back into Reaper. Track 1 plays midi, tracks 2 and 3 recorded the audio. On track 3 I set the "Preserve PDC ..." on it. Should I just expect to manually move the track after recording it or is there a way to adjust? Track 2 does not have "Preserve PDC..." but seems to arrive first.
first, you should do a proper audio latency test of your audio device setup. I'm showing how this is done in this video:
Once audio latency is correctly compensated for, you may do a similar latency test for your MIDI devices and account for their latency by entering a (possibly negative) ms correction value in the corresponding field in the MIDI device's output enabling dialog. Ideally, audio and MIDI items should land on the correct spots in Reaper and be accurately aligned, however, as MIDI timing has far lower accuracy than audio timing (MIDI ticks accuracy vs. sample accuracy), MIDI items will not align with 100 % accuracy and consistency but within a fairly narrow and usable margin.
The earliest audio was something like 1500 samples before the midi note, the latest was 76 samples after the midi.
Seems like something does not adhere to "sample accurate MIDI timing". (Technically a Midi event is timed by defining a sample block plus an offset. The software needs to use both to do fine grained timing).
-Michael
Seems like something does not adhere to "sample accurate MIDI timing". (Technically a Midi event is timed by defining a sample block plus an offset. The software needs to use both to do fine grained timing).
-Michael
I have sample accurate *audio* timing, as I stated in the post. Reaper has no means of fine tuning Midi timing. The available adjustments only serve to adjust audio timing.
The Midi timing variance is an internal Reaper thing. It appears, from my measurements, to vary from -60% to +1% of the one-way audio latency duration, for the same midi note sent on sequential loops.
This was at a fairly high buffer setting, 2048. I could lower the audio latency and would expect shorter jitter time excursion, with similar percentages, but don't really need to for the work I do.
I just found it an interesting test result and thought I would share it.
The Midi timing variance is an internal Reaper thing.
No.
Reaper does not delay Midi (or shift Midi timing vs audio timing) as long as the midi stream stays in tracks.
If the Reaper Control Path (e.g. via "learn" ans or Midi Device "control" checked) is involved, timing can be problematic, as same lives on the non-realtime GUI thread of the program.
Reaper just propagates Midi with the audio buffers.
Audio is timed, as each sample has a dedicated position in each buffer. Hence the plugin can work appropriately.
Midi is timed, as each Midi event comes with an "offset" that defines the according sample number within the buffer. Hence the plugin can work appropriately. But not all do this correctly.
Of course with outboard equipment things get complicated as the USB Midi and audio interfaces are involved. E.g. it's known that Midi via USB might result in a varying Midi delay, as the Midi messages are embedded in USB buffer transfers that might be forced to an unrelated timing due to other stuff running in the computer's OS. Using USB3 equipment and/or a dedicated USB interface for the Midi hardware might (or might not) help.
Quote:
Originally Posted by Philbo King
It appears, from my measurements, to vary from -60% to +1% of the one-way audio latency duration, for the same midi note sent on sequential loops.
Did you use a reliable measurement equipment (which obviously would need to be a VST or JSFX plugin) that does not involve anything but Reaper (the program, not the distribution) itself for recording the Midi and audio events ?
Coachz, yes, enabling "Preserve PDC monitoring in recorded items" moves the recorded audio later.
It's for when you are recording human input (which you are not doing here), and plugin delay is making the sound you hear late to such an extent that you are compensating with your playing by playing early...you're trying to pull the sound earlier to make it sound in time...the preserve setting will move your recorded early playing later... it compensates for the compensation you have made in your playing.
It's a confusingly named setting, but it's hard to come up with a succinct name that actually describes what it does. I think of it like this: I already know that PDC (Plugin Delay Compensation) is for playback; it lines up everything you hear by moving any non plugin delayed stuff later. Similarly, the preserve setting moves your recorded stuff later.
Reaper does not delay Midi (or shift Midi timing vs audio timing) as long as the midi stream stays in tracks.
If the Reaper Control Path (e.g. via "learn" ans or Midi Device "control" checked) is involved, timing can be problematic, as same lives on the non-realtime GUI thread of the program.
Reaper just propagates Midi with the audio buffers.
Audio is timed, as each sample has a dedicated position in each buffer. Hence the plugin can work appropriately.
Midi is timed, as each Midi event comes with an "offset" that defines the according sample number within the buffer. Hence the plugin can work appropriately. But not all do this correctly.
Of course with outboard equipment things get complicated as the USB Midi and audio interfaces are involved. E.g. it's known that Midi via USB might result in a varying Midi delay, as the Midi messages are embedded in USB buffer transfers that might be forced to an unrelated timing due to other stuff running in the computer's OS. Using USB3 equipment and/or a dedicated USB interface for the Midi hardware might (or might not) help.
Did you use a reliable measurement equipment (which obviously would need to be a VST or JSFX plugin) that does not involve anything but Reaper (the program, not the distribution) itself for recording the Midi and audio events ?
-Michael
Why would I do that? I don't use VSTi plugs at all. I was interested in Reaper communicating with devices I actually use.
You can quote theory to me all day; but one test verifies whether the theory holds up.
Without theory and decent measuring you will not find out what exactly might cause the problem.
I don't claim it's not there, but I do claim that it's very unlikely that Reaper itself can do anything about it.
-Michael
Agreed. Unless they revamp Reaper architecture to add another real time processing kernel for midi (separating Midi timing from audio sample processing), the problem will remain.
That would leave only midi (the ~31KHz bit transfer rate) & USB & Windows driver latencies as possible causes. And it's quite possible that one or more of these are indeed the cause now.
I was not trying to solve a problem, I was simply measuring the midi jitter for my outboard midi devices by looking at the final result of the delay between 'midi note sent' and 'audio returned' while recording. This is the reason I tuned the audio to get sample-accurate audio recording before doing the test: to remove that parameter from the results.
For what it's worth, all of these are using MIDI DIN 5 pin connectors; none are 'USB midi'.
This was just one test from a large group of tests on all my outboard midi devices. I have 2 Roland guitar synths, a Korg keyboard driving a rack mount synth, and a control surface in addition to the Roland drum kit. I got a lot of interesting data in the results.
Just an aside that pitch-to-midi devices have latency that can look like jitter because the latency of low notes is different than higher notes do to conversion time of waveforms of different lengths - same reason they tend to track slower on low vs high notes. I'm not saying it's related but when I read your first post, my immediate thought was "is he using and pitch to midi devices".
__________________ Music is what feelings sound like.
first, you should do a proper audio latency test of your audio device setup. I'm showing how this is done in this video:
Once audio latency is correctly compensated for, you may do a similar latency test for your MIDI devices and account for their latency by entering a (possibly negative) ms correction value in the corresponding field in the MIDI device's output enabling dialog. Ideally, audio and MIDI items should land on the correct spots in Reaper and be accurately aligned, however, as MIDI timing has far lower accuracy than audio timing (MIDI ticks accuracy vs. sample accuracy), MIDI items will not align with 100 % accuracy and consistency but within a fairly narrow and usable margin.
.
I just did the audio latency correction and my RME 9652 reports 345 samples off. I put the value in prefs but I'm not sure if this is right. Which bottom sample should line up with the top please ? Also should I nudge it another 3ms forward to account for 3 foot distance from my nearfields to my ears ? 3*44.1 = 132.2 samples
It also appears that Windows 10 has more latency.
Using RTL Utility at 44.1khz on Windows 10 Pro 64 bit
Soundcard: RME 9652
to Digimax FS interface using analog cables looping DAC outputs back to inputs
Not trying to highjack the thread, but there's somewhat similar thing I've seen:
I did some testing regarding Midi versus Audio after the audio latency was tuned to be sample-accurate.
One of the tests was to send a Midi note to a (hardware) Roland drum kit and record the varying arrival times of the audio generated by the drum kit. The audio arrived at varying times over 19 takes done in a loop.
The earliest audio was something like 1500 samples before the midi note, the latest was 76 samples after the midi. The latency drift had somewhat of a constant offset, forming a barber-pole appearance in the takes.
So... cool! I have a time machine, sort of. The music comes out even before I play it!
Can Reaper compensate for the midi latency too ? Is there a plugin that I have to put on each track for each external instrument once I know their latency ? I have audio latency tuned to be sample-accurate.
As a further test I played a click through my monitors and then recorded the kawai es8 piano. I played one note in time with the click and also recorded the audio directly out of the piano. My input manual offset is 345 which makes my audio interface sample accurate.
After I had recorded this live piano note, I played it back and recorded it on tracks 12 and 14. Oddly track 12 sounds the best. Upon listening to the click and each audio track in pairs I found that the live audio track 10 sounds to be rushed and too early and track 14 sounds too late. Track 12 sounds just right. What is going on please ? The midi uses MIDI DIN 5 pin connectors
Tracks
10 The audio out of the ES8 live as I played one note to the click
11 The midi out of the ES8 live as I played one note to the click
12 Audio on playback from the midi notes with no PDC
13 Same as track 11 but with PDC turned on for midi recording
14 Audio on playback from midi notes with PDC
I'm disappointed and a bit pissed that I have spent entire days trying to get straight answers to something that should have MUCH MORE documentation. I SHOULD be making music, not dicking around with offset values ad nauseum. Please help me !
OK, did some light testing and all I can do for now... Ran a MIDI groove from Track 1 out my RME UFX MIDI port > Boss DR770 > Audio input on Track 2.
The largest jitter amount was 90 samples @ 48k with a 96 sample buffer, latency about 286 samples. Changing to low-latency, low-precision mode I got about the same largest jitter (though a little lower @ 84 samples), latency was down to 77 samples.
This seemed so familiar I must have done it years ago and reminded me of why I still prefer to record it, then slip it over and be done. I can get it effectively sample accurate that way (if there is such a thing as sample accurate when MIDI gets turned into audio, travels through analog gear then digitized again) but even if off a few samples it's still a magnitude tighter than any musician could ever play and as tight as MIDI hardware minus a DAW. Jitter won't matter because the slip/move of the item to fix the latency fixes that anyway. Could be missing something though.
I certainly wouldn't mind if it were auto-magically 'sample accurate' but it's not something I thought would really be possible - if that happens though, I'm in. FYI, I used a MIDI DIN cable for the DR770 but the Fireface UFX is connected via FireWare.
I tried to use ReaInsert but it didn't seem to be happy - not sure what the problem was, the RME indicator showed it was definitely sending MIDI data but whatever it was didn't trigger the drum machine and if that isn't happening there's no audio to send back to reaper IOW... reainsert appears to allow MIDI out and audio in but beats me how to make it work for now.
__________________ Music is what feelings sound like.
thanks for the experimentation. How do you measure jitter? Tomorrow morning I'll be back on it and it would be nice if devs would shed more light.
I let it loop record 5 passes then set the timeline to samples, made a selection between the two passes that are the furthest apart- then the little selection info display (bottom-right of TCP) will tell how many samples are selected. I measured latency the same way by selecting from the start of the MIDI note on track 1 to the start of the waveform on track 2.
__________________ Music is what feelings sound like.
I just did the audio latency correction and my RME 9652 reports 345 samples off. I put the value in prefs but I'm not sure if this is right. Which bottom sample should line up with the top please ? Also should I nudge it another 3ms forward to account for 3 foot distance from my nearfields to my ears ? 3*44.1 = 132.2 samples
you have to do the audio latency test fully electrically and not measure latency by playing back the reference click through loudspeakers. Just connect (preferably a spare and not the main) audio output of the interface (the output you will listen to while doing overdubs) directly with one of the interfaces inputs via a cable. Obviously, make sure to avoid any possible audio feedback by having monitoring disabled during the test recording passes.
I just did the audio latency correction and my RME 9652 reports 345 samples off. I put the value in prefs but I'm not sure if this is right.
No need to do this for HDSP 9652. Automatic setting (driver reported latency) should be fine (RME driver reports the latency). Other cards (with analog AND digital inputs) might need manual compensation.
How do you get the signal from the computer to 5 pin and back without using USB ?
-Michael
I have 3 different midi interface devices. 2 use USB, and the 3rd plugs into a motherboard PCI slot, which is the one I plug the drums into and used for the test. But they all performed similarly as regards jitter in Reaper. I'm trying to think up a way to use another program, maybe MidiOx, and retest. I'll probably have to dig out my old Tektronix oscilloscope to pull that off since MidiOx doesn't do audio. But that would at least verify if the jitter is from Win7 or the device driver. Or not...
That will all have to wait a while, till my recording schedule thins out a bit.
I feel I should bow out of this thread now; I've crapped on it enough. But I'll PM you if I ever get time to do additional tests, if you're interested.
No need to do this for HDSP 9652. Automatic setting (driver reported latency) should be fine (RME driver reports the latency). Other cards (with analog AND digital inputs) might need manual compensation.
I have 3 different midi interface devices. 2 use USB, and the 3rd plugs into a motherboard PCI slot, which is the one I plug the drums into and used for the test. But they all performed similarly as regards jitter in Reaper. I'm trying to think up a way to use another program, maybe MidiOx, and retest. I'll probably have to dig out my old Tektronix oscilloscope to pull that off since MidiOx doesn't do audio. But that would at least verify if the jitter is from Win7 or the device driver. Or not...
That will all have to wait a while, till my recording schedule thins out a bit.
I feel I should bow out of this thread now; I've crapped on it enough. But I'll PM you if I ever get time to do additional tests, if you're interested.
I did a few small tests for myself and discovered that enabling "preserve PDC delayed monitoring..." takes your audio card's reported latency into account, so higher buffer sizes will result in larger rightward shifts. If you don't enable it there will be no shift no matter what plugins you have and what the buffer size is, which is useful if you're recording your midi by playing a hardware synth that makes its own noise.
I found thar for my external Kawai digital piano that I had to set its midi output to -11 milliseconds so that when midi plays back out of Reaper that the audio being recorded would line up with the MIDI. I also read that 20 milliseconds is the most you can use for this parameter.
Now on to the subject of use audio driver reported latency and input manual offset and output manual offset. Can anybody tell me how these three controls interact and further how they relate to MIDI driver output latency values?
So you use this as an "outboard effect". If so, you should do it by ReaInsert
-Michael
I doesn't appear that ReaInsert will help me as it seems ReaInsert is for breaking the AUDIO chain and sending audio out and back. I"m sending midi out and getting audio back.