Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 01-27-2018, 05:37 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default "Render INTO next take": Re-render / freeze item without losing later edits [DONE!]

In a recent discussion at VI-Control, DAW other than Studio One that bounces midi track and keep data?, it was pointed out that REAPER cannot yet do this:

Quote:
In Studio One, once the MIDI track is converted to audio, you can treat it totally as regular audio so you can chop it up, move it, shorten a clip, add effects, do whatever... and you don't have to keep freezing / unfreezing it to make additions or changes. If you need to go back to the MIDI, you just hit the command to convert back to a MIDI track, and all your changes will be there. In other words, the alterations you had made in the audio (i.e. moving it, duplicating it, etc.) will be reflected in the MIDI now. So it's not like reverting or going backwards. It allows you to keep moving forward but still be able to do things to the MIDI also without losing what you did when it was the audio.
I'm not sure if this can really be done with frozen *tracks*, but it should be straightforward to add this capability to REAPER's current multi-*take* features. A new "Render INTO next take" action that does the following:
* After rendering ("Apply take/track FX"), take FX should automatically be set offline. This would save memory similar to freezing.
* Instead of creating a new take, simply replace the media source of the next take, thereby keeping all FX, stretch markers and envelopes of the next take intact.

I wrote a little script to test the idea, and a GIF to demonstrate how stretch markers are kept intact:




Code:
reaper.Undo_BeginBlock2(0)

tT = {}

-- First, get the original takes, before rendering
for i = 0, reaper.CountSelectedMediaItems(0)-1 do
    item = reaper.GetSelectedMediaItem(0, i)
    tT[item] = {}
    tT[item].active = reaper.GetActiveTake(item)
    tT[item].activeNum = reaper.GetMediaItemTakeInfo_Value(tT[item].active, "IP_TAKENUMBER")
    if tT[item].activeNum < reaper.CountTakes(item)-1 then 
        tT[item].origNext = reaper.GetTake(item, 1 + tT[item].activeNum) -- Next take in sequence
    end
end

reaper.Main_OnCommandEx(40209, 0, 0) -- Item: Apply track/take FX to items

for item, takes in pairs(tT) do

    -- Set active take's FX offline (is there an easier way than via chunks?)
    local chunkOK, chunk = reaper.GetItemStateChunk(item, "", false)
    local activeGUID = reaper.BR_GetMediaItemTakeGUID(takes.active)
    local nextTake = reaper.GetTake(item, (takes.activeNum) + 1) -- Might be different from original next take, origNextTake
    local nextGUID = reaper.BR_GetMediaItemTakeGUID(nextTake)
    activeStart = chunk:find(activeGUID, 1, true) -- Separate activate take's part of chunk, so that only those FX will be set offline
    nextStart   = chunk:find(nextGUID, takeStart, true)
    activeChunk = chunk:sub(activeStart, nextStart-1)
    activeChunk = activeChunk:gsub("\nBYPASS %d %d", "\nBYPASS 0 1")
    reaper.SetItemStateChunk(item, chunk:sub(1,activeStart-1) .. activeChunk .. chunk:sub(nextStart))
    
    -- Get newly rendered take (can I assume that the new take will always be the active take?)
    takes.new = reaper.GetActiveTake(item)
    
    -- Copy rendered take into origNext.  (Only IF there was a next take.) 
    -- (Actually, must *swap* audio sources before deleting, otherwise REAPER will crash).
    -- Newly rendered take will be deleted after swapping.
    if takes.origNext then
        if reaper.TakeIsMIDI(takes.new) and reaper.TakeIsMIDI(takes.origNext) then
            local MIDIOK, MIDI = reaper.MIDI_GetAllEvts(takes.new, "")
            reaper.MIDI_SetAllEvts(takes.origNext, MIDI)
        elseif not reaper.TakeIsMIDI(takes.new) and not reaper.TakeIsMIDI(takes.origNext) then
            renderedSource = reaper.GetMediaItemTake_Source(takes.new)
            origNextSource = reaper.GetMediaItemTake_Source(takes.origNext)
            reaper.SetMediaItemTake_Source(takes.origNext, renderedSource)
            reaper.SetMediaItemTake_Source(takes.new, origNextSource)
        end        
        
        -- Delete newly rendered take (can this be done in a better way than via OnCommand?)
        reaper.SetActiveTake(takes.new)
        reaper.SelectAllMediaItems(0, false)
        reaper.SetMediaItemSelected(item, true)
        reaper.Main_OnCommandEx(40129, 0, 0) -- Take: Delete active take from items
        reaper.SetActiveTake(takes.origNext)
        reaper.UpdateItemInProject(item)
    end
    
    -- Re-select all items
    for item, takes in pairs(tT) do
        reaper.SetMediaItemSelected(item, true)
    end
end

reaper.Undo_EndBlock2(0, "Render into next take", -1)

Last edited by juliansader; 09-14-2018 at 01:33 PM.
juliansader is offline   Reply With Quote
Old 01-27-2018, 05:44 AM   #2
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 24,790
Default

I think what S1 does here is simply Melodyning the frozen audio and applying tweaks to MIDI according to that. Might be wrong, though. So after ARA2 is introduced to Reaper, we could have this functionality natively, as well
EvilDragon is offline   Reply With Quote
Old 01-27-2018, 02:08 PM   #3
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

this would be really nice! i am curious to see how studio one handles it.

Freezing a track and editing the corresponding audio could be converted back to midi in many situations and would be awesome but i don't see how this could handle example: added silence in the middle of one long note or removed tail from a note.

in Studio one Is frozen audio protected to accept just some actions? example: frozen audio can be only duplicatable and copied and moved but not partially deleted, not glued or normalized, etc ...
deeb is offline   Reply With Quote
Old 01-27-2018, 02:18 PM   #4
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

ARA support is going to be fantastic, but I don't think that the types of edits mentioned in the VI-Control thread (chop, move, duplicate, add effects, etc) are done via Melodyne. These are just standard item editing, done in the arrange view.

This feature will be particularly helpful if a user wants to make a small change to a frozen MIDI take, changing the keyswitch articulation of a few notes -- while keeping all subsequent audio edits intact.
juliansader is offline   Reply With Quote
Old 05-28-2018, 03:36 AM   #5
Neutronic
Human being with feelings
 
Neutronic's Avatar
 
Join Date: Sep 2013
Posts: 657
Default

Easy +1. That'd be a seriously useful feature.
Neutronic is offline   Reply With Quote
Old 09-09-2018, 04:55 PM   #6
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Agreed, would be fantastic
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 09-14-2018, 01:38 PM   #7
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I've uploaded a working script to ReaPack:

js_Render items INTO next take (and toggle freeze active take)

* The script automatically renders to the same source type as the next take: either MIDI, mono audio or multi-channel audio.

* Before rendering, the active take's offline Take FX are set online; and after rendering, online Take FX are set offline. The user therefore doesn't need to manually freeze or unfreeze the take.


Other notes:
* Track FX are bypassed while rendering, similar to REAPER's own "Render item" actions. Only Take FX are applied and toggled online/offline.
* If any of the selected items cannot be rendered into the next take (for example if the active take is the last take), it will be deselected.
juliansader is offline   Reply With Quote
Old 09-14-2018, 02:27 PM   #8
andyp24
Human being with feelings
 
andyp24's Avatar
 
Join Date: Mar 2016
Posts: 1,239
Default

I might be misunderstanding this, but can it be used as a kind of non-destructive glue for audio items?

E.g. if I have a track with a lot of audio items edited together, can I use this to Render those as a new single item, but have the option later to go back to the unrendered edit?

Thanks
andyp24 is offline   Reply With Quote
Old 09-14-2018, 02:58 PM   #9
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Unfortunately not -- this script is strictly item-based.

The idea behind the scripts is to employ REAPER's advanced multi-take capabilities to achieve multi-step freezing of items, as well as easy editing and re-rendering of such frozen items.

Each take in an item can represent a step in the editing process, e.g:

MIDI (with VSTi's as Take FX) -> audio (with Take Envelopes) -> audio (with stretch markers) -> etc

* Edits can be made to first MIDI take, and re-rendered as new audio into the subsequent takes, without losing any of the audio edits in later takes.

* Take FX, particularly VSTi samplers that require lots of memory, are set offline after rendering/freezing the MIDI, thereby freeing the memory.
juliansader is offline   Reply With Quote
Old 09-15-2018, 03:15 AM   #10
andyp24
Human being with feelings
 
andyp24's Avatar
 
Join Date: Mar 2016
Posts: 1,239
Default

Gotcha, thanks.
andyp24 is offline   Reply With Quote
Old 09-15-2018, 07:36 AM   #11
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Thank you Js! i don't know what am i doing wrong! i get this:

deeb is offline   Reply With Quote
Old 09-15-2018, 04:41 PM   #12
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

It seems as if the item gets deselected, which means that the script couldn't render that item - most likely because the active take is the last take, so there isn't a "next" take.

Also, I don't see any Take FX on that item, so there might not be anything for the script to do.

Note that this script is intended to be similar to REAPER's own "Render item" actions, which don't apply Track FX. I should probably upload a variant of the script that is similar to REAPER's "Apply track/take FX" actions, which do apply Track FX. In the case of Track FX, however, it may be difficult to decide which FX to automatically set online before rendering and which to automatically set offline after rendering.

EDIT: I uploaded another version that does apply Track FX, and does not change the Track FX online/offline/bypass status: Render items INTO next take (apply track FX and toggle freeze active take FX).

Last edited by juliansader; 09-25-2018 at 10:39 AM.
juliansader is offline   Reply With Quote
Old 09-16-2018, 09:24 AM   #13
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Quote:
Originally Posted by juliansader View Post
It seems as if the item gets deselected, which means that the script couldn't render that item - most likely because the active take is the last take, so there isn't a "next" take.

Also, I don't see any Take FX on that item, so there might not be anything for the script to do.
Ahh cool! you are right! i wasn't thinking well! Thanks!

Quote:
Originally Posted by juliansader View Post
I should probably upload a variant of the script that is similar to REAPER's "Apply track/take FX" actions, which do apply Track FX. In the case of Track FX, however, it may be difficult to decide which FX to automatically set online before rendering and which to automatically set offline after rendering.
this would probably be very nice! i'd say all or until last vsti! without proper knowledge! i'll have to understand first this version and maybe then i can have a proper opinion, if you don't mind.!
All good meanwhile ! Thank you
deeb is offline   Reply With Quote
Old 09-16-2018, 10:40 AM   #14
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

sorry, this is what i get:


i need to have a take? isn't an item considered take[0] or something like this?

I am expecting something like: render item and it's envelopes to wav to a new take. And take[0] stays with envelopes in case i want to edit again later. Between this would be awesome for tracks too (almost a dream : ) ).
deeb is offline   Reply With Quote
Old 09-16-2018, 01:58 PM   #15
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by deeb View Post
i need to have a take? isn't an item considered take[0] or something like this?

I am expecting something like: render item and it's envelopes to wav to a new take. And take[0] stays with envelopes in case i want to edit again later. Between this would be awesome for tracks too (almost a dream : ) ).
You need at least *two* takes:
* the active take, which will be re-rendered, and
* the next take, into which will be rendered.

Perhaps I should adjust the script so that, if there is no "next" take, it will perform a standard render and create a new take (and set the active take's Take FX offline). However, without a dialog box, the script would not know whether to render to MIDI, mono audio or multi-channel audio.
juliansader is offline   Reply With Quote
Old 09-17-2018, 06:49 PM   #16
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Ok i tried again! Awesome script! very nice idea and i think i will start using this A LOT!
Thanks
deeb is offline   Reply With Quote
Old 03-14-2019, 11:20 AM   #17
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

This is so awesome!! I was just trying to think a way to do this!! I come from studio one and this is one thing i missed so far. But actually, with this, reaper is now more powerful in this area too! No more being limited to one step of 'undo' if you will. Plus, if you make edits in studio one and then 'revert' you lose all your edits. This is awesome.

Is there a quick shortcut to just 'make a new empty take' or is the best way to just 'duplicate take' then run the action?
Cheers!
David Carlyon is offline   Reply With Quote
Old 03-14-2019, 11:29 AM   #18
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

One thing i should add is that the action is not setting take fx to 'offline' afterwards.Am i missing something?
For now i just made an action combining this one with disable all take fx for selected items
David Carlyon is offline   Reply With Quote
Old 03-14-2019, 02:06 PM   #19
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by David Carlyon View Post
Is there a quick shortcut to just 'make a new empty take' or is the best way to just 'duplicate take' then run the action?
There are native actions in the Actions list to insert empty takes or duplicate takes (all of which can be assigned to shortcuts), but the script isn't meant to be used with these.

Instead, do your editing as usual, and render to a new take at each step, using native actions such as "Apply track/take FX to items" or "Render items as new take". You can also freeze items by setting the take FX offline, using "Set all take FX offline for selected items".

Only when you want to go back and RE-do some step, will the script become necessary.


Quote:
Originally Posted by David Carlyon View Post
One thing i should add is that the action is not setting take fx to 'offline' afterwards.Am i missing something?
For now i just made an action combining this one with disable all take fx for selected items
The script is *supposed* to automatically set the active takes' FX offline (except bypassed ones, which the script ignores).

If it doesn't, there might be a bug. Could you please give me some more information on what is happening (and before/after screenshots)? Does it only happen with some FX or some items, or all of them?
juliansader is offline   Reply With Quote
Old 03-14-2019, 02:40 PM   #20
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

Hi Julian, i will try and get you some screenshots.
What is happening is i run the action, it renders item(s) into next take lane but all FX stay on.
I re tried it a number of times and still the same.
I am on latest reaper on OSX.
Cheers!
David Carlyon is offline   Reply With Quote
Old 03-15-2019, 05:25 AM   #21
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

I dont know if htis is any help, but i just found that the action
'set all take fx offline for selected item' also doesn't work FIRST TIME
Meaning i have to toggle it on, then off, then on again and it works.
David Carlyon is offline   Reply With Quote
Old 03-15-2019, 08:45 PM   #22
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

this concept should be explored much more by reaper! again it is very nice!
deeb is offline   Reply With Quote
Old 03-16-2019, 04:47 PM   #23
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by deeb View Post
this concept should be explored much more by reaper! again it is very nice!
Thanks! I think in order to perfect this concept, a few missing features for take FX still need to be implemented:
piano roll keyboard not working with MIDI clip with "take FX" instruments
Automation items for take envelopes
can midi input reach a Midi Item FX VSTi?
juliansader is offline   Reply With Quote
Old 03-17-2019, 04:11 AM   #24
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Hi Js!
regarding midi input reaching items i requested this:
https://forum.cockos.com/showthread.php?t=214372

Which by now i think it is the main priority, for both this request and also being able to use controllers and re record midi items like we can do for regular tracks. Makes sense to you?


Automation items for take envelopes <- Would be very nice yes, secondary per now imo.

I had one more: propagate changes on pooled items or takes, so that actions like this or apply fx to new item take, can be propagated if possible automatically to pooled /similar items.

What do you think?

@Devs and other users: this would be something which that i know there is in no other DAW, but Unique and hugely powerful . "freezing/ render infinitely without final compromises". It's a dream!
deeb is offline   Reply With Quote
Old 03-17-2019, 10:48 PM   #25
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

2 more: convert from selected takes track envelopes to take envelopes and vice versa! : )

what do you think?
deeb is offline   Reply With Quote
Old 03-18-2019, 04:36 AM   #26
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

Yes i agree with all the above. To me these improvements would be HUGE.
This is a big part of my workflow. Glad to see ti is importasnt to others, too.
It would be the best 'freeze' system around.

I also agree with Take Env Automation items. There culd be an Auto Item hierarchy, enabling one to propagate from take - item - track and in reverse.

In fact, a tagging system would be good

'propagate to all envelopes (take, item, track) with tag'

This system is already very powerful, but with a few changes it could be in a different league!
David Carlyon is offline   Reply With Quote
Old 03-20-2019, 01:02 PM   #27
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 753
Default

I've been using this custom action for a while:

This custom action that works really well at freezing a midi track to audio items,
yet keeping the original midi item(s) on the track as well (great for harmonic reference in the Midi Editor).
The resulting audio can be moved around and even split.
Unfreezing the audio track then shows the original midi copied to the new locations as well.

The gripe i have sometimes, is when the track gets convoluted (not being able to hide the muted midi in the Arrange View).
But this is the closest thing I have right now to freezing to audio while retaining the midi information.



Ozman is offline   Reply With Quote
Old 03-21-2019, 09:00 AM   #28
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

Quote:
Originally Posted by Ozman View Post
I've been using this custom action for a while:

This custom action that works really well at freezing a midi track to audio items,
yet keeping the original midi item(s) on the track as well (great for harmonic reference in the Midi Editor).
The resulting audio can be moved around and even split.
Unfreezing the audio track then shows the original midi copied to the new locations as well.

The gripe i have sometimes, is when the track gets convoluted (not being able to hide the muted midi in the Arrange View).
But this is the closest thing I have right now to freezing to audio while retaining the midi information.





noob question, but how do you get your selected track to appear on the left hand side? I have tried 'track inspector' but it takes more CPU. Would like a simple way of having selected track on left and master on right.
Cheers
David
David Carlyon is offline   Reply With Quote
Old 03-21-2019, 09:02 AM   #29
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 753
Default

Quote:
Originally Posted by David Carlyon View Post
noob question, but how do you get your selected track to appear on the left hand side? I have tried 'track inspector' but it takes more CPU. Would like a simple way of having selected track on left and master on right.
Cheers
David
Dock the mixer, drag it's name tab to the side to change its position, then resize the pane to fit only the selected track size.
Then save it as a screenset (ctrl + e).
Ozman is offline   Reply With Quote
Old 03-21-2019, 09:46 AM   #30
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

Quote:
Originally Posted by Ozman View Post
Dock the mixer, drag it's name tab to the side to change its position, then resize the pane to fit only the selected track size.
Then save it as a screenset (ctrl + e).
Oh good call! So there ids no way to have it alongside the docked mixer? I suppose not. Still cool though. I need to get more into just using the arrange window
David Carlyon is offline   Reply With Quote
Old 03-21-2019, 10:30 AM   #31
David Carlyon
Human being with feelings
 
Join Date: Feb 2019
Posts: 182
Default

This is what i am getting when trying to run the action btw

...items INTO next take (and toggle freeze active take).lua:83: bad argument #1 to 'GetMediaItemTake_Source' (MediaItem_Take expected)
David Carlyon is offline   Reply With Quote
Old 03-21-2019, 11:19 AM   #32
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 753
Default

Do you have SWS installed?
Also, as stated before... You'll need two takes.
Ozman is offline   Reply With Quote
Old 03-21-2019, 12:07 PM   #33
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by Ozman View Post
But this is the closest thing I have right now to freezing to audio while retaining the midi information.
This custom action keeps the MIDI visible, but unfortunately it doesn't preserve subsequent audio edits, if you need to go back and edit the MIDI.
juliansader is offline   Reply With Quote
Old 03-21-2019, 10:21 PM   #34
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

maybe script could copy the original as a new take at the end of the stack. Working in pairs ... keeping everything : new edits and versions ... something like this.
And so! a script that could , .. explode this pairs into a new take would be cool too : ) .. so many things that could be explored with this one.

Between: i started a new request asking devs to explore more this concept, if anyone interested give a thumb up or suggestions in: https://forum.cockos.com/showthread.php?t=218656
deeb is offline   Reply With Quote
Old 03-22-2019, 06:36 AM   #35
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 753
Default

Quote:
Originally Posted by juliansader View Post
This custom action keeps the MIDI visible, but unfortunately it doesn't preserve subsequent audio edits, if you need to go back and edit the MIDI.
Ok, I see what you're saying.

I'm thinking now that what the devs can do is maybe cache (within a project subfolder [e.g. ".cache"]) the track states (of midi items) when freezing,
and optionally display those items (per track option) when in the midi editor.

And the same for frozen audio items (fx, stretches, volume offsets, envelopes, etc) so that those things are brought back after returning from unfrozen edits.

-----------
Also, this can be used as well for audio that has been analyzed by ARA (e.g. Melodyne).
An option (in addition to the import to project commands) cold be to associate a midi to the audio item (which would be viewable [for reference] within the midi editor.

There's so much more that can be done to bridge the gap between MIDI and audio now.
Ozman is offline   Reply With Quote
Old 03-22-2019, 07:10 AM   #36
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by David Carlyon View Post
This is what i am getting when trying to run the action btw

...items INTO next take (and toggle freeze active take).lua:83: bad argument #1 to 'GetMediaItemTake_Source' (MediaItem_Take expected)
Could you please post some information? (A screenshot of all the take lanes would be most helpful.)
juliansader 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 02:43 PM.


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