Old 01-01-2012, 11:14 AM   #1
markheath
Human being with feelings
 
Join Date: Oct 2006
Location: Southampton, England
Posts: 191
Default ReaScript Render

Is there a way I can script a Render from ReaScript without popping up the render dialog? I want to be able to specify the output filename and settings in the script, and perform the render without user intervention. I can't see anything in the ReaScript API that does this.

thanks
__________________
YouTube | Blog
markheath is offline   Reply With Quote
Old 03-19-2012, 05:26 PM   #2
Rikharthu
Human being with feelings
 
Join Date: Mar 2012
Posts: 3
Default

I guess there isn't? I would find this feature extremely useful.
Rikharthu is offline   Reply With Quote
Old 06-10-2012, 08:35 AM   #3
Viente
Human being with feelings
 
Viente's Avatar
 
Join Date: Feb 2012
Posts: 1,972
Default

+1
would be cool
Viente is offline   Reply With Quote
Old 12-05-2012, 11:54 PM   #4
Mincong
Human being with feelings
 
Join Date: Dec 2012
Posts: 8
Default

I want to script a Render as well...I want to generate lots of audios automatically... Isn't there any method to do this?
Mincong is offline   Reply With Quote
Old 12-06-2012, 01:33 AM   #5
Mincong
Human being with feelings
 
Join Date: Dec 2012
Posts: 8
Default

Quote:
Originally Posted by markheath View Post
Is there a way I can script a Render from ReaScript without popping up the render dialog? I want to be able to specify the output filename and settings in the script, and perform the render without user intervention. I can't see anything in the ReaScript API that does this.

thanks
It seems that this command: RPR_Main_OnCommand(40788,0) # Render
might help.
I found a helpful resource:
https://stash.reaper.fm/v/14367/Smart...20rendering.py
we can learn something from its code.
Mincong is offline   Reply With Quote
Old 09-01-2017, 02:14 AM   #6
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

Is there still no way to do this via Reascript???
nikolalkc is offline   Reply With Quote
Old 09-01-2017, 05:21 AM   #7
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by nikolalkc View Post
Is there still no way to do this via Reascript???
I don't think so...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 09-01-2017, 07:03 AM   #8
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 338
Default

Where exactly should I post feature request for this kind of functionality?
I really need this.
nikolalkc is offline   Reply With Quote
Old 09-01-2017, 07:41 AM   #9
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Seems you could do it from the command line though.

https://forum.cockos.com/showthread.php?t=147691

And isn't there a way in Lua to pass command line arguments (with os.execute) ?
Didn't try this myself yet.

edit:
Just tried, it basically works.
No way to set the render settings or output filename programatically though it seems (it uses last saved render settings), so doesn't help much probably.

https://i.imgur.com/oB00mW5.gif

Last edited by nofish; 09-01-2017 at 11:13 AM.
nofish is offline   Reply With Quote
Old 01-07-2018, 04:37 AM   #10
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

At least, being able to set a render preset from ReaScript would be already very useful.
X-Raym is offline   Reply With Quote
Old 01-09-2018, 08:57 PM   #11
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Agree.
Sincerely hope we can render through ReaScript.
This feature is so useful (and very COOL)
Moy is offline   Reply With Quote
Old 01-10-2018, 02:03 AM   #12
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

You can't script filename in the render settings but there is wildcards than can satisfy a lot of needs already.
There is also a render Action which doesn't display the popup.
You may succeed what you are looking for with this two tricks.
X-Raym is offline   Reply With Quote
Old 10-28-2018, 05:41 AM   #13
mortalis
Human being with feelings
 
Join Date: Apr 2018
Posts: 10
Default

I've also looked for this functionality.

The only flexibility I found is using
Code:
Main_OnCommand(action_id)
with redering predefined action IDs.

The IDs are in the Actions window (column Command ID). Some of render actions:

- Render project to disk
- Render project, using most recent render settings
- Render project, using most recent render settings, with a new target file name

