Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 03-23-2015, 05:09 PM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default Scripts (EEL): Move L/R edge of item under mouse to edit cursor (with ripple edit)

Hi!

Here is the best answer I could think of for satisfying the request:
ripple editing with item edge

It will allow:

  • different behavior according to ripple state
  • ripple editing with edges
  • snap
  • snap offset preservation
  • ripple edit across tracks or an individual track


There is several type of actions:

Fixed Content
  • X-Raym_Move left edge of item under mouse to edit cursor according to ripple state.eel
  • X-Raym_Move right edge of item under mouse to edit cursor according to ripple state.eel
  • X-Raym_Trim left edge of item under mouse to edit cursor without changing fade-in end.eel
  • X-Raym_Trim right edge of item under mouse to edit cursor without changing fade-out start.eel
Demo:

Move edges of item under mouse to edit cursor according to ripple state:


Trim edges of item under mouse to edit cursor without changing fades:


The concept is simple:
Offset is calculated with the item pos / item end of the item under mouse and the edit cursor. The snap offset pos is kept, or set to 0 if item length became to short.


It is based on a idea I had for REQ: Nudge left item edge of sel items to the left / keep their snap offsets in place


Moving Content
  • X-Raym_Move left edge and content of item under mouse to edit cursor according to ripple state.eel
  • X-Raym_Move right edge and content of item under mouse to edit cursor according to ripple state.eel

Demo:



Moving Position
  • X-Raym_Move item position of item under mouse to edit cursor according to ripple state.eel
  • X-Raym_Move item position of item under mouse to edit cursor according to ripple state preserving end.eel

Demo:




Disclaimer:
Required REAPER v5 pre release


Download:
Click on the link on my signature!


-------
It was pretty hard to code so...

Thank you for your support!




Last edited by X-Raym; 05-27-2015 at 12:46 AM. Reason: EEL, not Lua!
X-Raym is offline   Reply With Quote
Old 03-24-2015, 04:21 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default 1.1 and Content

Two new scripts for fix contents!

Fix Content
  • X-Raym_Move left edge of item under mouse to edit cursor according to ripple state.eel
  • X-Raym_Move right edge of item under mouse to edit cursor according to ripple state.eel
(demo above)

---

Thanks to Breeder, now all these scripts can have a better way to get the ripple edit state. The first two have been to 1.1 version (the new one have been coded the good way right from the beginning).

---
Tell me if you like it
X-Raym is offline   Reply With Quote
Old 03-24-2015, 04:42 AM   #3
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,585
Default

You're a veritable script-engine -you and heda!

How long before we need to form a rehabilitation support group?



>
planetnine is offline   Reply With Quote
Old 03-24-2015, 04:51 AM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@planetine
Quote:
How long before we need to form a rehabilitation support group?
No time! I have scripts to do!!

X-Raym is offline   Reply With Quote
Old 03-24-2015, 04:54 AM   #5
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,316
Default

Quote:
Originally Posted by planetnine View Post
You're a veritable script-engine -you and heda!

How long before we need to form a rehabilitation support group?

>
LOL
I am scripting less now... trying to become healthy again. Not sure for how long...
But I am worried for X-Raym
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 03-24-2015, 05:12 AM   #6
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,585
Default My name's Nathan and I'm a scriptaholic...

It is very creative, but a bit addictive. I don't turn out so many, but mine are a bit, erm, heavy...



>
planetnine is offline   Reply With Quote
Old 03-24-2015, 05:50 AM   #7
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: brighton, uk
Posts: 12,729
Default

awesome stuff guys!

Love the mouse cursor ones as that's my favourite way when we can't have these as mouse modifiers yet
__________________
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.
musicbynumbers is offline   Reply With Quote
Old 03-24-2015, 05:58 AM   #8
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: brighton, uk
Posts: 12,729
Default

Just sent you a small donation X-Raym.

