View Single Post
Old 06-07-2018, 02:28 PM   #1
Human being with feelings
mespotine's Avatar
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,802
Default Reaper Internals - DevDocs about the secret internal life of Reaper

While learning Reaper to develop stuff for, I started to document things for the others in our project, as well as a resource for myself.
The whole thing is far away from being a proper developer-doc, but you may or may not see use in these docs, so I uploaded them.

Some are work in progress and some are far from finished, while others are more updated versions of the docs available in Cocko's Wiki.

All these docs are creative commons cc-by-nc-sa, so feel free to use them, share them and have fun with it.

See also Tutorials, created by the community

Reaper Api Docs(improved)
This is my own version of the API-docs of Reaper, where I try to add all the information that's missing, like parameter/retval-descriptions, function-descriptions, etc.
I also added the C++-functions and I structured the index to reflect the individual use-case-areas appearing in the API.
This is work in progress, but maybe it's useful for you already.
I wrote a small introduction there on how to use Reaper's defer-function.

Web RC-Api
How to program WebRemoteControl?

Video API
a web-version of Reaper's video-processor-docs

Fileformats and Datastructures
Fileformat Descriptions
descriptions for various config-files of Reaper

Describes the config-file of Cocko's LiceCap-Screenrecording-tool.

Full Actionlist as of Reaper 5.941
The full actionlist as of Reaper 5.941. Includes Menu-only-actions as well(those aren't shown in the actionlist).

Reserved commandids for scripts
This lists all commandids, that are reserved for ReaScripts, separated into the individual sections.
Funfact: About 11997-scripts can be added to each section

Config Variables
The config-variables as used by SNM_GetIntConfigVar(), SNM_SetIntConfigVar(), SNM_GetDoubleConfigVar() and SNM_SetDoubleConfigVar(), as well as the C++-only function get_config_var().
You can set many options, checkboxes and configuration-values with them.
These are fairly complete with only a handful missing(I couldn't trigger them, maybe you can help me with them).

All Config-Variables, that are triggered by actions.
This lists all toggle-actions, who trigger config-variables.
They are documented with values in int/double/string and bitfield.
To know, how to read them, I suggest you to read the Config Variables-docs above.

In Projectfiles as well as in the configfile for render-presets, the render-settings are stored using a string.
In this document, I tried to reverse-engineer and document, how these strings work, how they are built and how to make them work.
Includes all formats, except m4a, as this is Mac-only and I don't have a Mac to document them..
With this, you can build your own render-functions/scripts! I already successfully did that
See the render-codes-ini-file below, that feature all code-segments for fps and resolution of video, mp3, flac, opus and ogg.

Envelope StateChunk
This documents envelope-statechunks quite complete. I also included docs for automation-items.
The automation-item-docs feature both, the docs about how to include one automation-item into your own envelope, as well as the automation-item themselves.
Note: the automation-items themselves are only available in RPP-projectfiles and .ReaperAutoItem-files.

MediaItem StateChunk
My attempt at documenting MediaItem-Statechunks, as the docs in Cocko's Wiki is heavily outdated.
Still work in progress, especially all the MIDI stuff is wrong/incomplete and there are entries I haven't found out yet, what they do.
In parts, it's already helpful, anyway

the state-chunk-entries of Parameter Learning/Modulation/Aliases

misc - child-hwndids for Reaper-windows(incomplete)

Reaper Actions as ini
An ini-file that features all actions with their description from Reaper5.941

This ini-file features all codes that are returned by gfx.getkey() and their ASCII-representation.
That way, you can display, which key is typed. Good to find out easily, which gfx.getkey-code you need now in your script.

reaper-kb.ini - KEY-codes
This ini-file includes all(!) codes and their representation of all keyboard/midi-shortcuts available in Reaper.
Good for analysing, which codes are used in your kb.ini, if you want to display shortcuts in another way, rather than the actions-window-only.
See Fileformat Descriptions above for a full description of reaper-kb.ini

reaper-kb.ini - factory default KEY-codes
The reaper-kb.ini does not include shortcuts, that are factory-default-settings, only custom shortcuts. So I documented the factory-default-ones out and made a handy ini out of it.
See Fileformat Descriptions above for a full description of reaper-kb.ini and in how to work with factory-default-shortcuts

Render codes
The rendercfg-codes as an ini-file, for many formats like DDP, AIF, MP3, FLAC, Video, OPUS and OGG.
The sections are the file-formats (like [OGG] or [FLAC]).
You can find in all sections a key called Renderstring, in which the renderstring-template is stored.
All changeable parts are replaced by [FormatAlterID].
e.g. for OPUS:
Replace the [KBPS] [MODE] [Complexity] with the values of the corresponding keys in the section OPUS.
KBPS_xxx - where xxx is the bitrate-number
MODE_xxx - where xxx is the mode
Complexity_xxx - where xxx is the complexity-number.

So a renderstring with OPUS, Mode:VBR, Bitrate: 24kbps, Complexity:5 would result in this string:

The Render-codes for the Audio-CD-rendering. Works like the render-string-codes above, but is limited to AudioCD. Supports LeadInSilence up to 100 seconds.

Display altered config-variables
If you want to use config-variables but don't know, which one is behind the checkbox of your choice, use this. It will display changes to ReaConsole.
Also prepared for string-variables, which are only available in pre-releases of Reaper, yet.

Display altered configfile-entries
This displays changes in classic-ini-files, eg. reaper.ini. Every time an entry is altered, it will be displayed into the ReaConsole.
Supports only standard ini-files

For monitoring-tools of StateChunks(Project, Item, Envelope, Tracks), head over to the following post:

A LangPack, which displays to the left of the section-location of the text.

HWND-displayer - to get the position and attributes of hwnds

Maybe some of the stuff is helpful for you. If you want to motivate me to add more stuff/complete stuff, you can head over to, where you can donate stuff to our team

Meo Mespotine

Last edited by mespotine; 08-13-2019 at 11:52 AM.
mespotine is offline   Reply With Quote