------------

Also I found AddProjectMarker function which allows to add a named region for the selection.
I wanted to export multiple regions on the same track to different files. So my sequence was:

- open "Render to file" dialog and set all the settings there
- select "Master mix" and "Time selection" at the top
- put "$region" into the "File name" field and press "Save changes"
- then in the script (Python):

Code:
beat1 = 2
beat2 = 10
render_last_action_id = 41824

start = RPR_TimeMap2_beatsToTime(0, 0, beat1-1)[0]
end = RPR_TimeMap2_beatsToTime(0, 0, beat2-1)[0]
RPR_GetSet_LoopTimeRange(True, False, start, end, False)
RPR_AddProjectMarker(0, True, start, end, 'export_file', -1)
RPR_Main_OnCommand(render_last_action_id, 0)
This will convert beats to time in seconds for the selection to export, then add a region with the same bounds as the selection and with the name of the output file, then it executes the "Render project, using most recent render settings" command without opening the Render dialog.

Last edited by mortalis; 10-28-2018 at 08:11 AM.
mortalis is offline   Reply With Quote
Old 10-29-2018, 01:41 AM   #14
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Short answer: Soon.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-29-2018, 07:22 AM   #15
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 336
Default

Quote:
Originally Posted by mespotine View Post
Short answer: Soon.
Soon as in this year, this month, this week, or today? lol
tXShooter is offline   Reply With Quote
Old 10-30-2018, 10:03 AM   #16
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

When it's done

Though I intend, this year...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-30-2018, 12:07 PM   #17
Sju
Human being with feelings
 
Join Date: Jun 2015
Posts: 685
Default

You're working on a smart render script? That'll be really useful! Will it be able to differentiate between stereo and mono tracks, to prevent unnecessary stereo renders? Like there's the tickbox in the Render window to only render tracks with mono media to mono.
Sju is offline   Reply With Quote
Old 10-30-2018, 12:27 PM   #18
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Not script but functions.
You would be able to customize your renderscript with most of the settings availabe in the RenderDialog.

Still working on some details and bugfixes, though. But it's running already...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-30-2018, 02:39 PM   #19
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Looking forward to it!
__________________
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 11-03-2018, 01:49 PM   #20
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
Default

Quote:
Originally Posted by mespotine View Post
Short answer: Soon.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 11-03-2018, 02:59 PM   #21
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Posts: 2,436
Default

Quote:
Originally Posted by mespotine View Post
Not script but functions.
You would be able to customize your renderscript with most of the settings availabe in the RenderDialog.

Still working on some details and bugfixes, though. But it's running already...
Where will you publish it, ReaPack or via forum? Sorry for asking, but this sounds really interesting but I'm not on the forums much but this is something I would definitely use and donate for so I don't want to miss the launch
Breeder is offline   Reply With Quote
Old 11-03-2018, 06:34 PM   #22
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 336
Default

Are these functions going to be .dll / COM object based, directly with Reaper code, or some kind of external modifiers like AHK?
tXShooter is offline   Reply With Quote
Old 11-04-2018, 01:28 PM   #23
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Pure Lua, including months of heavy reverse-engineering of data-structures of a projectfile.

Will be released through the forum and on it's own website. Reapack? Dunno yet, depends on ReaPack-internal-factors I haven't checked for yet.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-04-2018, 01:33 PM   #24
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

@Thonex

That's what I'm looking like for months now
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-04-2018, 04:45 PM   #25
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Posts: 2,436
Default

Quote:
Originally Posted by mespotine View Post
Pure Lua, including months of heavy reverse-engineering of data-structures of a projectfile.

Will be released through the forum and on it's own website. Reapack? Dunno yet, depends on ReaPack-internal-factors I haven't checked for yet.
My deepest condolences, reverse engineering is the hardest, most potent, deadly and equally addictive endeavor. I hope you made it through alive.

It's hard following all the releases without a proper channel. Would be great if Justin&Co finally decided to get someone who's active on the forums and pay him to create newsletter or something
Breeder is offline   Reply With Quote
Old 11-06-2018, 10:19 AM   #26
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Breeder View Post
My deepest condolences, reverse engineering is the hardest, most potent, deadly and equally addictive endeavor. I hope you made it through alive.

It's hard following all the releases without a proper channel. Would be great if Justin&Co finally decided to get someone who's active on the forums and pay him to create newsletter or something
If you're interested and don't know it yet: I publish my reverse-engineering-work including my RE-tools into the thread Reaper-Internals: https://forum.cockos.com/showthread.php?t=207635
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-06-2018, 04:18 PM   #27
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 336
Default

Quote:
Originally Posted by mespotine View Post
When it's done

Though I intend, this year...
FEEED MEEEEE!!!!


If you can get this all accomplished with all of the many other things you've already provided recently, man you are gonna be a hero 'round here!!
tXShooter is offline   Reply With Quote
Old 11-06-2018, 05:06 PM   #28
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by tXShooter View Post
If you can get this all accomplished with all of the many other things you've already provided recently, man you are gonna be a hero 'round here!!
Dusting off my old Superman-cape ^^

Just finishing docs and tweaking things here and there. 30 documentation-chapters to go...


And yes, I like teasing
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-29-2018, 02:25 PM   #29
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 517
Default

Any update? I just dream about rendering with a keystroke...
reapero is offline   Reply With Quote
Old 11-30-2018, 01:38 AM   #30
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Before Christmas.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-30-2018, 02:18 AM   #31
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 517
Default

thanks dude!
reapero is offline   Reply With Quote
Old 11-30-2018, 03:02 PM   #32
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 336
Default

Quote:
Originally Posted by mespotine View Post
Before Christmas.

OH BOY!!
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote
Old 11-30-2018, 10:54 PM   #33
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Quote:
Originally Posted by mespotine View Post
Not script but functions.
You would be able to customize your renderscript with most of the settings availabe in the RenderDialog.

Still working on some details and bugfixes, though. But it's running already...
Sounds amazing, Thanks for doing this!
I wanna give you my deep appreciate <3
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper

Last edited by Moy; 11-30-2018 at 11:00 PM.
Moy is offline   Reply With Quote
Old 12-01-2018, 02:13 AM   #34
Macc
Human being with feelings
 
Join Date: Feb 2017
Posts: 76
Default

This sounds amazing.

I'm a relative n00b to this so forgive me if this isn't in the scope of your work, but if there is any kind of queue capability, pre-roll for automatic/queued renders would be ***outstanding***. The existing render queue is unusable without pre-roll due to random glitches etc that don't occur when rendering manually.

All that aside, thanks for your work, it sounds intense...
Macc is offline   Reply With Quote
Old 12-01-2018, 12:45 PM   #35
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

What do you mean by pre-roll in the context of rendering? That the "playback" starts before the actual rendering during the rendering process?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-03-2018, 04:09 PM   #36
Macc
Human being with feelings
 
Join Date: Feb 2017
Posts: 76
Default

I'm a mastering engineer, so saving all renders until the end of the day when I'm tired is kind of essential

When I use the render queue to render, I get skips/jumps/glitches in the first second or two of some exported files. It's completely random, meaning if I use the render queue I have to recheck all the exported files, and then re-render offending files manually. This is an enormous pain in the arse, so I just don't bother. So I have to sit and export each of the day's projects manually. Urgh.

The problem doesn't happen if I open a project, and play a second or two of each track, and then render through the render dialogue. So presumably it is due to some plugin buffer needing to be filled somewhere, or something similar (I use a lot of item FX, btw, if that matters). BTW the 'delay queued renders...' option has no effect on this.

Therefore if Reaper could 'play' a second or two of each file before beginning the actual export, it might fix the problem. I'm referring to it as pre-roll, but perhaps there's a better term.

