Old 06-09-2021, 12:42 PM   #1
Held
Human being with feelings
 
Held's Avatar
 
Join Date: Nov 2019
Posts: 312
Default How to apply track/take FX as new item (not take)?

I frequently render my MIDI items to new items and I would like to improve my workflow.

I created the custom action:
1) Item: Apply track/take FX to items; this creates a new take with the rendered audio
2) Take: Explode takes of items in place; this gives me the audio as its own item

My problem is that the rendered audio is usually longer than the MIDI item and I would like my media item to be extended automatically.

I found the action 'Xenakios/SWS: Reset item length and media offset', but adding it to my custom action doesn't work because the new media item isn't selected after 2)

Does anyone have an idea on how to do this? I'm also okay with writing a script and would appreciate some pointers if it can't be done with custom actions.
Held is online now   Reply With Quote
Old 06-09-2021, 01:39 PM   #2
poulhoi
Human being with feelings
 
Join Date: Apr 2020
Posts: 169
Default

Quote:
Originally Posted by Held View Post
I frequently render my MIDI items to new items and I would like to improve my workflow.

I created the custom action:
1) Item: Apply track/take FX to items; this creates a new take with the rendered audio
2) Take: Explode takes of items in place; this gives me the audio as its own item

My problem is that the rendered audio is usually longer than the MIDI item and I would like my media item to be extended automatically.

I found the action 'Xenakios/SWS: Reset item length and media offset', but adding it to my custom action doesn't work because the new media item isn't selected after 2)

Does anyone have an idea on how to do this? I'm also okay with writing a script and would appreciate some pointers if it can't be done with custom actions.
I would use “crop to active take” as the second action instead.
__________________
My humble repository of scripts
poulhoi is offline   Reply With Quote
Old 06-09-2021, 02:25 PM   #3
Held
Human being with feelings
 
Held's Avatar
 
Join Date: Nov 2019
Posts: 312
Default

Thanks for your suggestion. I would like to keep the original midi, though. I've tried duplicating the item before cropping, but that moves the item.

But that gives me a (not very good) idea on how to implement this as a script.

Remember the left edge of the selected item.

Run the actions to 1) duplicate 2) apply FX 3) crop to active take 4) reset item length

This will give my new item, and I can set the media item position to the original item's position.

I'm going to give this a try tomorrow unless someone comes up with a better idea.
Held is online now   Reply With Quote
Old 06-10-2021, 03:07 AM   #4
Held
Human being with feelings
 
Held's Avatar
 
Join Date: Nov 2019
Posts: 312
Default

I wrote a Lua script that does what I want. It works only on one selected item.

Code:
proj =  reaper.EnumProjects(-1)
selected_items_count = reaper.CountSelectedMediaItems( proj )
if selected_items_count ~= 1 then
  reaper.ShowConsoleMsg("")  --[[ clear consoloe --]]
  reaper.ShowConsoleMsg("Please select exactly on item")  --[[ clear consoloe --]]
  goto exit;
end

action_duplicate = 41295
action_unpool = 41613
action_apply_fx = 40209
action_crop_to_take = 40131
action_reset_length = reaper.NamedCommandLookup("_XENAKIOS_RESETITEMLENMEDOFFS")

reaper.Undo_BeginBlock()

src_item = reaper.GetSelectedMediaItem(proj, 0)
src_item_pos =  reaper.GetMediaItemInfo_Value(src_item, "D_POSITION")

reaper.Main_OnCommand(action_duplicate, 0)
reaper.Main_OnCommand(action_unpool, 0)

new_item = reaper.GetSelectedMediaItem(proj, 0)

reaper.SetMediaItemInfo_Value(new_item, "D_POSITION", src_item_pos)

reaper.Main_OnCommand(action_apply_fx, 0)
reaper.Main_OnCommand(action_crop_to_take, 0)
reaper.Main_OnCommand(action_reset_length, 0)

reaper.Undo_EndBlock("Render Item to New Item")

::exit::
Held is online now   Reply With Quote
Old 06-10-2021, 03:33 AM   #5
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 7,727
Default

You could just create a simple custom action:
Time selection: Set time selection to items
Track: Render selected area of tracks to stereo stem tracks (and mute originals)

There are more similar render actions. Just type in "render mute" into filter box in Actions.
vitalker is online now   Reply With Quote
Old 06-10-2021, 04:22 AM   #6
Held
Human being with feelings
 
Held's Avatar
 
Join Date: Nov 2019
Posts: 312
Default

But I don't want to mute the originals. I mostly use it to do some additional processing in parallel that's easier to do on audio than midi like reversing it or cutting into pieces to emphasize certain sections.
Held is online now   Reply With Quote
Old 06-10-2021, 04:38 AM   #7
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 7,727
Default

Quote:
Originally Posted by Held View Post
But I don't want to mute the originals. I mostly use it to do some additional processing in parallel that's easier to do on audio than midi like reversing it or cutting into pieces to emphasize certain sections.
Then add two more actions:

Track: Go to next track
Track: Mute/unmute tracks
vitalker is online now   Reply With Quote
Old 06-10-2021, 06:59 AM   #8
Held
Human being with feelings
 
Held's Avatar
 
Join Date: Nov 2019
Posts: 312
Default

Thanks, but I'm going to stick with my script for now because it does exactly what I want.

Maybe your approach useful for some else who finds this thread and doesn't want to deal with scripts.
Held is online now   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 03:22 PM.


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