Old 10-16-2016, 08:14 PM   #1
eugen2777
Human being with feelings
 
eugen2777's Avatar
 
Join Date: Aug 2012
Posts: 271
Default Q: JS - pdc_midi

Hello. I had questions about the delay compensation for MIDI.
When I use pdc_midi, the compensation(for MIDI) does not depend on the pdc_delay. And is always a multiple of the size of the block.
For example, if blocksize = 128:
pdc_delay = 20, in any case it will compensate 128;
pdc_delay = 130, in any case it will compensate 256;

1)This is normal?
2)Well, if this is normal, Is it possible to always have the correct value?
Currently I am using samplesblock - but this is obviously not always give the correct result(rare, but possible).

real_midi_compensation = ceil(my_val_smpls/samplesblock)*samplesblock;

Are there other, better way?
__________________
ReaScripts
eugen2777 is offline   Reply With Quote
Old 10-16-2016, 11:48 PM   #2
ijijn
Human being with feelings
 
ijijn's Avatar
 
Join Date: Apr 2012
Location: Christchurch, New Zealand
Posts: 479
Default

Quote:
Originally Posted by eugen2777 View Post
Hello. I had questions about the delay compensation for MIDI.
When I use pdc_midi, the compensation(for MIDI) does not depend on the pdc_delay. And is always a multiple of the size of the block.
For example, if blocksize = 128:
pdc_delay = 20, in any case it will compensate 128;
pdc_delay = 130, in any case it will compensate 256;

1)This is normal?
2)Well, if this is normal, Is it possible to always have the correct value?
Currently I am using samplesblock - but this is obviously not always give the correct result(rare, but possible).

real_midi_compensation = ceil(my_val_smpls/samplesblock)*samplesblock;

Are there other, better way?
Hi!

Yes, I'm pretty sure that's normal. I guess it's necessary to keep block boundaries aligned, so there is a limited granularity in that sense.

You may know this, but you can always check the live expected vs actual PDC results in the plugin window here:



If there's a difference between the two values it should should up. Or is that how you found out about the difference to begin with?

I think you're on exactly the right track. You should be able to compensate for it using a trick along the lines of what you plan on doing, either setting the pdc_delay to a nice "round" number, or what I usually do: nudging outgoing event offsets by the discrepancy, typically maintaining an event queue to help with crossing samplesblock boundaries. Good luck!
ijijn is offline   Reply With Quote
Old 10-17-2016, 01:46 AM   #3
eugen2777
Human being with feelings
 
eugen2777's Avatar
 
Join Date: Aug 2012
Posts: 271
Default

ijijn, Thank you.
At the moment, I also use a similar method. It works well for my task, up to the sample (how it allows midi-ppq). Just wanted to know if it is correct...
Well, one more thing. I can not reduce latency compensation "on fly" (only after restart playback). I can only increase it. The variable pdc_delay is changed, but the real delay compensation is not changed (and values on the FX window).
__________________
ReaScripts

Last edited by eugen2777; 10-17-2016 at 01:51 AM.
eugen2777 is offline   Reply With Quote
Old 10-17-2016, 02:04 AM   #4
ijijn
Human being with feelings
 
ijijn's Avatar
 
Join Date: Apr 2012
Location: Christchurch, New Zealand
Posts: 479
Default

Quote:
Originally Posted by eugen2777 View Post
ijijn, Thank you.
At the moment, I also use a similar method. It works well for my task, up to the sample (how it allows midi-ppq). Just wanted to know if it is correct...
Well, one more thing. I can not reduce latency compensation "on fly" (only after restart playback). I can only increase it. The variable pdc_delay is changed, but the real delay compensation is not changed (and values on the FX window).
Ah yes, I've also had mixed results when trying to change pdc_delay, such as in this thread. From the sound of things, you're a lot braver than I!
ijijn 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 12:48 PM.


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