Old 08-07-2018, 01:28 PM   #1
divedive
Human being with feelings
 
Join Date: Feb 2012
Location: New York
Posts: 151
Default Overwrite Files in Use

I would like to overwrite a file (via rendering) that is being referenced by my reaper session - but Reaper throws an error and doesn't render;

But, is this actually possible in Reaper somehow?

IE. Render a region to file with option: "Add rendered items to new tracks in project" -> add a fade to the end of the rendered/imported file region -> Make changes to audio in the source region; Render again; Render to File > Render Warning "Overwrite" > ERROR: The target drive/path does not exist, is unavailable, or is in use.

This workflow is very desirable in sample / SFX creation.

I'm aware of the work around using sub projects; I'd love to do this w/o sub projects.

Thanks!
divedive is offline   Reply With Quote
Old 08-07-2018, 09:41 PM   #2
Philbo King
Human being with feelings
 
Join Date: May 2017
Posts: 1,413
Default

I believe this is a windows thing. It won't allow a file to be changed (over-written) when it is open in a program. I just delete the track with the earlier render, then it works fine.
__________________
Tangent Studio - Philbo King
www.soundclick.com/philboking - stream music
www.facebook.com/philboking - gigs and news
Philbo King is offline   Reply With Quote
Old 08-08-2018, 05:23 AM   #3
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 24,068
Default

It's up to reaper FYI. The closet you can get is the setting that releases the exclusive lock when reaper looses focus (like using an external editor) but since this is reaper, not sure it is possible.
__________________
If it requires a null test to find it, it is by definition minuscule.
karbomusic is online now   Reply With Quote
Old 08-08-2018, 06:26 AM   #4
divedive
Human being with feelings
 
Join Date: Feb 2012
Location: New York
Posts: 151
Default

I use "Open Items in Primary External Editor" on a daily basis, round-tripping to/from RX, destructively cleaning files in RX and simply saving and coming back to Reaper. It's a great workflow.

I'd like to similarly destructively overwrite files within the Reaper environment - and strangely Reaper won't allow it.

Bummer!

FEATURE REQUEST!
divedive is offline   Reply With Quote
Old 05-15-2019, 11:39 AM   #5
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

I can imagine how to do this mostly using existing scripting and actions, but am not code savvy enough to script it myself.

Basically, the steps would be:

- get the path and filename of the first selected item on selected track (source_file)
- set time selection to selected items
- glue items, including leading fade-in and trailing fade-out (glued_file)
- rename glued_file to source_file filename
- select all items in project using the source_file
- freeze selected items (source_file no longer being used in project, so not locked by the reaper.exe process)
- copy glued_file to source_file location (overwrite source)
- unfreeze and delete freeze files to recycle bin (thus restoring the source_file use to unfrozen items, which will now be the glued_file that was renamed and copied over the source file)
- replace glued_file in project with the overwritten source_file (renamed glued_file)
- delete renamed glued_file in project directory that is no longer being used

Hopefully I will get the time to make this work in script one of these days. Or maybe someone else will beat me to it (looking at you, @X-Raym or @cfillion ).
earhax is offline   Reply With Quote
Old 05-20-2019, 04:02 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

Hi,

You step 2 is a bit confusing, cause this will merge several items together, and so there will be no other file using that combination of items,


