Item_length = reaper.GetMediaItemInfo_Value(item, "D_LENGTH") - get item lengthĮdge_boundary = item_pos + item_length/2 - calc edge boundary (for nearest edge) Item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") - get item position If item_count =1 then - check one item sel. Local ecp = reaper.GetCursorPositionEx(0) - get edit cursor position, ecp Local item_count = reaper.CountSelectedMediaItems(0) - get item_count Local item = reaper.GetSelectedMediaItem(0,0) - get item Reaper.ApplyNudge(0, 2, edge, 18, val, false, 0) - move edit cursor right be 1 frame Val =1 - some mice give values other than 1 If val 0 then - move chosen edge right by 1 frame Reaper.SetEditCurPos2(0, time_pos, true, false) Local time_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") + reaper.GetMediaItemInfo_Value(item, "D_LENGTH") Local item = reaper.GetSelectedMediaItem(0,0) Reaper.ApplyNudge(0, 2, 3, 2, val, false, 0) - move edit cursor right be 1 frame Reaper.SetEditCurPos2( 0, time_pos, true, false) It should be easy enough to write mirrored one-shot scripts to check there are selected items, and then loop through, subtracting a set increment from all selected items lengths.Įdit: Try reaper.SetEditCurPos2( ReaProject proj, number time, boolean moveview, boolean seekplay) Usually it's fixed shortcuts in the apps, and they swap these settings on the forum, but with REAPER, the clever stuff is script-side and the limit is only the API and your imagination. It also is great for controlling video apps and even Acr**** -it auto-detects which app you're focused on and uses that app's mapping. If I have a lot of specialised work for a job I will tinker with the actions and bung them on J and K modified shortcuts. If you want the edit cursor to track the edge of the item, get the script to check there is only one item selected (else which edge does it follow?), then as the right-hand edge is trimmed, it's easy enough to work out the timeline position of the edge and write that to the edit cursor.Ĭreate two left/right mirrored versions of the script and assign them to the modified J and K of your choice and you're up and running. This way, doing a modifier like Ctrl-Shift won't move the cursor at all during use, but it won't trigger the action that moves the cursor, just the action that trims your item edge. CONTOUR SHUTTLE DEVICE CONFIGURATION FREESetting the base keys for left and right gives you a complete set of modifiers free to use for a range of actions -vanilla, custom or script. If you want to trim with it, you need to set the jog to "J" and "K" for left/right and then use modifiers of those (eg Ctrl-shift-J and Ctrl-Shift-K) to fire two scripts to move your item edges. It's in addition to your mouse, it's a facsimile of the transport jog and/or shuttle wheels that used to be found on editing VTRs. CONTOUR SHUTTLE DEVICE CONFIGURATION PLUSIt's used to move the cursor in audio and video apps, plus it has a bunch of buttons for transport, split, undo, whatever. It's a Jog/Shuttle controller, jog wheel in the middle and sprung shuttle ring around it. Reaper.Main_OnCommand(40290,0) - 40290 set time selection from selected items Reaper.ApplyNudge(0, 2, 0, 2, val, false, 0) - move edit cursor right be 1 frame The second script simply moves an item and keeps the edit cursor/playhead bolted to the front edge of the item by creating a time selection from it.Ĭode: local is_new_value, filename, sectionID, cmdID, mode, resolution, val = reaper.get_action_context() Reaper.Main_OnCommand(40626,0) - Time Selection: set end point Reaper.ApplyNudge(0, 2, 6, 18, val, false, 0) - move edit cursor right be 1 frame Reaper.Main_OnCommand(40631,0) - go to end of time selection If val 0 then - move time selection end point left by 1 frame Local is_new_value, filename, sectionID, cmdID, mode, resolution, val = reaper.get_action_context()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |