Old 08-03-2020, 08:24 AM   #1
Human being with feelings
Join Date: Jul 2020
Posts: 5
Default Automatically record multi-track and export with python API

Hello Pros,

I have a 16 input audio interface. I can used Reaper to get multiple .WAV file from each channel.

However, I would like to use python to automate this process for every 10 seconds.

As by searching save, export, record from the API manual, I found onRecord, saveproject. I am confused which function can help me the most.

Do you have some idea which Function I should read about?

Thank you!
WalkerC is offline   Reply With Quote
Old 08-06-2020, 10:59 AM   #2
Human being with feelings
Join Date: May 2020
Posts: 92

The little script below should help you out, since it shows how to record over a period of time and then have the script stop recording and save the project when the allotted time has passed.

#loops through and stops the recording when the time that has passed is greater than the seconds you want to wait
def wait():
    curTime = RPR_time_precise() - startTime

    if curTime >= seconds:
        RPR_CSurf_OnStop() #stops the recording and brings edit cursor back to the beginning of the new file

        RPR_Main_SaveProject(0, False) #saves the project after recording is done

        RPR_defer("wait()") #keeps looping through the function

RPR_CSurf_OnRecord() #starts the recording

startTime = RPR_time_precise() #time the script starts
seconds = 10 #the amount of seconds you want the script to record for

wait() #keeps the script running in the background until the time is up

For exporting everything, you are going to have to use the stuff below to set the parameters that you want and export them:

RPR_GetSetProjectInfo_String(project, desc, valuestrNeedBig, is_set) #use to set various export parameters

#use one of these to initiate the export - first one doesn't close the export window when complete, second one does
# RPR_Main_OnCommand(41824, 0) #File: Render project, using the most recent render settings
RPR_Main_OnCommand(42230, 0) #File: Render project, using the most recent render settings, auto-close render dialog
jkooks is online now   Reply With Quote

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 10:25 AM.

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