[REAPER] How to play with Reascript in Python

Introduction

The programming language "Python" can be used for the function "Reascript" that allows you to write your own scripts in the composition software (≒ DAW) REAPER. This time, I will describe a simple procedure and test code regarding the environment construction method. (Since there are few Japanese translation articles related to this, I hope it will help those who are interested.)

environment

Windows10 64bit REAPER v5.27 64bit

1. Install Python

Download and install the installer at the URL below. https://www.python.org/downloads/

※important point

If you are using the 64-bit version of REAPER, an error will occur in the future process (** step 3 **) if you do not prepare the 64-bit version of Python.

2. Load Python "xx" .dll into REAPER

The above file name is strange, but "xx" in "Python" xx ".dll" is the version name. In my case, the version of Python I installed was 3.6.1, so it's named "Python36.dll".

2-1. Get the path of Python "xx" .dll

From now on, in order to load "Python36.dll" into REAPER, we need to know its path. This location will vary depending on where you installed step 1. If you don't know, you can find it by searching for "Python" xx ".dll" in Explorer.

By the way, the atmosphere of the folder where "Python36.dll" was placed was like this. (There is "Python3.dll" in the same folder, but please note that this is not used.) キャプチャ.PNG

2-2. Load into REAPER

Display the preferences. ctrl + pOr from the menu baroptions > preferenecs キャプチャ2.PNG

Set the following 3 items in "ReaScript". Make settings and describe at the bottom of the screen

Python: No compatible version ofPython was found.

But

Python: python"xx".dll is installed.

If it changes, the reading is successful.

Enable Python for use with ReaScript Check the left side Custom path to Python dll directory: Press `Browse ...` on the far right and specify the path obtained in step 2-1. Forse ReaScript to use specific Python dll: Enter "Python" xx ".dll" on the right side

キャプチャ4.PNG

What do you think. If the display changes like the yellow highlight in the image, it means that the reading is successful, so press OK and restart REAPER.

3. Actually create a script

Create a new script file from the action edit screen and edit the script from the editor that appears.

From the menu bar `Actions> Show action list ...` キャプチャ5.PNG

Click the active button, `New ...` in the "ReaScript" section キャプチャ6.PNG

In the "Files of type" section, make sure that REAPER supports the extension **. Py **. If **. Py ** is not displayed here, it is possible that you have installed a different version or loaded a different dll file in step 1. キャプチャ8.PNG

Enter an appropriate file name, and be sure to enter the extension **. Py ** after it. If it's just the file name,

Extension not supported:""

Please note that you will be angry with "Do not support such extensions (blanks)!". Press Save and you will see a script editor like this. キャプチャ.PNG

In this post, I will omit the explanation about the specific notation method, but If you copy and paste the code below and press Ctrl + S (save), a message box or console will appear and display" Hello World! ".

test.py


RPR_ClearConsole()

str = "Hello World!"

RPR_ShowMessageBox(str, "title", 0 )
RPR_ShowConsoleMsg(str)

Summary

What did you think.

I myself have just started studying programming, In the future, I would like to use Python to make sounds and work on machine learning.

References

Titles omitted.

"Python 3.4 Creating a Windows 7-64bit environment (for financial time series analysis)" by leihcrev http://qiita.com/leihcrev/items/4971eee4e657be953895 「REASCRIPT API — DOCUMENTATION」 https://www.extremraym.com/cloud/reascript-doc/ 「REAPER-ReaScript」 http://www.reaper.fm/sdk/reascript/reascript.php#reascript_basic

Recommended Posts

[REAPER] How to play with Reascript in Python
How to work with BigQuery in Python
How to use tkinter with python in pyenv
How to develop in Python
How to convert / restore a string with [] in python
How to do hash calculation with salt in Python
Explain in detail how to make sounds with python
How to run tests in bulk with Python unittest
[Python] How to do PCA in Python
Python: How to use async with
How to collect images in Python
How to use SQLite in Python
How to get started with Python
How to use Mysql in python
How to wrap C in Python
How to use ChemSpider in Python
How to use FTP with Python
How to use PubChem in Python
How to calculate date with python
How to handle Japanese in Python
How to extract any appointment in Google Calendar with Python
[Python] How to play with class variables with decorator and metaclass
How to log in to AtCoder with Python and submit automatically
Play with 2016-Python
Try logging in to qiita with Python
How to access environment variables in Python
How to dynamically define variables in Python
How to do R chartr () in Python
[Itertools.permutations] How to put permutations in Python
Fractal to make and play with Python
How to get a stacktrace in python
How to display multiplication table in python
How to extract polygon area in Python
How to do portmanteau test with python
I want to play with aws with python
How to check opencv version in python
How to display python Japanese with lolipop
How to switch python versions in cloud9
How to adjust image contrast in Python
How to use __slots__ in Python class
How to dynamically zero pad in Python
How to enter Japanese with Python curses
To work with timestamp stations in Python
How to use regular expressions in Python
[Python] How to deal with module errors
How to display Hello world in python
How to use is and == in Python
How to write Ruby to_s in Python
How to install python3 with docker centos
How to deal with python installation error in pyenv (BUILD FAILED)
How to not escape Japanese when dealing with json in python
How to create a heatmap with an arbitrary domain in Python
How to use python put in pyenv on macOS with PyCall
[ROS2] How to play a bag file with python format launch
How to display legend marks in one with Python 2D plot
How to calculate "xx time" in one shot with Python timedelta
How to upload with Heroku, Flask, Python, Git (4)
How to deal with memory leaks in matplotlib.pyplot
How to use the C library in Python
How to read a CSV file with Python 2/3
How to receive command line arguments in Python