When I get time I'll probably put up a challenge/commision for a few scripts that would be really useful to me (and hopefully others too!)

One of them for the sound designer crowd would be a script adaptation of this crossfade looper action I made that was cleaner and easier for new people to use

http://forum.cockos.com/showpost.php...&postcount=741
__________________
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.
musicbynumbers is offline   Reply With Quote
Old 03-24-2015, 06:03 AM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@planetnine
Quote:
but a bit addictive
is it ?

@heda
Quote:
But I am worried for X-Raym
Please, don't.
It is very fulfilling.
-- Anyway, I may take a break soon, but I can't promise anything B)

@musicbynumbers
Thank you !!
I already integrated it in my editing workflow, and it feels pretty good like it.
I'm glad you agree with that!
X-Raym is offline   Reply With Quote
Old 03-24-2015, 07:10 AM   #10
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 2,113
Default

Quote:
Originally Posted by X-Raym View Post
It is very fulfilling.
Until it's not, haha...if you have addictive personality, be careful still
I'm talking from experience when I say this, lol

Quote:
Originally Posted by X-Raym View Post
Thanks to Breeder, now all these scripts can have a better way to get the ripple edit state. The first two have been to 1.1 version (the new one have been coded the good way right from the beginning).
It's actually thanks to Jeffos (he did pretty much everything on SWS side to make exporting API to REAPER possible, and these config functions are also exported by him) - I just pointed it out, lol
__________________
My contributions
Breeder is offline   Reply With Quote
Old 03-24-2015, 10:14 AM   #11
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@Breeder
I'm good :P
"No more than 24 hour scripting per day" is my new 2015 promise :P

So thanks to Jeffos and thanks to you as well, because there can be great things, but if we don't know how to use it, we can't see their potential !
That's why community support is great, and a more detailed doc would be welcome :P
X-Raym is offline   Reply With Quote
Old 03-25-2015, 02:13 PM   #12
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

Hi!

I just updated all the above script so they have a nicer behavior, especially with ripple, which is now different, according to the edge that is moving.

They also have been a bit more optimized, and there was some unexpected behavior that have been corrected.

As a bonus, there is two new scripts:
  • X-Raym_Move item position of item under mouse to edit cursor according to ripple state.eel
  • X-Raym_Move item position of item under mouse to edit cursor according to ripple state preserving end.eel
These aim to provide to some backward ripple editing


Hope you'll appreciate!
X-Raym is offline   Reply With Quote
Old 05-04-2015, 10:34 AM   #13
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default News

Hi !

A bit of new on this:
I just managed to make Move right edge and content of item under mouse to edit cursor according to ripple state take into account locked items on all tracks, and behave according to the ripple lock preferences parameter (ignore locked items, locked ritems also ripple, locked items block ripple on each tracks, locked items block ripple globally).
This way, we have full powered ripple from edges !

I plan do to this for the other ripple scripts but as it involved Lua conversion (because there is several tables and Lua exclusive functions), it can take a bit of time.

Stay tuned
X-Raym is offline   Reply With Quote
Old 05-06-2015, 10:37 AM   #14
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

Also in progress:
  • Make them work on empty items
  • Propagate the transformation on all selcted items
  • Select item under mouse
  • better snap offset maagement
It's coming soon !

Last edited by X-Raym; 05-06-2015 at 10:54 AM.
X-Raym is offline   Reply With Quote
Old 05-27-2015, 12:48 AM   #15
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

Before the big updates, I mentioned in previous post, you can have a bit of fun with two new scripts !

Demo: See first post or click here.

You may know that sound design layering technical is what I'm currently working on, and I can tell you that these two scripts really make me save a lot of time, and precision

Of course, they have ripple from edge capabilities too :P
X-Raym is offline   Reply With Quote
Old 03-03-2016, 05:14 AM   #16
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 670
Default Possible to do this with "Slip edit" and Drag?

Hi X-Raym

I've just found your scripts and they look very interesting and useful. I haven't had a chance to try them out in practice yet, but will do so very soon.

I do a lot of work in Radio / Speech Audio production and this option of having everything Ripple both Left and Right of the clip being edited, and when the clip edges are moved, is vital for quick speech editing. I know a group of people who would be very interested in trying out Reaper for radio work with these kind of functions, having used SADiE up to now (as I mainly have). SADiE is the best DAW out there for speech editing by a very long way, thanks to its unique editing tools, but has stability and VST support problems which make many users wish for something else that might give us a similarly efficient workflow but with more stability.

Is there any way your scripts can be adapted (with your Ripple Left and Right feature) to give us the capability of moving either the item edge or the contents but by Dragging instead of clicking at a set point?

For example, to move the Fade Out of an item, click over the fade and drag it left or right, and then have everything to the right Ripple accordingly? Alternatively, for the Fade In, having everything to the left Ripple? As a workflow, it seems much more familiar and effective to be able to drag the Fade, and if extending the item to see the waveform revealed as it is moved. I realise this is probably more difficult to achieve, though.

Also, what would make your scripts perfect would be the option to drag the item contents (like Reaper's Slip edit, but leaving the other fade intact). So for example, I could click on the waveform of an item near the Fade Out, and drag it to the right to remove that audio "under the fade", whilst everything to the left Ripples accordingly. Or click on the waveform and drag it to the left, bringing new material from "under the fade" into the item, but keeping the Fade In of the item at the same position relative to the contents and Rippling everything Left again.

Similarly, there would be another function to do the same drag/moves on the contents near the Fade In of an item, and preserve everything to the Right by Rippling.

Finally, it would need to ensure that if there is a crossfade on the edit point being adjusted, when all the Rippling happened, the crossfade was still in the right place. Unfortunately, if there are crossfades in a series of items on the timeline in Reaper, and you delete one of them with Ripple enabled, the items to the right will close the gap, but the crossfade doesn't overlap properly - the end of the Fade Out on the left item is aligned with the start of the Fade In on the right item, so there is a tiny "fade to black" and up again, creating glitches. What should happen is that the start of both fades are aligned and therefore the crossfade is maintained.

I realise this is a complicated description, but I hope it makes sense. If it would help, I could try and capture some video of the SADiE Playlist Edit tool it would try to duplicate, so you can see what I mean.

Many thanks
Andy

Last edited by andyp24; 03-03-2016 at 05:18 AM. Reason: More information
andyp24 is offline   Reply With Quote
Old 03-03-2016, 07:38 AM   #17
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@andyp24
Thanks !

Don't hesitate to download them and actually try them so you can see how they work

You re feature request will be indeed more easily understanble with Screenshots :P
But mouse modifiers (for click and drag) cannot be written with ReaScript.

Because just like you I needed backward ripple editing, I made these scripts, but they cannot work with click and drag.
We written feature request to have this as mouse mofier but it doesn't get answered.

Feel free to create a new feature request thread for these

Cheers !
X-Raym is offline   Reply With Quote
Old 03-03-2016, 10:47 AM   #18
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 670
Default

Thanks for your quick answer.

I don't know whether it might still be possible to create what I need, even with the restrictions on mouse modifiers.

When I can, I'll try and post some screenshots of what I'd like it to be able to do, and maybe some thoughts on how to achieve it (even though I have no idea how to code that!)

Many thanks
Andy
andyp24 is offline   Reply With Quote
Old 03-03-2016, 10:55 AM   #19
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

Screenshots will definitely help. It is kind of confusing without some ^^
Post structure also helps a lot: use Lists to explain sequential steps, and title to separate differents requests,. Also, having separated context description, feature request, and idea how to solve it (optional) can help.

But remember I can't do mouse modifier.
X-Raym is offline   Reply With Quote
Old 03-08-2016, 08:58 AM   #20
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 670
Default Screenshots

Hi X-Raym

Here's a screen capture of what I hope to achieve. The result is similar to some of your scripts above, but with the click and drag method.

https://youtu.be/KCMOk_ZfcIY

Hope this helps to explain.

I have had some thoughts about how to achieve the desired effect. I am assuming throughout that all pairs of items on the timeline are crossfaded (probably with a short crossfade, but one that needs to be preserved)

User selects two items (like the red ones in the video) then runs

SCRIPT 1 - PREPARE FOR EDIT
1. (Optional, but useful function) View zooms in on the items so they're big on the screen making fine adjustments easier.
2. Places a stretch marker at the very beginning (start of fade in) of left hand item, and a stretch marker on the very end (end of fade out) of the right hand item. This is a "place marker" for where the fade should be in relation to the audio contents.
END OF SCRIPT 1

User then performs a "slip edit" in Reaper (Alt - drag audio contents) to get the desired crossfade position right, whilst seeing the waveform move (as in the SADiE video above, although with different behaviour at the "outside" edge of the item). At any point in this dragging, the user can play across the edit point in the normal manner to check it. Notice that the stretch markers also move with the audio contents. When the crossfade is correct, the user runs

SCRIPT 2: EXIT EDIT AND RIPPLE
1. Move the start of the fade in on the left hand item to its Stretch Marker (so it is now in the same place as originally in relation to the audio). Move the end of the fade out on the right hand item to its Stretch Marker.
2. Ripple all items left and right of the two selected ones so that the gaps or overlaps created by the Slip Edit process are returned to their state at the beginning.
3. Delete the Stretch Markers
4. Return to original Zoom view
END OF SCRIPT 2

I hope this might be possible. It would certainly be incredibly useful for those of us working in radio-type work. The key idea was to come up with a way of "marking" the fade positions in relation to the audio, which is all the stretch markers do. There may be an easier way of doing this, if it's possible to get a script to store and refer to Start Offset numbers etc.

Note that Reaper's native Ripple function does not work properly for crossfaded clips when deleting an item. Say there are three items in line with a 40ms crossfade between 1 and 2, and between 2 and 3. If you delete item 2 with Ripple On, then instead of item 1 and 3 being crossfaded by 40ms, what happens is that there is a 40ms fade out of item 1, then a 40ms fade in of item 3, so you get a "bump" in the audio. It's essential when doing any Rippling in edits such as the one I am describing, that crossfaded clips which are temporarily separated in the process of an edit another part of the timeline, are re-assembled at the end of the edit with the original crossfade intact.

Does this give you enough information? If not, please do feel free to ask any questions, and I can explain further or post more screenshots.

If this one works, then I certainly have a few other ideas on my wishlist, but some of them might be rather more complicated!

Best wishes
Andy

Last edited by andyp24; 03-08-2016 at 09:28 AM. Reason: Forgot something :-)
andyp24 is offline   Reply With Quote
Old 03-08-2016, 09:18 AM   #21
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@andyp24
Upload it on a 2rd party website like http://imgur.com/ and post the link here.
X-Raym is offline   Reply With Quote
Old 03-08-2016, 09:37 AM   #22
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 670
Default

Hi

Sorry, yes, I posted the question before Googling.... I then edited the post above asking the silly question, so it now contains the info you need and a link to the YouTube video.

Andy
andyp24 is offline   Reply With Quote
Old 03-09-2016, 01:39 AM   #23
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 670
Default

Reading that last post again, I'm not sure if I was very clear. The screengrab video link and description of my request are now in the post three messages earlier in this thread.

Andy
andyp24 is offline   Reply With Quote
Old 03-09-2016, 07:54 AM   #24
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@andyp24
Hi,

You should bump this thread instead,
ripple editing with item edge - Cockos Confederated Forums
Add a bitmore explanation and your video.
A native solution will be far more useful than a script workarround as we cant make mouse mofidier with scripts.

What is needed is a real ripple from edges mouse modifier.Also, you can open a second feature request thread, with Preserving auto crossfade when deleting items when ripple editing is on.
I totally understand how this can be useful, and it sounds like the default behavior it should have.

Meanwhile, you can get some Ripple from left edges of items under mouse kind of behavior with the script exposed in this thread.
That's not as user friendly as a real mouse modifier, this is why a feature request thread bump is needed :P
X-Raym is offline   Reply With Quote
Old 03-09-2016, 08:04 AM   #25
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

hmm actually, the Delete items preserving auto fades if ripple editing could be scripted I guess...
But it worth writing an official feature request anyway
X-Raym is offline   Reply With Quote
Old 03-09-2016, 08:10 AM   #26
andyp24
Human being with feelings
 
