|
|
|
08-28-2017, 02:47 AM
|
#1
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
amagalma_Smart Crossfade
# Crossfades 2 items per track inside a Razor Edit area OR selected items
- If there is a Razor Edit area then the script works on the RE like my "amagalma_Crossfade items in Razor Edit area.lua" script, else works on the selected items
- If any two items are adjacent then it creates a crossfade on the left side of the items' touch point
- If any two items are almost adjacent and their gap is less or equal to the default crossfade time then a crossfade is created
- If items overlap then it creates a crossfade at the overlapping area
- If there is a time selection covering part of both items, then it crossfades at the time selection area (items do not have to touch - closes the gap)
- Can be used with as many items in different tracks as you like
- Smart undo point creation (only if there has been at least one change)
- You can set inside the script if you want to keep the time selection or remove it (default: remove)
- You can set inside the script if you want to keep selected the previously selected items or not (default: keep selected)
- Default crossfade length and type are gotten automatically from Reaper Preferences ("Overlap and crossfade items when splitting, length" and "Default crossfade shape")
- Fade shape can be specified inside the script (overrides the one set in the Preferences)
available in ReaPack
Last edited by amagalma; 03-31-2021 at 03:32 AM.
|
|
|
08-28-2017, 03:12 AM
|
#2
|
Human being with feelings
Join Date: Apr 2016
Posts: 103
|
Well, thank you!
|
|
|
08-28-2017, 04:12 AM
|
#3
|
Human being with feelings
Join Date: Jan 2015
Posts: 794
|
little bug
Great!! it puts together "crossfade any overlapping item" and "SWS: Fade in/out/crossfade selected area of selected items"
But one little bug exist: when crossfading a selection (only when a selection exists) of two overlapping items the snap offset (if set different than the beginning of the item) get moved.
In the SWS action it doesn't.
see example below
g
|
|
|
08-28-2017, 05:18 AM
|
#4
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Thanks for the bug report, Gianfini!
I'll fix it on Sunday when I am back from vacations
|
|
|
09-03-2017, 02:03 PM
|
#5
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
* v1.2 (2017-09-03)
+ fixed bugs
+ no need for SWS extensions
+ you can set in the script if you want to keep the time selection or remove it
+ you can set in the script if you want to keep selected the previously selected items or not
* v1.21 (2017-09-04)
+ default crossfade shape: equal power
Last edited by amagalma; 09-03-2017 at 04:04 PM.
|
|
|
09-04-2017, 03:31 AM
|
#6
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
* v1.24 (2017-09-04)
+ better behavior when creating undo points
+ default crossfade time can be set inside the script
* v1.25 (2017-09-04)
+ better behavior when existing crossfades do not conform to wanted crossfade type/shape/time
* v1.26 (2017-09-04)
+ undo point creation includes time selection if it was requested to be removed after crossfading
I think it should be final now
Last edited by amagalma; 09-19-2017 at 12:50 AM.
|
|
|
09-19-2017, 12:51 AM
|
#7
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
* v1.30 (2017-09-19)
+ fixed bug when "Trim behind items" was enabled
+ fixed loosing item selection, in case no change to any items had happened
+ now items can be crossfaded when there is a time selection touching both items, even if the two items do not touch each other
|
|
|
09-19-2017, 11:25 AM
|
#8
|
Human being with feelings
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
|
Awesome thanks!
I'm sure it will come in handy!
__________________
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.
|
|
|
09-23-2017, 01:25 PM
|
#9
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
* v1.31 (2017-09-23)
+ fixed misbehavior when there were "autofades" in items
I think this is the final one..
@musicbynumbers: cheers mate!
|
|
|
09-24-2017, 12:24 AM
|
#10
|
Human being with feelings
Join Date: Jan 2015
Posts: 794
|
thanks very good! It replaced all my cross fade actions
g
|
|
|
09-25-2017, 12:49 PM
|
#11
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
* v1.32 (2017-09-25)
+ fixed occasional problem with adjacent items not crossfading (I think I have found a bug in Reaper)
|
|
|
09-25-2017, 01:00 PM
|
#12
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
and here is the Reaper bug:
and the test code:
Code:
item = reaper.GetSelectedMediaItem(0,1)
previousitem = reaper.GetSelectedMediaItem(0,0)
secondstart = reaper.GetMediaItemInfo_Value(item, "D_POSITION")
firstend = reaper.GetMediaItemInfo_Value(previousitem, "D_POSITION") + reaper.GetMediaItemInfo_Value(previousitem, "D_LENGTH")
reaper.ShowConsoleMsg("end of first item is "..firstend.."\n")
reaper.ShowConsoleMsg("start of second item is "..secondstart.."\n")
if firstend == secondstart then
reaper.ShowConsoleMsg("They are equal")
else
reaper.ShowConsoleMsg("They are not equal")
end
So, I had to do this in my script in order to overcome the bug:
Code:
if firstend < secondstart - 0.00001 then
|
|
|
09-26-2017, 01:46 AM
|
#13
|
Human being with feelings
Join Date: Jan 2015
Posts: 794
|
Wow you should post on Bug Reports
Maybe the values differ after the 8th decimal(!) Because of sample level snapping?
Anyway in the meantime to overcome the issue you could round up till say the 5th decimal before comparing...
G
Last edited by Gianfini; 09-26-2017 at 05:38 AM.
|
|
|
09-27-2017, 09:35 AM
|
#14
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
* v1.33 (2017-09-27)
+ if there is a gap smaller or equal to the xfade time (default:10ms) between two items, then they are considered as adjacent
P.S. I posted about the "bug" but it is not a bug.. in a few words, one should not trust floating point numbers and should define him/herself the amount of error that is accepted. Now I know
|
|
|
10-11-2017, 03:29 PM
|
#15
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
* v1.35 (2017-10-12)
+ hopefully, all problems caused by floating point maths should have been fixed now
|
|
|
11-21-2017, 07:37 AM
|
#16
|
Human being with feelings
Join Date: Apr 2014
Posts: 234
|
This script is really cool! Could:
Quote:
If items are adjacent then it creates a crossfade (length is user defined inside the script) on the left side of the items' touch point
|
Be defined as between the two points if we desired?
Here's how studio one handles it:
Clip A: More audio after end of item
Clip B: More audio before start of item
Clip A: More audio after end of item
Clip B: No audio before start of item
Clip A: No audio after end of item
Clip B: More audio before start of item
Clip A: No audio after end of item
Clip B: No audio before start of item
I'd love it if it could be modified to work exactly like these four scenarios?
|
|
|
11-25-2017, 09:30 AM
|
#17
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
I think there are already actions (native and sws) that work in these ways. Creating a crossfade on the left side of the split is something it didn't exist, and it is my preferred way of working (for example, when splitting at the start of a transient)
|
|
|
11-26-2017, 07:58 AM
|
#18
|
Human being with feelings
Join Date: Apr 2014
Posts: 234
|
Quote:
Originally Posted by amagalma
I think there are already actions (native and sws) that work in these ways. Creating a crossfade on the left side of the split is something it didn't exist, and it is my preferred way of working (for example, when splitting at the start of a transient)
|
I agree, actually I hadn't considered how useful it is to preserve transients whilst eliminating zero-crossing clicks before using this script. I was just curious if it was possible to customise it easily.
|
|
|
03-23-2018, 08:53 PM
|
#19
|
Human being with feelings
Join Date: Jun 2014
Posts: 4
|
bug report
hey!
this is an awesome script, thank you for your work.
i have a problem with it though:
i have a custom action for doing 4point editing in classical music.
after copying a specific area in the "source" file, i switch to the "destination" file.
then:
- time selection adaptive delete
- paste
then i select the pasted item + the items on the left and on the right and finally run your script. but here is what happens (gif via cloud link):
https://drive.google.com/open?id=1B1...03jGX34mwfta-s
so it appears to make the crossfade only on the right side of the item.
BUT as soon as you move the conjunction points of the items, the action works. which is acually also quite weird.
i would be really glad if you could help me out on this...
thanks!
Lukas
|
|
|
03-25-2018, 01:17 PM
|
#20
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Could you attach a sample project (without the audio) here? And throw a couple of markers to show me where the script does not work. Thanks
|
|
|
03-26-2018, 09:21 PM
|
#21
|
Human being with feelings
Join Date: Jun 2014
Posts: 4
|
there you go!
i run the script after selecting the 3 items, with no time selection active.
in the second track, i just moved only the crossfades of the items a tiny bit - and then the script works.
best!
Lukas
|
|
|
03-31-2018, 12:52 AM
|
#22
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Thanks! I am currently away. When I return I 'll check what is wrong
|
|
|
04-01-2018, 03:04 PM
|
#23
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
v1.37 uploaded on ReaPack
- fixes malfunction when dealing with items that overlap less than the default crossfade time
@Itsmusicinmyears: thanks for the report
|
|
|
08-17-2018, 03:31 AM
|
#24
|
Human being with feelings
Join Date: Jan 2012
Posts: 1,180
|
Hi Amagalma
I'm wondering if a variation of this script could be made.
At the end of each record pass (in takes "normal" mode) reaper selects the items created.
I'd like to use a script to then place a cross-fade at the start and end of the recorded item if it touches other items. I could use this script as is and hack around by deselecting any time selection and adding actions to select/deselect previous and next items but a script edit would be slicker!
I currently have record start and stop mapped via a cycle action that performs other actions for possible group select after record passes. I could add this new script to the record stop part then reaper would auto create cross-fades on record punch points in takes mode.
Many thanks for your time
|
|
|
08-19-2018, 02:34 PM
|
#25
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
What you said yourself is the best solution. Just create a custom action:
- Time selection: Remove time selection
- SWS: Add item(s) to left of selected item(s) to selection
- SWS: Add item(s) to right of selected item(s) to selection
- Script: amagalma_Smart Crossfade.lua
|
|
|
08-19-2018, 03:07 PM
|
#26
|
Human being with feelings
Join Date: Jan 2012
Posts: 1,180
|
It's the easiest and it does work thanks for sharing your smart crossfade script.
I have it in a macro, saving the current time selection before clearing it and then reinstating.
And saving the recorded item selection and reinstating that after your script also.
It's mapped as my stop/play command in a cycle action. I'll make another for my record/play one.
If anyone else is looking for auto crossfade on record punch amagalma's script looks like a large part of the answer with a bit of macro fudge
|
|
|
09-24-2019, 03:57 AM
|
#27
|
Human being with feelings
Join Date: Aug 2019
Location: beijing
Posts: 612
|
loved this script,
works like a charm to me,
easy to use.
where can I donate you for expressing my appreciation ?
|
|
|
09-29-2019, 12:13 PM
|
#28
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Thanks for the kind words!
I do not have a donation link, so if you want you can donate instead to any organization helping poor kids, refugees, animals, or any other good purpose you like.
|
|
|
09-29-2019, 12:37 PM
|
#29
|
Human being with feelings
Join Date: Jan 2019
Location: Toronto, Canada
Posts: 533
|
Quote:
Originally Posted by amagalma
Thanks for the kind words!
I do not have a donation link, so if you want you can donate instead to any organization helping poor kids, refugees, animals, or any other good purpose you like.
|
Been loving this script as well, and that's about the coolest donation idea ever....CUDOS!!!
|
|
|
10-02-2019, 10:51 AM
|
#30
|
Human being with feelings
Join Date: Aug 2019
Location: beijing
Posts: 612
|
Quote:
Originally Posted by amagalma
Thanks for the kind words!
I do not have a donation link, so if you want you can donate instead to any organization helping poor kids, refugees, animals, or any other good purpose you like.
|
What a kind soul u have !
Thank u again and wish u all the best
|
|
|
11-07-2019, 01:23 AM
|
#31
|
Human being with feelings
Join Date: Oct 2019
Posts: 1
|
Possible to change centerpoint of crossfae?
Hi @Amagalma. Thank you so much for your script, it's exactly what I needed. I do have one question - Is there a way I could edit the script so that rather than creating the crossfade to the left of the cursor it would actually use the cursor position as the centerpoint of the xfade?
|
|
|
12-18-2019, 03:36 PM
|
#32
|
Human being with feelings
Join Date: Nov 2019
Posts: 225
|
Quote:
Originally Posted by amagalma
Thanks for the kind words!
I do not have a donation link, so if you want you can donate instead to any organization helping poor kids, refugees, animals, or any other good purpose you like.
|
What a good idea!
I have a question to the script: In Cubase the max gap is set to 500ms fixed. Would it be possible to set also the max gap between the items in this script (as an addition to the crossfade time)?
|
|
|
12-22-2019, 05:08 AM
|
#33
|
Human being with feelings
Join Date: Nov 2019
Posts: 225
|
@amagalma
I took some time and tweaked your script so now we can set the max gap time between items.
Also I added a crossfade on the left/middle/right option
https://forum.cockos.com/showthread....66#post2221366
|
|
|
12-17-2020, 04:17 AM
|
#34
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
v1.50 changelog:
- fixed one bug, improved code in many places
- from now on the setting for the crossfade length and shape is gotten automatically from Reaper Preferences ("Overlap and crossfade items when splitting, length" and "Default crossfade shape")
- updated ReaPack info
- If any two items are adjacent then it creates a crossfade on the left side of the items' touch point
- If any two items are almost adjacent and their gap is less or equal to the default crossfade time then a crossfade is created
- If items overlap then it creates a crossfade at the overlapping area
- If there is a time selection covering part of both items, then it crossfades at the time selection area (items do not have to touch - closes the gap)
- Can be used with as many items in different tracks as you like
- Smart undo point creation (only if there has been at least one change)
- You can set inside the script if you want to keep the time selection or remove it (default: remove)
- You can set inside the script if you want to keep selected the previously selected items or not (default: keep selected)
- Default crossfade length and type are gotten automatically from Reaper Preferences ("Overlap and crossfade items when splitting, length" and "Default crossfade shape")
|
|
|
02-11-2021, 09:08 PM
|
#35
|
Human being with feelings
Join Date: Jan 2019
Location: Toronto, Canada
Posts: 533
|
Still loving this script! As of a few weeks ago, when I run the script the Console window appears (and stays) on screen. Previously this never happened - is there a preference to get it to close automatically?
I'm on Mac 10.14.6 and Reaper 6.23 here currently. Thanks!!
|
|
|
02-12-2021, 02:21 AM
|
#36
|
Human being with feelings
Join Date: Jan 2012
Posts: 1,180
|
Amagalma will reply but I think the new version update has debug enabled. You can turn it off in the first few lines of the script.
|
|
|
02-12-2021, 04:21 AM
|
#37
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Shit! I had indeed forgotten it on! Sorry guys! v1.51 is up
|
|
|
02-12-2021, 01:55 PM
|
#38
|
Human being with feelings
Join Date: Jan 2019
Location: Toronto, Canada
Posts: 533
|
That's it!! Thanks so much! 🍻
|
|
|
03-29-2021, 08:33 PM
|
#39
|
Human being with feelings
Join Date: Jan 2019
Location: Toronto, Canada
Posts: 533
|
Amagalma - just curious if you have any plans to include razor edit selected areas into this script? Thanks again for a great tool!!
|
|
|
03-31-2021, 02:15 AM
|
#40
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Yes I am planning to merge it with my amagalma_Crossfade items in Razor Edit area.lua script, but haven't had the time yet..
|
|
|
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 06:34 AM.
|