View Single Post
Old 11-10-2019, 12:55 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by d.vyd View Post
I have a few questions about Python scripting in Reaper:

1. Is it possible to access Reaper functionality through a Python library (e.g. "import reaper") instead of through Reaper's GUI?

2. How can I get a list of VSTs known by Reaper (through the directories I set previously in the GUI)?

3. Is TrackFX_AddByName the correct way to add a new track with VST? How does it look called via Python?

4. For VSTs like Reaktor, how can I load an ensemble/patch after loading the main VST? Can I access Reaktor's file menus via Reaper?

5. How can I get a list of a particular VST's parameters (controls), their current values, and their minimum and maximum acceptable values?

6. Is RPR_MIDI_InsertNote the correct way to add a note to a track? How does it look called via Python?

7. How can I render all current tracks to a stereo WAV file?
I don't program with Python ReaScript anymore, so I can't give code examples.

1) No, Reaper does not work as a library usable from external programs. The Reaper process must be running and in the default ReaScript implementation the scripts must be run inside Reaper itself.

2) You may be able to do that by parsing the contents of the ini-files where the plugin scan results have been written in.

3) TrackFX_AddByName adds the effect to an existing track, it doesn't create new tracks for you.

4) Support for dealing with plugin presets is poor in ReaScript. Plugin menus etc are not accessible by standard ReaScript code.

5) TrackFX_GetNumParams, TrackFX_GetParamNormalized to enumerate the parameters and their current normalized values. TrackFX_GetParam may return information about the minimum and maximum values of a parameter, but it doesn't work with all plugins/formats.

6) RPR_MIDI_InsertNote is used to add a note to takes, not tracks. You need to have previously created MIDI media items and takes in them for that to work.

7) You can set the render file name etc with GetSetProjectInfo_String and then call the action "File: Render project, using the most recent render settings, auto-close render dialog" from the script. There is no official "easy" API to render projects, but the method explained should work.
__________________
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