Overview
REAPER extensions are DLLs/dylibs that extend REAPER’s functionality. Unlike plugins, extensions:- Run in REAPER’s main process
- Can register custom actions and menus
- Have full access to REAPER’s API
- Can show dockable windows
- Don’t process audio in a plugin chain
IPlugReaperExtension Template
TheIPlugReaperExtension example demonstrates:
- Registering actions in REAPER’s action list
- Creating a dockable UI window
- Using REAPER API functions
- Responding to REAPER state changes
- Adding menu items
Project Structure
Unlike plugins, extensions don’t haveconfig.h with plugin metadata:
config.h
No
PLUG_TYPE, PLUG_CHANNEL_IO, or plugin format defines. Extensions aren’t loaded as plugins.Basic Structure
- Header
- Initialization
- UI Setup
- State Monitoring
IPlugReaperExtension.h
- Inherit from
ReaperExtBase(notPlugin) - Constructor takes
reaper_plugin_info_t* - No
ProcessBlockor audio processing
Creating an Extension
The duplicate script will show a warning about not being able to parse plugin config. This is expected for REAPER extensions.
MyReaperTool::MyReaperTool(reaper_plugin_info_t* pRec)
: ReaperExtBase(pRec)
{
// Import needed API functions
IMPAPI(GetSelectedTrack);
IMPAPI(GetSetMediaTrackInfo);
IMPAPI(SetTrackSelected);
IMPAPI(UpdateArrange);
// Action: Color selected tracks red
auto colorRed = [&]() {
MediaTrack* track = GetSelectedTrack(0, 0);
if (track) {
int color = RGB(255, 0, 0) | 0x1000000; // Custom color flag
GetSetMediaTrackInfo(track, "I_CUSTOMCOLOR", &color);
UpdateArrange();
}
};
// Action: Show track count
auto showTrackCount = [&]() {
int count = CountTracks(0);
char msg[64];
snprintf(msg, sizeof(msg), "Track count: %d", count);
MessageBox(gParent, msg, "Track Info", MB_OK);
};
// Register actions
RegisterAction("MyReaperTool: Color Selected Track Red", colorRed, true);
RegisterAction("MyReaperTool: Show Track Count", showTrackCount, true);
}
// Track functions
IMPAPI(GetTrack);
IMPAPI(GetSelectedTrack);
IMPAPI(InsertTrackAtIndex);
IMPAPI(DeleteTrack);
IMPAPI(SetTrackSelected);
IMPAPI(GetSetMediaTrackInfo);
// Item functions
IMPAPI(GetSelectedMediaItem);
IMPAPI(GetMediaItem);
IMPAPI(GetSetMediaItemInfo);
// Project functions
IMPAPI(GetCurrentProjectInLoadSave);
IMPAPI(EnumProjects);
// UI functions
IMPAPI(UpdateArrange);
IMPAPI(UpdateTimeline);
You must import every REAPER API function you want to use. If you forget
IMPAPI, you’ll get linker errors.mLayoutFunc = [&](IGraphics* pGraphics) {
pGraphics->SetLayoutOnResize(true);
pGraphics->AttachPanelBackground(COLOR_DARK_GRAY);
const IRECT bounds = pGraphics->GetBounds().GetPadded(-10);
// Add controls
pGraphics->AttachControl(
new IVButtonControl(bounds.GetGridCell(0, 4, 1).GetMidVPadded(30),
[&](IControl* pCaller) {
SplashClickActionFunc(pCaller);
colorRed();
}, "Color Red"));
pGraphics->AttachControl(
new IVButtonControl(bounds.GetGridCell(1, 4, 1).GetMidVPadded(30),
[&](IControl* pCaller) {
SplashClickActionFunc(pCaller);
ToggleDocking();
}, "Dock/Undock"));
};
Windows
- Open
.slnin Visual Studio - Build “REAPER Extension” configuration
- Output:
build-win/MyReaperTool.dll - Copy to
C:\Users\[You]\AppData\Roaming\REAPER\UserPlugins\ - Restart REAPER
macOS
- Open
.xcworkspacein Xcode - Build “REAPER Extension” scheme
- Output:
build-mac/MyReaperTool.dylib - Copy to
~/Library/Application Support/REAPER/UserPlugins/ - Restart REAPER
REAPER API Access
Common API Functions
- Tracks
- Items
- Project
- UI Updates
API Documentation
Full REAPER API reference:- https://www.reaper.fm/sdk/reaper_plugin_functions.h
- Search “REAPER API” in REAPER’s help
Action Registration
Action Types
Action Descriptions
Action Naming Convention:
- Start with extension name:
"MyTool: ..." - Use descriptive verbs: Show, Hide, Toggle, Add, Remove
- Keep under 80 characters
- Use title case
Window Docking
- Dock to left/right/bottom of REAPER window
- Float as separate window
- Save dock state with REAPER project
Example Extensions
Track Organizer
Batch Processor
Building
Visual Studio (Windows)
Xcode (macOS)
Troubleshooting
Extension doesn't load in REAPER
Extension doesn't load in REAPER
- Check file is in correct UserPlugins folder
- Restart REAPER
- Check REAPER console (View → Show REAPER console) for errors
- Verify correct architecture (x64 for Windows, Universal for macOS)
Actions don't appear in action list
Actions don't appear in action list
- Verify
RegisterActionwas called in constructor - Check REAPER console for registration errors
- Search for exact extension name in action list
REAPER API function returns null
REAPER API function returns null
- Did you call
IMPAPI(FunctionName)to import it? - Check function signature matches REAPER docs
- Verify REAPER version supports that API
Window doesn't dock properly
Window doesn't dock properly
- Use
SetLayoutOnResize(true)in layout function - Implement proper bounds handling for resize
- Test dock/undock with ToggleDocking()
Next Steps
REAPER API Docs
reaper_plugin_functions.hComplete API reference
REAPER Plugins
Build audio plugins that integrate with REAPER API
IGraphics
Customize extension UI
Examples
Browse more REAPER extensions