Join Date: Mar 2016
Posts: 670
Default

Hi X-Raym

I'll certainly make Feature Requests from the Devs, but I have no idea whether they'd be implemented or how long it would take, which is why in the meantime I wondered whether a script workaround might enable those of us who are keen to jump ship from SADiE to Reaper to have some of the tools we need immediately.

As a shorter term measure,does my suggestion above (of having one script/macro to prepare for an edit, and then a second to sort out the ripples and return to the original timeline view after the edit is made) sound feasible in principle?

Thanks
Andy
andyp24 is offline   Reply With Quote
Old 01-25-2017, 09:46 AM   #27
Infrabass
Human being with feelings
 
Join Date: Apr 2014
Posts: 102
Default

Hi there!

Amazing script X-Raym as always…

There is one thing, I just notice, when using the trim w/o changing the fade length, the take envelopes are not preserve, they move by the trim amount.
Is this an easy thing to fix?

Thank a lot!
:-)
Infrabass is offline   Reply With Quote
Old 01-25-2017, 10:25 AM   #28
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@Infrabass
Thanks !

Can you please post an animated screenshot ?

Also, please bump this Feature Request :
ripple editing with item edge - Cockos Confederated Forums

We need support :P
X-Raym is offline   Reply With Quote
Old 01-25-2017, 10:52 AM   #29
Infrabass
Human being with feelings
 
Join Date: Apr 2014
Posts: 102
Default

Here it is!
<blockquote class="imgur-embed-pub" lang="en" data-id="a/b3Ypi"><a href="//imgur.com/b3Ypi">Trim Left Edge of Item w/o changin Fade Length don't preserve take envelope position</a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

(Not sure it will embed the gif.
Here a link to the imgur post:
http://imgur.com/gallery/b3Ypi)

I just learn the existence of LICEcap, thank for that!

The issue only concern the LEFT edge.
I think there is something with the start position of the item, which is not concern with the right edge trim.

Last edited by Infrabass; 01-25-2017 at 10:53 AM. Reason: Forgot link
Infrabass is offline   Reply With Quote
Old 01-25-2017, 01:10 PM   #30
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default

@Infrabass
Oh ok I see what you mean.

Well, I'll need a bit of time to take care of this.

Meanwhile, can you please bump the Feature Request linked above ? :P

note : to embed GIF on this forum from imgur, just get the gif or gifv URL and put like this
Code:
[img]http://imgur.com/d4s6d4.gif
without the "v" if it was gifv.
X-Raym is offline   Reply With Quote
Old 01-25-2017, 04:11 PM   #31
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,932
Default Update

  • Trim left edge of item under mouse to edit cursor without changing fade-in end
Code:
 * v1.1 (2015-08-11)
    + Stretch Markers and Envelope Points positions preserved
Enjoy !
X-Raym is offline   Reply With Quote
Old 01-25-2017, 08:39 PM   #32
Infrabass
Human being with feelings
 
Join Date: Apr 2014
Posts: 102
Default

Wow!
So kind of you X-Raym!

And thanks for the help with embed images.
My previous post seems a bit silly, haha!

BTW, voted for the feature request!

Thanks for all,
Take care!
Infrabass 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 06:14 AM.


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