Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 03-13-2018, 12:20 PM   #1
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,746
Default API: GetAudioAccessorStart/EndTime() - broken for takes (SOLVED)

See
https://forum.cockos.com/showthread.php?t=129415

Seems still to be the case with current Reaper (tried with 5.77).

Last edited by nofish; 03-13-2018 at 12:59 PM.
nofish is online now   Reply With Quote
Old 03-13-2018, 12:28 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,118
Default

Well, it could be argued that within the item, the take always starts at time 0.0...

If you need the track start time of the audio, just obtain it from the parent item of the take. You will likely have the item pointer around anyway if you also have the take pointer. (Also at least in the C API, the parent item pointer can also be gotten with GetSetMediaItemTakeInfo and P_ITEM as the property name.)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 03-13-2018, 12:58 PM   #3
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,646
Default

This is the intended behavior. Take audio accessor playback times are all relative to the enclosing media item.
schwa is offline   Reply With Quote
Old 03-13-2018, 12:58 PM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,746
Default

Thanks.
Hm..not what I'd have intuitively expected (and the linked thread shows not only me), but I think I can follow your argument.

But
Quote:
Well, it could be argued that within the item, the take always starts at time 0.0...
what about when the take has a start offset set, shouldn't these functions at least account for this ? Seems they don't.

edit:
Thanks schwa.
nofish is online now   Reply With Quote
Old 03-13-2018, 01:01 PM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,646
Default

The accessor plays the audio in context: within the bounds of the enclosing media item, including take envelopes, warp markers, etc.
schwa is offline   Reply With Quote
Old 03-13-2018, 01:03 PM   #6
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,118
Default

Quote:
Originally Posted by nofish View Post
when the take has a start offset set
The offset is relative to the source media and a property of the take.

So for example if the take has a media start offset at 1.0 seconds, playing/processing the take audio accessor from 0.0 seconds plays back the media starting from 1.0 seconds.

Is there some problem you are trying to solve? Trying to play/process more audio than what is exposed by the take from the source media? I think you will be out of luck with the AudioAccessors for that use case. (To freely access audio directly from audio files, you can use the PCM_source objects.)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/

Last edited by Xenakios; 03-13-2018 at 01:08 PM.
Xenakios is online now   Reply With Quote
Old 03-13-2018, 01:04 PM   #7
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,746
Default

Ok, got it, thanks.

edit:
I'll add
Quote:
Take audio accessor playback times are all relative to the enclosing media item.
may help in the API doc to avoid confusion.

Last edited by nofish; 03-13-2018 at 01:15 PM.
nofish is online now   Reply With Quote
Old 03-13-2018, 01:26 PM   #8
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,746
Default

Quote:
Originally Posted by Xenakios View Post
Is there some problem you are trying to solve?
I stumbled across this when investigating a bug in SWS Loudness:
https://github.com/reaper-oss/sws/is...ment-371233030

Now I'm pretty sure the cause is exactly this, that these functions return the relative item time for take accessor, which has to be accounted for when item is not on pos 0.0 (where it works as expected).
nofish is online now   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 03:54 PM.


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