|
|
|
03-22-2015, 02:14 PM
|
#1
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
REQ: Nudge left item edge of sel items to the left / keep their snap offsets in place
Hello!
This one must be tricky! I know it!
Is it possible with the current APIs? Could someone make it?
Thanks!
EDIT:
Script by Claudiohbsantos
Script by X-Raym
Thank you guys!!
Last edited by amagalma; 03-23-2015 at 06:05 AM.
|
|
|
03-22-2015, 02:34 PM
|
#2
|
Human being with feelings
Join Date: Jun 2009
Location: South, UK
Posts: 14,218
|
Unless no one offers a solution.
I think you could do it as an action by first moving the edit cursor to the item edge and then upon adjusting the edge (with the action) you could send the action "set snap offset to cursor" which should kind of do what you need.
It would move the edit cursor though which might be able to combat with the store/recall edit cursor position actions although I think this would then break the action if you use it more than one time.
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
|
|
|
03-22-2015, 02:57 PM
|
#3
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
That is how I do it up to now.. but it works only on one item at a time...
P.S. And it works only when the snap offset is at the start of the item and not somewhere else
Last edited by amagalma; 03-22-2015 at 03:06 PM.
|
|
|
03-22-2015, 03:00 PM
|
#4
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
How long would be the nudging ?
|
|
|
03-22-2015, 03:02 PM
|
#5
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
1ms would be ok
|
|
|
03-22-2015, 03:27 PM
|
#6
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
it could be better with a GUI slider :P
|
|
|
03-22-2015, 04:01 PM
|
#7
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Nah... just a simple script that can be assigned to a key
|
|
|
03-22-2015, 04:17 PM
|
#8
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
Ok so maybe than having a 1ms that would be very low and wil create a tons of undo point,
maybe something "get edit cursor pos, get track under mouse, analyse offset between the edit cursor and the first selected item after the edit cursor, calc the offset, define the offset for all selected items" ?
Last edited by X-Raym; 03-22-2015 at 04:23 PM.
|
|
|
03-22-2015, 04:29 PM
|
#9
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
Wait.
You want
- the left edges to move (aka, position)
- to length to be expand accordingly (preserving right edges position)
- the source to move with left edges
Is that it ?
Erf I don't know if I will have time to help you, I have work to do --'
|
|
|
03-22-2015, 06:36 PM
|
#10
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
What I want is what happens when you run the action to grow the left side of an item but with the snap offset staying at the same place, not moving to the left!
|
|
|
03-22-2015, 06:55 PM
|
#11
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
I found the solution!!! .. but someone has to code the script!...
Ok.. see what happens.. if you run action 41250 "Nudge items left by last nudge dialog settings" the snap offset does not move if it is not exactly 0!
So the script should do the following, in the following order:
1) check if snap offset is >0
YES: run action 41250
NO:
2) a) Set snap offset to 0:00.000001 (this in reality does not move the snap offset but makes it larger than 0)
b) then run action 41250
|
|
|
03-22-2015, 07:08 PM
|
#12
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
It should be something like that:
Code:
GetMediaItemInfo_Value(MediaItem*, "D_SNAPOFFSET");
D_SNAPOFFSET > 0 ? (
Main_OnCommand(41250, 0);
) : (
SetMediaItemInfo_Value(MediaItem*, "D_SNAPOFFSET", 0.000001 );
Main_OnCommand(41250, 0);
);
Could you please correct it? And make it work on multiple items.
For that I know that something like CountSelectedItems is required and then something like for i=up to the number of the items.. so that the script loops as many times as there are items.. right?
|
|
|
03-22-2015, 07:09 PM
|
#13
|
Human being with feelings
Join Date: Aug 2014
Location: New York
Posts: 135
|
I just gave it a try. Is this what you are looking for?
https://stash.reaper.fm/23703/Grow%20...p%20offset.eel
It should grow the left edge of the selected items without moving the snap offsets. Let me know if there are any weird bugs or anything, didn't extensively test it yet.
EDIT: I hand't seen your last 2 posts, was already uploading and typing my post. Let me know if the one I uploaded doesn't work and I'll try to take a look at the code you posted and the actions you mentioned.
|
|
|
03-22-2015, 07:16 PM
|
#14
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Oh Man!! You did it!!! It works like a charm!! Thank you so much!!!
After looking at your script (wow, you did a lot of work!), I feel so embarassed about my nonsense code...
|
|
|
03-22-2015, 07:19 PM
|
#15
|
Human being with feelings
Join Date: Aug 2014
Location: New York
Posts: 135
|
Quote:
Originally Posted by amagalma
Oh Man!! You did it!!! It works like a charm!! Thank you so much!!!
After looking at your script (wow, you did a lot of work!), I feel so embarassed about my nonsense code...
|
Glad it worked =]
Hahahah Nah, those two functions I keep around to reuse every now and then, they always come in handy. The code was actually only 3 or 4 lines in the middle of my messy loop. And actually now that I looked at it again they are overkill, no need to store and restore selected tracks or edit cursor.
EDIT: Ok, updated the script to remove the unnecessary functions. Should be updated in the original link, or here:
https://stash.reaper.fm/23703/Grow%20...p%20offset.eel
Last edited by Claudiohbsantos; 03-22-2015 at 07:25 PM.
|
|
|
03-22-2015, 07:28 PM
|
#16
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Nice website and portfolio you have there! Well done!
Thanks for the optimized version!
|
|
|
03-23-2015, 05:46 AM
|
#17
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@Claudio
Your optimized version may be more optimized, you don't need to save the item selection and restore it, you could simply loop between selected items
---
I wanted to push it a step further, in order to have
- Variable Length
- Less undo points
- Snap
- Trim in several direction
So here is my proposition on this subject, for pre-release v5.
- place edit cursor
- select items
- mouse hover one item
- execute the script via shortcut => it expands the left edges (preserving all we want), and do the same modifications for all objects (with same offset as mouse hover item)
Various security are in place so that you don't loose the snap offset position.
Demo:
Download Link:
Look at my signature!
Folder will be Item Editing.
Actual script name:
- X-Raym_Expand left edge of item under mouse to edit cursor keeping snap offset position and apply to other selected items.eel
Hope you will like it!
|
|
|
03-23-2015, 06:02 AM
|
#18
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Nice X-Raym!! Merci beaucoup!!
Nice website too! ) .. I could not find the script though, maybe you have not uploaded yet?
I 'll link to both scripts in my first post
|
|
|
03-23-2015, 06:26 AM
|
#19
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@amagalma
Derien ça me fait plaisir!
Thanks for the website :P
(the script is inside my REAPER scripts collection zip in the subfolder Item Editing. Just click on download button, extract the zip, and fin the file, named as mentioned in previous post :P
I don't share individual links as I wouldn't be able to update each individual posts if I change the link for a reason or another, so I just share this page. easier for everyone).
|
|
|
03-23-2015, 11:34 AM
|
#20
|
Human being with feelings
Join Date: Aug 2014
Location: New York
Posts: 135
|
@X-Raym
Cool one! Well done. And yeah, I realized that basic thing as I was about to fall asleep, but then it was too late to power everything on and fix it.
@ amagalma
Thanks
Edit: Just updated the file with the optimization X-Raym mentioned, the same link should still be valid and take to the new version. Much cleaner now!
Last edited by Claudiohbsantos; 03-23-2015 at 11:41 AM.
|
|
|
03-23-2015, 01:00 PM
|
#21
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@Claudiohbsantos
Thanks
@all
I want to push the concept even further.
Here what is look like so far:
Ideally, it would be able to detect the ripple editing state. None would be just like the actual version of the script.
I'm on it :P
|
|
|
03-23-2015, 05:10 PM
|
#22
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
|
|
|
03-23-2015, 06:28 PM
|
#23
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Wow! This seems complicated!
|
|
|
03-23-2015, 07:35 PM
|
#24
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
Complex to code to use :P
There is just two actions, that act just the way you wanted (preserving position and snap) for left and right.
But, they can consider riple editing state.
The offset is measure from the distance between edge from item under mouse and edit cursor.
|
|
|
04-10-2015, 05:31 PM
|
#25
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
Expand selected items length to start and end of their source
I have an another script for you, guys
It look like Set items length to source media lengths or Xenakios: Reset item length and media offset, but it keeps item position and snap offsets.
Demo:
The demo show comparaison with the two other scripts.
File Name:
- X-Raym_Expand selected items length to start and end of their source.eel
Download:
See my signature for my script collection.
Cheers !
|
|
|
04-11-2015, 01:00 AM
|
#26
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Oh! Nice! :-) Thank you very much X-Raym! :-)
|
|
|
06-04-2015, 02:00 PM
|
#27
|
Human being with feelings
Join Date: Sep 2014
Posts: 28
|
Thanks! It's Great!Very useful for me.
Sorry,but I can't find simply action for item:
"Trim left(right) edge of Item to grid" (such as "Trim left edge of Item to edit cursor" /41305/,but for align to grid).It exist?It would be very useful(IMHO)for aligning MIDI items.Thanks!
|
|
|
06-04-2015, 02:57 PM
|
#28
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@Mezzo
Yes there is several way to do that !
- activate snap, place edit cursor on the grid and use my scripts X-Raym_Trim left edge of item under mouse to edit cursor without changing fade-in end.eel or X-Raym_Trim right edge of item under mouse to edit cursor without changing fade-out start.eel from the post : Scripts (EEL): Move L/R edge of item under mouse to edit cursor (with ripple edit)
- activate snap and click and drag the item to grid
- use the Nudge/set items... action
It may also be a couple of other ways :P
|
|
|
06-05-2015, 02:12 AM
|
#29
|
Human being with feelings
Join Date: Sep 2014
Posts: 28
|
@X-Raym
Thanks! "Nudge/set items..." and his "Save dialog settings" is a good way (for me) :-)
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:58 PM.
|