I know there's a feature request to this effect on this forum, but it seems to have fallen on deaf ears.

Hope this makes sense. If you could address this it would actually literally improve my daily life immeasurably, and would get you a sizable beer token...
Macc is offline   Reply With Quote
Old 12-03-2018, 04:27 PM   #37
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 336
Default

Quote:
Originally Posted by Macc View Post
I'm a mastering engineer, so saving all renders until the end of the day when I'm tired is kind of essential

When I use the render queue to render, I get skips/jumps/glitches in the first second or two of some exported files. It's completely random, meaning if I use the render queue I have to recheck all the exported files, and then re-render offending files manually. This is an enormous pain in the arse, so I just don't bother. So I have to sit and export each of the day's projects manually. Urgh.

The problem doesn't happen if I open a project, and play a second or two of each track, and then render through the render dialogue. So presumably it is due to some plugin buffer needing to be filled somewhere, or something similar (I use a lot of item FX, btw, if that matters). BTW the 'delay queued renders...' option has no effect on this.

Therefore if Reaper could 'play' a second or two of each file before beginning the actual export, it might fix the problem. I'm referring to it as pre-roll, but perhaps there's a better term.

I know there's a feature request to this effect on this forum, but it seems to have fallen on deaf ears.

Hope this makes sense. If you could address this it would actually literally improve my daily life immeasurably, and would get you a sizable beer token...
Are you talking about that first few seconds of a rendered file's playback where it would seem like the CPU just hasn't caught up to the processing needs of the effects (and other mods like automation) yet, and that wreaks all kinds of havoc on a clean sounding render? And this doesn't happen when you're playing back from within Reaper... just on the output of the render?
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote
Old 12-03-2018, 11:52 PM   #38
Macc
Human being with feelings
 
Join Date: Feb 2017
Posts: 76
Default

- It only occurs in rendered files rendered via the render queue.

- It *may* happen in rendered files where no audio has been played since opening the project, before rendering. I need to check that, but I'm in the habit of flicking through all the audio now (to be safe!).

- Yep, it sounds like the computer 'catching up'. Typically what happens is the first ~1 second is delayed by a tiny amount (there is a small bit of silence that wasn't there before), before the audio jumps back into time where it should be. It 'catches up', if you like.
Macc is offline   Reply With Quote
Old 12-05-2018, 04:50 AM   #39
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

You can try the following test:

Write a script that loads a project that usually causes that problem you encounter and that also runs the action 41824.

The script should look something like this:

Code:
my_project="Projectname_with_path"

reaper.Main_openProject(my_project)
reaper.Main_OnCommand(41824, 0)
you can also try the same with multiple projects:

Code:
my_project1="Projectname1_with_path"
my_project2="Projectname2_with_path"
my_project3="Projectname3_with_path"
my_project4="Projectname4_with_path"
my_project5="Projectname5_with_path"

reaper.Main_openProject(my_project1)
reaper.Main_OnCommand(41824, 0)
reaper.Main_openProject(my_project2)
reaper.Main_OnCommand(41824, 0)
reaper.Main_openProject(my_project3)
reaper.Main_OnCommand(41824, 0)
reaper.Main_openProject(my_project4)
reaper.Main_OnCommand(41824, 0)
reaper.Main_openProject(my_project5)
reaper.Main_OnCommand(41824, 0)
If that renders without any problems, then my render-functions are a solution for you.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-05-2018, 02:08 PM   #40
Macc
Human being with feelings
 
Join Date: Feb 2017
Posts: 76
Default

Thanks ever so much for that - I'm pretty much a scripting n00b but I'll have a shufty.

It occurs to me that I could tuck another action/script in there, that makes it play each item on a certain track for a second or two before doing the render. So open project > play each item for 2 seconds > render using last settings.

Maybe I'll have a look at building an action that does that. Food for thought - thank you!
Macc 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 12:55 PM.


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