- ReaScript Basics — Interview on REAPER blog / Part-1
- ReaScript Basics — Interview on REAPER blog / Part-2
- How to Learn ReaScript for REAPER
- Useful Tools for REAPER Scripters
- ReaScript: What can we Expect from v5 Pre-Releases?
- Advanced Actions Management: Import and Export Toolbars Buttons linked to Scripts, Change Script Path and Name
- Scripting for REAPER: General Guidelines
- ReaScript Video Tutorial — Part. 1: The Console Output
- ReaScript Video Tutorial — Part. 2: The Api Documentation
- ReaScript Video Tutorial — Part. 3: Get/Set First Selected Item Properties
- ReaScript Video Tutorial — Part. 4: Loop in Selected Items
- ReaScript Video Tutorial — Part. 5: Conditions Basics
- ReaScript Video Tutorial — Part. 6: Time Selection
- ReaScript Video Tutorial — Part. 7: Loop in Items on Selected Tracks
- ReaScript Video Tutorial — Part. 8: Using Native Actions
- ReaScript Video Tutorial — Part. 9: Preventing Bugs
- ReaScripts Templates Repository on GitHub
In this video, we will work on time selection, and make more complex conditions.
Code Snippet:
-- This is an extract of the script start_time, end_time = reaper.GetSet_LoopTimeRange2(0, false, false, 0, 0, false) -- Get start and end time selection value in seconds if start_time ~= end_time then -- if there is a time selection count_items = reaper.CountMediaItems(0) -- count items in the project for i = 0, count_items - 1 item = reaper.GetMediaItem(0, i) item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") item_len = reaper.GetMediaItemInfo_Value(item, "D_LENGTH") item_end = item_pos + item_len -- Calculate the item end position if (item_pos > start_time and item_pos < end_time) or (item_end > start_time and item_end < end_time) or (item_pos < start_time and item_end > end_time) then -- check if item is in time selection reaper.SetMediaItemInfo_Value(item, "D_FADEOUTLEN", item_mouse_fadeout) -- Set new value end -- end if item is in time selection end end
Next videos will show you how to get items based on selected tracks.
Help us translate the subtitles of this video in your language using Amara.org !
- ReaScript Basics — Interview on REAPER blog / Part-1
- ReaScript Basics — Interview on REAPER blog / Part-2
- How to Learn ReaScript for REAPER
- Useful Tools for REAPER Scripters
- ReaScript: What can we Expect from v5 Pre-Releases?
- Advanced Actions Management: Import and Export Toolbars Buttons linked to Scripts, Change Script Path and Name
- Scripting for REAPER: General Guidelines
- ReaScript Video Tutorial — Part. 1: The Console Output
- ReaScript Video Tutorial — Part. 2: The Api Documentation
- ReaScript Video Tutorial — Part. 3: Get/Set First Selected Item Properties
- ReaScript Video Tutorial — Part. 4: Loop in Selected Items
- ReaScript Video Tutorial — Part. 5: Conditions Basics
- ReaScript Video Tutorial — Part. 6: Time Selection
- ReaScript Video Tutorial — Part. 7: Loop in Items on Selected Tracks
- ReaScript Video Tutorial — Part. 8: Using Native Actions
- ReaScript Video Tutorial — Part. 9: Preventing Bugs
- ReaScripts Templates Repository on GitHub