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

Reply
 
Thread Tools Display Modes
Old 12-22-2022, 06:07 PM   #1
awelex
Human being with feelings
 
Join Date: Dec 2022
Posts: 34
Default Source start time bug when item has stretch markers

Hi,

I've been doing a lot of work recently with stretch markers and have come across a weird issue. I'm having trouble figuring out how to consistently reproduce it but it's now happened often enough that I think it's a bug.

Occasionally, Reaper will get confused about the source start time in items with stretch markers. This mainly seems to happen on items with a lot of stretch marker editing. Here is what happens:

I have two items here with the same source. The top one is the original without any stretch markers. It starts right at the beginning of the source media, as confirmed by the take properties:



The bottom item contains a few stretch markers in the middle of the item. I've lined both items up so that up until the first stretch marker they're in perfect sync. According to Reaper, this second item also starts right at the beginning of the source (see take properties); however, you can clearly see that's not the case and the second item has extra silence at the beginning.



What's weird is that even though the take properties window is reporting a source start time of 0:00.000, Reaper ALSO shows where the correct source start is (the two small triangles right before the start of the waveform). Here's a closer look:



If I trim the beginning of the second item so it actually starts at the beginning of the source, the source start time is (wrongly) reported as 0:01.909!



Once an item has this issue the only way to reset everything back to normal is to delete all stretch markers (either individually or in bulk).

I have a few workflows and scripts that rely on accurate reporting of the source start time. All of them break once this issue occurs.

If it helps, I can also send a project file with the two items.


macOS 10.14.16
Reaper v6.70
awelex is offline   Reply With Quote
Old 12-23-2022, 05:47 AM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,140
Default

Since you mention scripts, they need special handling when adjusting source start if a take contains stretch markers.
https://forum.cockos.com/showthread.php?t=180571
Could this have something to do with it?
nofish is offline   Reply With Quote
Old 12-23-2022, 06:01 AM   #3
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,910
Default

Could you possibly post a small project with a media item that shows this problem? Just the RPP, no media.
schwa is offline   Reply With Quote
Old 12-23-2022, 01:41 PM   #4
awelex
Human being with feelings
 
Join Date: Dec 2022
Posts: 34
Default

Quote:
Originally Posted by schwa View Post
Could you possibly post a small project with a media item that shows this problem? Just the RPP, no media.
Of course. Attached.

Quote:
Originally Posted by nofish
Since you mention scripts, they need special handling when adjusting source start if a take contains stretch markers.
https://forum.cockos.com/showthread.php?t=180571
Could this have something to do with it?
I saw that thread, but I don't think it's the same issue. If I understand correctly, the issue there is that the API reports a different value than REAPER itself does. Here, both the API and REAPER are in sync, they're just both wrong. But I guess it could still be related?
Attached Files
File Type: rpp STRETCHMARKER BUG.RPP (4.1 KB, 135 views)
awelex is offline   Reply With Quote
Old 12-24-2022, 05:31 AM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,910
Default

Thanks for posting the RPP. I think this situation only arises when a stretch marker at the start of the media item gets deleted. It might be possible for us to correct the display in the media item properties dialog, although it's possibly complicated to then support setting the value from that dialog in this situation.

For your specific use case though, is the issue more about a reascript getting the correct value? If so, the function GetSourcePositionFromProjectPosition() with project position equal to the media item start position should return the value you need.
schwa is offline   Reply With Quote
Old 12-24-2022, 12:11 PM   #6
awelex
Human being with feelings
 
Join Date: Dec 2022
Posts: 34
Default

Quote:
Originally Posted by schwa View Post
Thanks for posting the RPP. I think this situation only arises when a stretch marker at the start of the media item gets deleted. It might be possible for us to correct the display in the media item properties dialog, although it's possibly complicated to then support setting the value from that dialog in this situation.

For your specific use case though, is the issue more about a reascript getting the correct value? If so, the function GetSourcePositionFromProjectPosition() with project position equal to the media item start position should return the value you need.
Got it, thanks. The script is actually supposed to trim the item out to the beginning of the source media. But I think what I can do instead is to check the source position of the first stretch marker and trim out by that amount. I'm curious, is that how REAPER does it?

Unrelated, I can't find GetSourcePositionFromProjectPosition() anywhere?
awelex is offline   Reply With Quote
Old 12-24-2022, 12:18 PM   #7
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,910
Default

Ah whoops, it's not exported (there are a number of API functions that are only used by REAPER's own plugins).

Anyway, yes, in normal usage there should always be a stretch marker at item position zero, source position zero. If some edits cause that stretch marker to not exist, then the start offset needs to be adjusted by the source position of the first stretch marker, as you say.
schwa is offline   Reply With Quote
Old 12-25-2022, 02:34 PM   #8
skylar_battles
Human being with feelings
 
Join Date: Mar 2022
Posts: 1,522
Default

I am experienced something strange yesterday that may seem along the lines of this issue so I thought I'd share.

When trying to loop the source of an item with stretch markers after the "original" loop, the subsequent loops wouldn't take into a account the stretch markers and were the incorrect length. So if the original item was 4 bars the looped of the item would be slightly less than 4 bars.

Even gluing the original item didn't seem to help, so I just duplicated it.
skylar_battles 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 11:38 PM.


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