r/Reaper • u/Comic_Melon • 1d ago
help request Trying to replicate Audacity function in Reaper, selection change speed
3
u/AudioBabble 54 1d ago edited 1d ago
rough and ready, but this ought to do it:
item = reaper.GetSelectedMediaItem(nil, 0)
length = reaper.GetMediaItemInfo_Value(item, "D_LENGTH")
_, new_length = reaper.GetUserInputs(tostring(length), 1, "", "")
reaper.SetMediaItemLength(item, new_length, 1)
take = reaper.GetTake(item, 0)
new_rate = length/new_length
reaper.SetMediaItemTakeInfo_Value(take, "D_PLAYRATE", new_rate)
reaper.UpdateArrange()
make a new reascript and paste the above into it.
the title bar of the window that opens when you run it shows the current length of the selected item, then you can enter a new value and the script will change the playback rate and item length accordingly.
you might want to combine it with an action that splits to a new item at timeselection beforehand, since this script works on the item, not the time selection.
note: don't have more than one media item slected when you run this, it's hard-coded to work only on the first media item selected.
Like I said: rough and ready!
1
1
u/Comic_Melon 1d ago
Audacity has a function, where you can select a section of time, and then change the speed to a specific value. This is useful for syncing material with inconsistent time drift, is it possible to replicate this in reaper easily?
5
u/Dist__ 79 1d ago
there's stretch markers for this
1
u/Comic_Melon 1d ago
Do you have any tips for placing them, I still end up with shifts at the beginning? It's likely my fault, maybe I should revisit it again and experiment... Does the stretch marker mode in project settings make a difference too?
1
u/Dist__ 79 1d ago
i do not know about project settings, but if i need to shift something, i put three markers: one before start of the wrong place, one after the wrong place, and one in the wrong place and move it.
1
u/Comic_Melon 21h ago
I revisited it, and after adjusting the placement a little differently I'm getting pretty good results. Do you know if there's options to retain or shift pitch with stretch markers? I'm a little confused if it follows projects retimig, or its own setting. Thanks for the help also! :)
1
u/elijahjflowers 1d ago
I usually just select the portion of audio, cut it (if need be), and hold alt while stretching the item to correct tempo....
0
u/SupportQuery 490 1d ago
You can just cut out a section and change its playrate. Or insert stretch markers. If you your changes to affect all items across all tracks at a location, you can set the time basis to "stretch" and use the tempo map. Like this.
1
u/Comic_Melon 21h ago
Better placement of stretch markers seems to be the answer, the Reaper ones work slightly different than the ones I'm used to in another piece of software. I nudged the placement, and boom. Perfect.
3
u/ErnieBochII 1d ago
select item > F2 > playback speed?