Old 04-18-2018, 09:04 AM   #1
Stroudy
Human being with feelings
 
Stroudy's Avatar
 
Join Date: Jul 2014
Location: London
Posts: 739
Default Easy script to set item length - ReaQuest

I need to quickly set the length of multiple selected items to a fixed value.

Would someone be able to offer up a script that would do this?

Something that sets the item length to e.g. 0.85 seconds

Any help would be soooo apreciated
Thanks
Stroudy is offline   Reply With Quote
Old 04-18-2018, 09:13 AM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
Default

Code:
for i=0, reaper.CountSelectedMediaItems(0) - 1 do
  local item = reaper.GetSelectedMediaItem(0, i)
  reaper.SetMediaItemInfo_Value(item, 'D_LENGTH', 0.85)
end
cfillion is offline   Reply With Quote
Old 04-18-2018, 12:48 PM   #3
D Rocks
Human being with feelings
 
Join Date: Dec 2017
Location: Quebec, Canada
Posts: 550
Default

Quote:
Originally Posted by cfillion View Post
Code:
for i=0, reaper.CountSelectedMediaItems(0) - 1 do
  local item = reaper.GetSelectedMediaItem(0, i)
  reaper.SetMediaItemInfo_Value(item, 'D_LENGTH', 0.85)
end
haha thats an on demand ReaPly to the ReaQuest. nice
__________________
Alex | www.drocksrecords.com | Thanks for REAPER
D Rocks is offline   Reply With Quote
Old 04-18-2018, 03:13 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

You can do it with the media item property window without scripting.
X-Raym is offline   Reply With Quote
Old 04-19-2018, 01:43 AM   #5
Stroudy
Human being with feelings
 
Stroudy's Avatar
 
Join Date: Jul 2014
Location: London
Posts: 739
Default

Quote:
Originally Posted by cfillion View Post
Code:
for i=0, reaper.CountSelectedMediaItems(0) - 1 do
  local item = reaper.GetSelectedMediaItem(0, i)
  reaper.SetMediaItemInfo_Value(item, 'D_LENGTH', 0.85)
end
Cfillion = Absolute Legend!

The script is part of an automated workflow for a show using the audience to create sounds. I have almost zero time to make these edits and my non-Reaper colleague needs to be able to work this too :O

Many thanks all
Stroudy is offline   Reply With Quote
Old 04-19-2018, 03:50 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Strougy
Quote:
Cfillion = Absolute Legend!
If you are that excited for a 4 lines script, you will be out of words to describe what he made with the Reapack extension

(though, it is true that a lot of 4 lines scripts are very very handy and used every day ^^)
X-Raym 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 10:50 PM.


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