Lua in REAPER
I first got introduced to Lua a few years ago while messing around with a monome norns. At the time, I was just downloading Lua scripts that others had made, but I found myself really interested in reading through the code and inspired by how accessible the norns was as a platform for creating new instruments and effects. The simplicity of the language combined with its power to transform hardware into entirely new sonic tools fascinated me, even though I wasn’t writing my own scripts yet.
For years, Logic has been my go-to for general sound design work, but when it comes to certain media, like gaming, REAPER has some of the best functionality and extensibility. Scripting in REAPER with Lua has transformed the way I think about the day to day process when working with audio.
Multi-DAW
In general I feel like most DAWs can do basically everything at this point. There are some that have better video compatibility, or rendering options, etc, but in general it’s clear that different industries use different DAWs often because of the history and culture in those fields rather than just the specific functionality. Switching between DAWs can help immensely with collaboration, but often feels like you’re relearning the same concepts wrapped in different interfaces and workflows. Each DAW has its own quirks, keyboard shortcuts, and ways of organizing projects. The cognitive load of switching between them can slow you down significantly when you’re in the middle of a creative process. For game audio specifically, there’s the addition of middleware and game engines – each time a new context switch.
Lua Scripting in REAPER
What makes REAPER stand out for game audio work, besides its tight integration with tools like FMOD, is its extensive scripting capabilities. While many DAWs offer some form of macro configuration, REAPER’s implementation of Lua scripting is particularly powerful and accessible. It allows you to automate repetitive tasks, create custom tools, bridge with other platforms, and essentially reshape the DAW to match your ideal workflow rather than adapting to someone else’s vision of how you should work.
The beauty of Lua is its simplicity and readability. I’m not an experienced programmer, but the learning curve is manageable, and the results are immediately impactful to my daily work.
Creating an Orchestral Template in Lua
As a proof of concept, I recently challenged myself to recreate my Logic orchestral template in REAPER using Lua. This template had evolved over several years in Logic, representing small optimizations and workflow improvements.
I wrote a Lua script that builds the entire template from scratch. In less than a day, I had a working script that:
- Creates a structured folder hierarchy for different instrument groups (Strings, Brass, Woodwinds, etc.)
- Sets up submixes and routing for each section
- Configures stem outputs for easier delivery to middleware
- Adds utility tracks like reference audio and pink noise
- Applies appropriate color coding for visual organization
- Configures metronome routing and project settings
The script executes in seconds, creating a project structure that would take hours to set up manually the first time, and additional time to tune to a specific project. More importantly, it’s consistent every time - no forgetting a send or misconfiguring a track.
Lua for Audio Workflows
Lua offers several unique advantages for my work, and potentially in other audio fields more generally:
-
Reproducibility: Every project can start from an identical template, ensuring consistency across your work.
-
Version Control: Unlike DAW templates that are essentially black boxes, script-based templates can be versioned, commented, and iteratively improved. You can track changes over time and even branch off specialized templates for different types of projects.
-
Flexibility: Need to make a change to your template structure? Just update the script once rather than manually adjusting dozens of existing projects.
-
Knowledge Sharing: Scripts are easier to share and explain to collaborators than trying to walk someone through a complex DAW template verbally.
-
Cross-Platform Compatibility: Scripts work across all platforms, making collaboration smoother.
Extending Beyond Templates
While creating my template was my first custom lua script for reaper, the potential applications for scripting new workflows are pretty well documented. The classic ones I’ve known of include:
- Batch processing audio assets for game implementation
- Creating custom audio analysis tools specific to game requirements
- Automating the export process to middleware like Wwise or FMOD
- Building specialized editing interfaces for dialogue, foley, or ambience work
- Handling repetitive and tedious metadata tasks
Version Control and Documentation
One aspect of scripting that I’ve found particularly valuable is the ability to use proper version control. Hopefully one day version control systems can exist for designers with the same ubiquity as they do for devs. Or maybe they already do!
For personal organization, I also keep a consolidated folder of scripts in Obsidian, with notes about how and when to use each one. This text-based approach integrates really well with my existing day to day work and makes everything searchable.
Next Steps
My current exploration is focused on building more integrated workflows between REAPER and Wwise through their respective APIs. The goal is to create a more seamless pipeline from sound creation to game implementation, reducing the friction that typically exists between these environments.
Currently working on scripts that:
- Tag regions in REAPER and have them automatically create corresponding events in Wwise
- Configure parameters in REAPER and have them reflected in Wwise’s RTPCs
- Test game audio behaviors directly from within your DAW environment
Assists from continue.dev
Another approach that has significantly accelerated my Lua development is using AI-assisted coding tools. I’ll open my .lua files (or .scd files for SuperCollider, or even .maxpatch files) in VSCodium with continue.dev connected to my openwebui or ollama instance. This setup acts as a real-time coding assistant that checks my code for correctness and provides suggestions for refining existing features or adding new ones I hadn’t considered.
This approach has been particularly helpful when starting a new script. Like “draft the high level organization for a krell patch in supercollider”. It’s awesome to just be able to focus on creative implementation rather than boilerplate setup.
Give it a go
I’ll be sharing more of my scripts on GitHub in the future. What started as curiosity about Lua scripts on the monome norns has evolved into an essential part of the way I think about audio design – one that continues to open new possibilities for creating and implementing audio efficiently and creatively.