Hi everyone! Long time lurker, first time poster.
https://github.com/0xf0f/reaper-api
Here you can find REAPER and SWS API files for both Lua and Python with documentation and descriptive parameter names.
They are plug-n-play and can be used with existing projects seamlessly.
The main benefit of this is to make the API quicker and easier to work with in IDEs.
For example in PyCharm (Free Community Edition):
Or in IntelliJ IDEA (Free Community Edition) with the EmmyLua plugin (also available for PyCharm):
Instructions for Python:
- Place reaper_python.py and sws_python.py in your project folder and make sure to do 'from reaper_python import *' or 'from sws_python import *'. sws_python also imports everything in reaper_python so you don't need to do both.
NOTE: The Python files are missing RPR_defer, RPR_atexit and RPR_runloop as these were not included in the original API files either.
Instructions for Lua
- Place reaper.lua and gfx.lua in your project folder and in [Reaper Installation Folder]\lua, then make sure to import both as modules.
- If you'd like to forego placing reaper.lua and gfx.lua in [Reaper Installation Folder]\lua, you can add the following code to the top of your script:
Code:
package.path = package.path .. ';' .. debug.getinfo(1).source:match [[^@?(.*[\/])[^\/]-$]] .. "?.lua"
(With credit to Heda, Spk77 and X-Raym -
https://github.com/ReaTeam/ReaScript...e%20script.lua)
This will also allow you to import other lua files in the same directory without having to place them in [Reaper Installation Folder]\lua
NOTE: Using reaper.lua and gfx.lua will incur an additional minor overhead as all API access will have to go through an extra layer of processing. You should remove or comment out `reaper = require 'reaper'` and `gfx = require 'gfx'` for release.
IDEs
If you'd like to use PyCharm or IntelliJ IDEA here are the download links. They're free! (select 'Community' on the right)
https://www.jetbrains.com/pycharm/do...ection=windows
https://www.jetbrains.com/idea/downl...ection=windows
Additional instructions:
By default PyCharm and IDEA are intended to primarily handle Python and Java, respectively. You can add Lua support by installing an additional plugin. I use EmmyLua. You can install this by going to File -> Settings -> Plugins -> Browse Repositories and typing 'EmmyLua' in the search box.
Also check out:
Breeder's ReaSyntax for Sublime Text (Now with Lua support)
https://forum.cockos.com/showthread.php?t=141221
X-Raym's Syntax Highlighting for Notepad++
https://forum.cockos.com/showthread....83#post1293983
https://forum.cockos.com/showthread.php?t=132924
Spk77's EEL language file for Notepad++
https://forum.cockos.com/showthread.php?t=173434
Michael Ellis' Lua Snippets for Atom
https://forum.cockos.com/showthread.php?t=173434