so I assume, you wanted to say "set time selection on the first selected items", and the whole process for each items, and what you do is Glueing items independently (there is already script for that and they don't use time selection for that.)



I have a pretty close premium script for destructive editing called,



Script: X-Raym_Render selected items as new take (preserving original source file name).lua

It could be moded for replacing Render selected items as new take by Glue items independently,


BUT,


This kind of destructive workflow is maybe too... Destructive. I'm not extra cumfy with the idea of having scripts which doesn't allows undo, so I didn't share it publicly. Though it should be solid enough cause I didn't have bug report since a year on it.
X-Raym is offline   Reply With Quote
Old 05-20-2019, 09:07 AM   #7
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

Quote:
Originally Posted by X-Raym View Post
Hi,

You step 2 is a bit confusing, cause this will merge several items together, and so there will be no other file using that combination of items,
Step 2 allows for the capability to render several edits to a sound resulting in multiple items (i.e. trimming sections of a sound out, splicing the tail from one sound to the head of another). This way, similar to how one could make such edits in Sound Forge or another destructive editor, one could make a series of complex edits to a sound, and then create a glued file that would replace that sound, simply based on the name of the file used for the first item in that selection.

Quote:
I have a pretty close premium script for destructive editing called,

Script: X-Raym_Render selected items as new take (preserving original source file name).lua

It could be moded for replacing Render selected items as new take by Glue items independently,

BUT,

This kind of destructive workflow is maybe too... Destructive. I'm not extra cumfy with the idea of having scripts which doesn't allows undo, so I didn't share it publicly. Though it should be solid enough cause I didn't have bug report since a year on it.
I'm not concerned with the destructive nature of this workflow as this is the desired behavior. Any time this function would be used it would replace the original file. However, since I'm dealing with files in source control (as I'm sure many others are as well), any accidental destructive edits could be undone simply by reverting the file.

Sound Forge and other destructive editors lack the power and complexity of what we can do with REAPER. But REAPER lacks the ability to overwrite original files. This functionality would allow me to check out files being used in a Wwise project, open them in REAPER (via ReaOpen), quickly run a batch process using scripting or other actions to make desired changes to the files, and replace the original files without needing to manually copy and replace the files via a file manager (Finder/Explorer).

The reason this is important and useful is that I often times will be working on a different computer that doesn't have all of the same plugins as my main workstation. I will need to quickly make some basic changes to source files in Wwise. If I open the source project, I can't simply make the changes in the original project and re-render the sounds without all of the plugins being installed. But if I edit the source files being used in Wwise directly and overwrite them with the edited content, then the sounds are preserved with the mastering as they were last rendered, and the editing process is as quick and seamless as it would be had I opened the files in Sound Forge to make the edits (eliminating the tedious file management step in the middle that is currently required with editing source in REAPER), yet allowing me to use the full power of REAPER for these edits.

And by adding the other steps I detailed, this functionality would also allow for one to simultaneously replace the source file content used by other items in a project as well. For example, if you wanted to quickly raise the gain for a sound used in several other areas of a project after doing so for just one item using that sound, or if you wanted to process a sound with some new effect/FX chain and apply the same process to every other instance of that sound being used in your project, this would allow you to do just that.

I suppose, for safety's sake, it would be beneficial to add a prompt showing the full path and filename of the file that would be replaced that would need to be acknowledged before running the script and replacing the original file. Or perhaps there could be an added step to create a backup of the original file in the REAPER project folder just in case anything went wrong with replacing the original sound (this would also allow for an 'undo' by then replacing the original source with the backup file). But aside from those optional precautionary steps, I feel that this sort of destructive editing functionality is one of the few blind spots in REAPER, and a feature that I find myself sorely missing since migrating to REAPER from Pro Tools.
earhax is offline   Reply With Quote
Old 05-21-2019, 04:49 AM   #8
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

Ok I thik I get it better,


So in fact there is only one GLUE during the process, and what to be considered as "the original file" is the first selected item, which is the one which have to be renamed after glue, and for which the new soure has to be pushed to other items which used the original.


In this case indeed my script seem pretty close to that indeed, but require some work.


This is a very raw demo, it doesn't work in a lot of cases for now.





Do you confirm it is something similar you want to achieve ?



---

Also what is ReaOpen ?
X-Raym is offline   Reply With Quote
Old 05-21-2019, 05:27 AM   #9
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

Quote:
Originally Posted by X-Raym View Post
So in fact there is only one GLUE during the process, and what to be considered as "the original file" is the first selected item, which is the one which have to be renamed after glue, and for which the new soure has to be pushed to other items which used the original.

Do you confirm it is something similar you want to achieve ?

Also what is ReaOpen ?
I think you understand now. The gif you shared doesn't quite illustrate it, however.

If the various colored items you are editing were from either the same item or different items, it only matters what file the first selected item is from, as that would be the one that is replaced with the glued file.

The glue operation would glue all selected items together as one item, including any gaps between the items, leading fade-in/out, take volume/panning/etc., and take/item fx. This is why setting the time selection to all selected items and gluing everything in the time selection for the glue operation is important.

Then, after gluing the items, the glued file would be renamed, and would overwrite the file for the first selected item that was glued. This would propogate to any other usage of that file in the project (due to the other steps I detailed), but wouldn't change any editing for the items using that file. In your example, the duplicated items reflect the editing you did to the first track. With the operation I'm proposing, only the file content would be replaced, meaning the second item (lime color) would still be present in the second track, but the wave content in that item would be changed based on the source file changes. Either the 5th or 6th items (orange or yellow color) would then contain a loop point due to the end of the new/edited item being earlier in the file (as it's now shorter than the original, if all of the items in this example are splits of the same file, and you glued all of the items in the first track together to replace the first selected item).

Hopefully this makes it a bit clearer. To put it more simply, if you think about it, it would be the same result as if you had closed REAPER, opened the source file in Sound Forge, trimmed it shorter, and reopened the REAPER project.

Here's some info on ReaOpen. Unless you work in game audio or are using Wwise, it may not be of much use to you.

https://blog.audiokinetic.com/connec...art-2-reaopen/
earhax is offline   Reply With Quote
Old 05-21-2019, 06:10 AM   #10
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

Quote:
The glue operation would glue all selected items together

This is not possible per definition. Glueing items works Per Track. You can have items selected on different tracks but you cannot glue them. So a first limiation should be put there : only glue items on first selected item tracks.






Quote:
Time selection
Definting a time selection or not doesn't change the length of the output file for me, do I miss a setting somewhere ?




Quote:

In your example, the duplicated items reflect the editing you did to the first track. With the operation I'm proposing, only the file content would be replaced, meaning the second item (lime color) would still be present in the second track, but the wave content in that item would be changed based on the source file changes.
This is exactly what is going on in my screesnhot.
First sel item is sinewaves.wav,
Items on second track is also sinewaves.wav but with length = file source content.
So glueing first sel items, then it get rename as original, and then it is propagate to the other item which used the first selected item source...



If I miss anything please make detailed screenshots, thanks :P
X-Raym is offline   Reply With Quote
Old 05-27-2019, 04:44 AM   #11
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

Quote:
Originally Posted by X-Raym View Post
This is not possible per definition. Glueing items works Per Track. You can have items selected on different tracks but you cannot glue them. So a first limiation should be put there : only glue items on first selected item tracks.


Yes, I only ever meant that this would work for items selected on one track, the same way a save/overwrite would work while working on one file in Sound Forge, or any other destructive audio file editor.

Quote:
Originally Posted by X-Raym View Post
Definting a time selection or not doesn't change the length of the output file for me, do I miss a setting somewhere ?


Ah ok. I didn't realize that a glue operation would glue all selected items on a track together, including any space between them, without using a time selection. However, if there are time-based fx on the last selected item, like reverb or delay, using a time selection for the glue operation would be necessary to ensure that the glued item contained the tail for the effects. Right?

Also, by gluing the time selection, this would allow the user the option of adding silence at the start or end of the glued items.

Quote:
Originally Posted by X-Raym View Post
This is exactly what is going on in my screesnhot.
First sel item is sinewaves.wav,
Items on second track is also sinewaves.wav but with length = file source content.
So glueing first sel items, then it get rename as original, and then it is propagate to the other item which used the first selected item source...



If I miss anything please make detailed screenshots, thanks :P
I'm not sure which screen capture you are referring to in particular, if it is one from this post, or a previous post. But so far, none of them really illustrate the process I am trying to describe.

I will try to illustrate with some images in my next reply, since I'm not too sure how to make the animated gifs like you've shared.
earhax is offline   Reply With Quote
Old 05-27-2019, 05:17 AM   #12
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

Quote:
like reverb or delay, using a time selection for the glue operation would be necessary to ensure that the glued item contained the tail for the effects. Right?
Not really.


You don't need to "glue", you need to either Render to new take, or even to Apply Track/Take FX as new take, cause this have a Tail settings :



And then just use the action Take: Crop to active take in items to get rid of previous take.

(Though, if you need pre-roll handle (not just tails), I have made a script pack for that).

The problem for you with the native Apply FX and the Render to new take actions is that it works for each items, so it create a new file for each instance of the source.

So I guess you will need to render only the first take for each selected source, and propagate the new source to all other items using this source.
For eg, if you have item A and B using source1.wav, both selected, and you run the desired action, it will just Apply FX (with tail) to item A creating source2.wav and propagate source 2.wav to item1.wav (because it had the source before the render of itemA). Correct ?

Screenshot will help a lot.

I personnally use ShareX for animated screenshots (and Monosnap for regular ones or videos) because it has auto upload, but you can use simple desktop software like Cockos LICEcap and update manually if you want.
X-Raym is offline   Reply With Quote
Old 05-27-2019, 07:15 AM   #13
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

@X-Raym
Actually, scratch the bit about FX tails. That could be done using a render action as you say. And I suppose it could still be done in the context of a script like this, but maybe as a separate version when replacing an original sound with a new version that has some new FX applied would be more useful. However, I think just keeping this to gluing items to replace an original file (based on the first selected track & item) is enough for now.

Here are some images to help illustrate what I'm hoping to do with this script.

First, here's one showing a track containing the original/unedited file, and another track above it containing an edited version using the same source.


Next, the time selection is glued, maintaining the same length as the original file. I like using this action because it makes it easy to change whether or not additional space will be included at the start or end of the items being glued


Now, any other items using the same original source would be frozen. Since I couldn't find an easy way to do this, I opted to use a track freeze action instead. The reason for using freeze instead of glue for this step is that it should be easier to unfreeze in a later step and restore any edits or fx that were present. But both options have the same effect of releasing REAPER's hold on original file.


Next, the original source file is renamed by appending "_BACKUP".


In this case, the source file happens to be in the project folder. So rather than renaming the glued file to the source filename and copying the file to the same folder location as the source file, the glued file is just renamed the same name as the original source.


Now is the point where any items that shared the same source to be replaced that were frozen would be unfrozen, thus restoring the use of the source file, which has now been replaced with the edited, glued, and renamed file. And again, since I wasn't sure how to freeze/unfreeze an item, I'm just using track unfreeze for the example here.


Lastly, (and this step would be optional, since it would break the undo capabilities) the freeze files that are now no longer needed would be deleted.


Hopefully this makes it much more clear what I am hoping to accomplish here. Please let me know if there are any problems with any of this, or if anything is still unclear.

And thanks again for helping out with this!!!
earhax is offline   Reply With Quote
Old 05-27-2019, 07:36 AM   #14
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

This seems almost completly similar with the screenshot I posted in #8.






The only difference is that glue length wasn't set from time selection (but really not a big deal to add it),


and internally the script used most direct way to offline items (instead of freezing tracks wich is slow) and backup files.


Here is the result if there was a time selection:





(source is first track, edited copy to glue is second track).


It seems it only miss a way to restrict item length is source is shorter but this kind of thing isn't that quick to implement. Using Item: Propagate to all similarly-named items seems to be enough anyway.
X-Raym is offline   Reply With Quote
Old 05-27-2019, 08:48 AM   #15
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

Quote:
Originally Posted by X-Raym View Post
This seems almost completly similar with the screenshot I posted in #8.






The only difference is that glue length wasn't set from time selection (but really not a big deal to add it),


and internally the script used most direct way to offline items (instead of freezing tracks wich is slow) and backup files.


Here is the result if there was a time selection:





(source is first track, edited copy to glue is second track).


It seems it only miss a way to restrict item length is source is shorter but this kind of thing isn't that quick to implement. Using Item: Propagate to all similarly-named items seems to be enough anyway.
Oh haha. I see what happened here. Looking again at the gif you shared originally, I realize now that I thought all of the different colors were different items, and it looked like after gluing, there were still a bunch of separate items. Now I realize that you just have some sort of color coding to the files' wave data (I'm guessing based on frequency, and there are several sine waves at different frequencies in the file?), and that you actually just did a crossfade of two items and replaced the original item with the edited result.

And yeah, propagating the new source file length to other items using it isn't a big deal.

So yes, it does seem that this is what I was hoping to achieve. Sorry for the confusion/misunderstanding!

Please do let me know if/when you have the script available for this. It would be a huge help/time saver. And thanks again!
earhax is offline   Reply With Quote
Old 05-27-2019, 08:54 AM   #16
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

Quote:
you just have some sort of color coding to the files' wave data (I'm guessing based on frequency, and there are several sine waves at different frequencies in the file?), and that you actually just did a crossfade of two items and replaced the original item with the edited result.
Ah yes, I suspected there was a confusion here but I didn't insist, I should have clean this doubt from the start ^^


This feature is one of the greatest feature of REAPER IMHO, it is so handy for sound deisgn, dialog and music editing. It is called Spectral peaks.


Back to the script,
The script is almost ready to share, I will put it in a premium pack with the Render as new take equivalent as it may interest other professionals game developer using WWise. Stay tuned !
X-Raym is offline   Reply With Quote
Old 06-01-2019, 08:34 AM   #17
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

Hi !


So I finally release a pack,
I had to make a backup / restore system,
write doc,
make documentation etc...


Here it is :



Tell me if it sounds good to you !
X-Raym is offline   Reply With Quote
Old 06-05-2019, 05:45 AM   #18
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

Quote:
Originally Posted by X-Raym View Post
Hi !


So I finally release a pack,
I had to make a backup / restore system,
write doc,
make documentation etc...


Here it is :



Tell me if it sounds good to you !
Awesome! Thank you! I'll reply back after I've got it and have tested it out.
earhax is offline   Reply With Quote
Old 06-05-2019, 09:57 AM   #19
earhax
Human being with feelings
 
Join Date: Nov 2015
Posts: 171
Default

@X-Raym Is it in the pack but just not listed in the pack content on the website yet? Or is it maybe one of the 3 listed in the pack, but named a bit ambiguously? I was expecting it to be named something along the lines of 'replace source file of item with glued selected items/time selection for first selected track/item'. I'm just wondering what the actual script is named, and to make sure it is in the pack before I get it.
earhax is offline   Reply With Quote
Old 06-05-2019, 11:50 AM   #20
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,875
Default

Quote:
'replace source file of item with glued selected items/time selection for first selected track/item'.
oops yes sorry I was mislead by the thread title wich is a bit too wide.


Check the page again I uploaded the script for which I show a screenshot.



Note that it works just like the screenshot.
X-Raym 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 08:32 AM.


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