Skip to content

Instantly share code, notes, and snippets.

@koaps
Last active December 11, 2023 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koaps/851e9550fd915d04d0a1a514f0e516b9 to your computer and use it in GitHub Desktop.
Save koaps/851e9550fd915d04d0a1a514f0e516b9 to your computer and use it in GitHub Desktop.
Reapy in Pyenv
# Install pyenv (OSX) - https://github.com/pyenv/pyenv
brew install pyenv
# Install Python build requirements
brew install openssl readline sqlite3 xz zlib tcl-tk
# Install python 3.12.1
PYTHON_CONFIGURE_OPTS="--disable-ipv6 --enable-optimizations --enable-shared" pyenv install 3.12.1
# Set global version
pyenv global 3.12.1
# Update pip
pip install --upgrade pip
# Install Reapy
pip install python-reapy
# Enable python ReaScripts in Reaper
* Under Preferences -> Plug-ins -> ReaScript
* Check the Enable Python box
* Change the Python dll directory to `$HOME/.pyenv/versions/3.12.1/lib`
* Click Browse to make sure it opens the dir with the `libpython3.12.dylib`
* Put `libpython3.12.dylib` in the Force to use specific Python box
* You should see `libpython3.12.dylib is installed.` under the Enable Python checkbox
# Create a custom action under show action list..
* Click New action..
* Choose New ReaScript
* Change File type to python and make a file called `enable_dist_api.py`
* Put the follow code in the window
```
import reapy
reapy.config.enable_dist_api()
```
* Click the run button (should get a confirmation popup and asked to restart Reaper)
# Restart Reaper
# Try the test script below
from reapy import reascript_api as RPR
RPR.GetCursorPosition()
RPR.SetEditCurPos(1, True, True)
RPR.GetCursorPosition()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment