Reporting audio output socket latency to host
I'm attempting to report the processing latency of my effect device, but I'm rather lost with the documentation and don't know how it's supposed to be done. Any ideas?
- Enlightenspeed
- RE Developer
- Posts: 1111
- Joined: 03 Jan 2019
I've tried to go through pretty much every one of the examples, but I can't seem to find anything relevant to sending any DSP latency information to the host. I wonder what I'm missing here. Is it possible they've changed the examples from one SDK version to another?Enlightenspeed wrote: ↑26 Nov 2020It's actually very simple, just have a look at the code for the silence detection device
Thanks for the reply!
- Enlightenspeed
- RE Developer
- Posts: 1111
- Joined: 03 Jan 2019
Check this for the MoBo declaration:veezay wrote: ↑27 Nov 2020I've tried to go through pretty much every one of the examples, but I can't seem to find anything relevant to sending any DSP latency information to the host. I wonder what I'm missing here. Is it possible they've changed the examples from one SDK version to another?Enlightenspeed wrote: ↑26 Nov 2020It's actually very simple, just have a look at the code for the silence detection device
Thanks for the reply!
https://developer.reasonstudios.com/doc ... nd_outputs
The tags are the constants you would expect and you import them as object refs in your constructor, but now that I'm looking at it I'm not seeing anything obvious about the application of the delay in the audio buffer output. The method for setting the DSP buffer output doesn't include that argument (???).
I'd have a try at working on the assumption they work the same as CV output ports, because all that needs to be passed out is an integer value, and there is no overloaded method for JBox_SetDSPBufferData(), so I'd have a crack at seeing if
JBox_StoreMOMPropertyAsNumber(fCVOutObjectRef, kJBox_CVOutputValue, cv) works - add your own values of course, this is pasted from the CV out.
This is a complete guess by the way, I've still to start work on audio plugins. If you're still having no joy after trying the above, go to the "real" RE Dev forum and ask John Engstrom how to do it.
Cheers,
Brian
I think you just do it like this:
Code: Select all
JBox_StoreMOMPropertyAsNumber(outputObjectRef, kJBox_AudioOutputDSPLatency, latencyInSamples);
I initially tried doing just that which you both suggested, but I get an error message saying "Could not store property as number: Only properties under rt_owner can be written by DSP". The documentation states that the latency property is owned by the Realtime Controller and not the Realtime.
Also I suppose I don't have access to the actual RE Developer forum because I should first link a company to my account, and I'm not quite there yet to be able to do that.
Also I suppose I don't have access to the actual RE Developer forum because I should first link a company to my account, and I'm not quite there yet to be able to do that.
Ah, that’s right, I think you have to set it in realtime_controller.lua! Sorry, it has been a while since I used the latency stuff...veezay wrote: ↑27 Nov 2020I initially tried doing just that which you both suggested, but I get an error message saying "Could not store property as number: Only properties under rt_owner can be written by DSP". The documentation states that the latency property is owned by the Realtime Controller and not the Realtime.
If you only need to set the latency once (i e if it’s fixed), then you can do it in a lua function that binds to the creation of the RE instance..
If you need to set it dynamically, bind the function to the property or properties that might affect the latency, for example a look ahead setting.
Note that none of the properties that affect latency can be automated, since changing latency on the fly causes audio artifacts. (There is a way to work around this limitation, but it’s not recommended...)
That indeed worked, thanks! It was a case of the classic "so close yet so far away".buddard wrote: ↑27 Nov 2020Ah, that’s right, I think you have to set it in realtime_controller.lua! Sorry, it has been a while since I used the latency stuff...
If you only need to set the latency once (i e if it’s fixed), then you can do it in a lua function that binds to the creation of the RE instance..
If you need to set it dynamically, bind the function to the property or properties that might affect the latency, for example a look ahead setting.
Note that none of the properties that affect latency can be automated, since changing latency on the fly causes audio artifacts. (There is a way to work around this limitation, but it’s not recommended...)
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest