Thread: beyond.Reaper
View Single Post
Old 03-31-2016, 10:07 PM   #57
beyond
Human being with feelings
 
Join Date: Jun 2007
Location: Palm Beach FL
Posts: 265
Default

Quote:
Originally Posted by mschnell View Post
Hi Beyond.

The questions include:

- I do understand that the external Python program can call any Reaper actions (including those that are provided as scripts within Reaper). Is it possible to transfer all parameters with that call, that are used by the appropriate action. (E.g. when starting a render action Reaper needs to know the destination file type and path, etc).

- Is it possible to dynamically retrieve states of the running Reaper installation such as "Recording" or "Busy doing a rendering action", "Name of the recorded WAV file of track 7" and similar.

- I understand that with Beyond, there is an internal Python program running as a script (provided by Beyond) in Reaper and an external Python program that can be completely done by the "user". Is it necessary / viable / common to enhance the internal Python script according to the project the user has in mind, or should same stay unmodified, being just a unified transfer module ?

Thanks for enlightenment,

-Michael
Yes, any function that is in the Reaper or an extension API can be called without any limits on the parameters, returns or exception handling. In fact, beyond.Reaper lifts many limits on Reaper's internal Python handling, such as the 4MB string limit (especially for Track FX state returns with hefty plugins) that can simply be extended with Reaper.StringLimit = 16 * 1024 ** 2 # for 16MB for example.

You can also use Reaper.Execute(""" Say(l[1], l[2]) """, 11, 22) # To send and execute entire mini scripts (with more complex parameters than 11 and 22, anything Python pickle-able), such as tight, fast loops inside Reaper. So, RemoteControl.py can handle anything.

You have to research the Reaper API and test to see if Reaper supports responding or reporting status when it is busy such as during a render. You may have to check the status of an output file, to see if it is openable, to determine that Reaper is done with it and responsive again. The TCP connection may timeout, if an API call takes too long to return, so you may have to send a mini script to return asynchronously, and wait for completion to reconnect again. beyond.Python makes it quite easy to to do Parallel operations, and there are an abundance of other Python libraries for almost any (non realtime) task.

The best way to learn programming is by getting at least a basic good editor such as Sublime Text, and reading the source code for examples, and running lots of small tests for which Python is ideal. I recommend an interactive approach to development, using Say() to output and explore your progress at every step of the program you are writing. Such approach is preferable to classical breakpoint debugging, since you can put Say() into loops outputting any significant variables and study a list of trends, rather than wasting time and your focus tracing things at every irrelevant step. Once you discover how things should work, then you can remove or comment out such feedback and proceed to the next challenge.

Python is a good language for automating and conducting research in pre-existing, high end tools from 3D renderers to AI systems. C++ is the best programming language without any limits, but it takes longer to pick up momentum learning it and building up your own high level methods before you build usable applications.
beyond is offline   Reply With Quote