Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 06-07-2018, 02:28 PM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default Reaper Internals - DevDocs & Tutorials about the secret internal life of Reaper

While learning Reaper to develop stuff for Ultraschall.fm, 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

API-Docs:
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.

https://forum.cockos.com/showpost.ph...2&postcount=21
I wrote a small introduction there on how to use Reaper's defer-function.
More detailinfo: https://forum.cockos.com/showpost.ph...99&postcount=7

Thoughts on require vs dofile in Lua

Tutorial for HiDPI/Retina in gfx-scripts

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

LiceCap.ini-doc
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.


Render-CFG-Codes
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.


StateChunk-docs
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
https://github.com/Ultraschall/ultra...s-ChildIDs.txt - child-hwndids for Reaper-windows(incomplete)
the difference between dofile and require
when you want to build your own Lua-function-library

Helpful-Ini-Files
Reaper Actions as ini
An ini-file that features all actions with their description from Reaper5.941
cmdid=description



gfx.getkey()-codes
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:
Code:
Renderstring=U2dnTwAA[KBPS][MODE][Complexity]AAAA==
Replace the [KBPS] [MODE] [Complexity] with the values of the corresponding keys in the section OPUS.
e.g.:
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:
Code:
U2dnTwAAwEEABQAAAA==
MODE_VBR=A
KBPS_24=wEE
Complexity_5=BQ


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.

Tools
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
[section]
key=value

For monitoring-tools of StateChunks(Project, Item, Envelope, Tracks), head over to the following post: https://forum.cockos.com/showpost.ph...0&postcount=65

A LangPack, which displays to the left of the section-location of the text.
https://raw.githubusercontent.com/Ul...ReaperLangPack

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 http://ultraschall.fm/danke/, where you can donate stuff to our team

Cheers
Meo-Ada Mespotine

Last edited by Meo-Ada Mespotine; 01-04-2022 at 08:18 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-07-2018, 04:06 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

What an impressive collection and intense reverse engineering work !
Ill have to take a look :P



Thanks for sharing all that


Not that other doc compilation can be found of ReaTeam Doc repository. It contains formatted doc like Web Interface, REAPER as CLI paramters etc.. I added this infos here just as a complement.


EDIT: very nice how you decode the render config settings !!

Last edited by X-Raym; 06-07-2018 at 04:14 PM.
X-Raym is offline   Reply With Quote
Old 06-07-2018, 04:29 PM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by X-Raym View Post
Not that other doc compilation can be found of ReaTeam Doc repository. It contains formatted doc like Web Interface, REAPER as CLI paramters etc.. I added this infos here just as a complement.
https://github.com/ReaTeam/Doc

Meo-Ada Mespotine is offline   Reply With Quote
Old 06-08-2018, 01:13 AM   #4
cyrano
Human being with feelings
 
cyrano's Avatar
 
Join Date: Jun 2011
Location: Belgium
Posts: 5,246
Default

Wow!

Great work. Thanks for sharing, Mesopotine.
__________________
In a time of deceit telling the truth is a revolutionary act.
George Orwell
cyrano is offline   Reply With Quote
Old 06-09-2018, 05:06 AM   #5
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Indeed, thanks a lot man! Will trying to digest all that info
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 06-12-2018, 09:11 AM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Thanks

Will add more info, like TrackStateChunks and a first draft of how a rpp-projectfile works, but hadn't time to write that stuff down properly, yet.
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-19-2019, 01:54 PM   #7
ChuckkH
Human being with feelings
 
Join Date: Feb 2019
Posts: 41
Default

I don't want to crowd your thread, but Mespotine, you are a saint! Thank you for all of this!
ChuckkH is offline   Reply With Quote
Old 02-27-2019, 10:20 AM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Updated docs to Reaper 5.971(including the new fantastic Video-Processor-docs!), SWS 2.10.0.1, JS-extension-plugin 0.971 and ReaPack.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-09-2019, 05:03 AM   #9
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Updated Reaper-Docs to 5.972 and Ultraschall-API 4.00 beta 2.73
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-22-2019, 06:11 AM   #10
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Official docs by Cockos:
EEL2 reference manual
JSFX-Reference-manual
Theme-Development(Walter)
Custom Mousecursors
Extensions SDK
Extensions SDK for VST
OSC in Reaper
Langpack translation of Reaper
http://cockos.com/wdl/ - WDL for Reaper(helper functions for your extension-plugin)
https://www.reaper.fm/sdk/reapeaks.txt specs for the reapeaks-files
How to add support for embedded GUIs in your VST-plugin


As there are so many great tutorials done by the community, I should add them here as well:

Embrace everything by Kenny Gioia

programming in general:
https://forum.cockos.com/showthread.php?t=275747 - collection best practices
https://forum.cockos.com/showthread.php?t=275831 - discussion for optimizing ReaScript-code(for advanced scripters)

How to start programming ReaScripts:
https://www.extremraym.com/en/series...ipt-beginners/ X-Raym's tutorial-series

Stretch Markers ReaScript tutorial by X-Raym

How2Send SysEx-Messages from script

Python and Reaper by dimentorium

How to write JSFX-Plugins:
https://wiki.cockos.com/wiki/index.p...sonic_Tutorial by Loser
https://forum.cockos.com/showpost.ph...3&postcount=90 how do jsfx work internally by mschnell
https://forum.cockos.com/showthread....31#post2357031 - Video tutorial series by leafac
https://forum.cockos.com/showthread.php?t=270821 - advanced JSFX programming by Jack461

About bitwise operators(&& || OR AND)

GUI/gfx-related:
https://forum.cockos.com/showthread.php?t=176662 lokasenna's "how to create a gui"-tutorial
https://forum.cockos.com/showthread.php?t=161557 useful gfx-snippets by spk77

C/C++ Extension Plugins related:
How to create a multiplatform extensionplugin? by Argitoth
Hello World-Demo-Plugin by Chris Fillion
Hello World-extension-template with VSCode+CMake by en5ca
How to make embeddable Plugins - thread


Theming with Walter:
https://forum.cockos.com/showthread.php?t=69767 Tutorial by WhiteTie

ReaperTheme colors by Amagalma

Accessibility-ressources, listed by Scottsdale:
https://forums.cockos.com/showpost.p...45&postcount=8

Statechunk-documentation

Lua:
https://www.youtube.com/watch?v=S4eNl1rA1Ns - Learn Lua in one hour (not from the community, but I learned Lua with Tyler Neylon's great tutorial)

If you know more, please leave a link in this thread
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 02-24-2024 at 03:57 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-11-2019, 04:14 PM   #11
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Suggested adjustments for your config variables doc:

rendercfg is a string rather than an int.
Same for g_config_project, which Justin pointed out here.

Last edited by nofish; 04-11-2019 at 04:49 PM.
nofish is offline   Reply With Quote
Old 08-11-2019, 03:50 PM   #12
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Nitpick:
The link on first page "Display altered config-variables" points to the ultraschall_Display-Altered-ConfigFile-Entries.lua script.
It should rather point to this one I suppose?
https://github.com/Ultraschall/ultra...onfig-Vars.lua

Last edited by nofish; 08-11-2019 at 04:12 PM.
nofish is offline   Reply With Quote
Old 08-12-2019, 08:54 AM   #13
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Ooops...thanks, will fix this...


Edit: where did you find it?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 08-12-2019 at 08:59 AM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-12-2019, 01:42 PM   #14
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

I mean this in the opening post of this thread:



Just a minor thing, but I stumbled upon it yesterday when I wanted to link to it here so I thought I'd mention it...

Last edited by nofish; 08-12-2019 at 01:53 PM.
nofish is offline   Reply With Quote
Old 08-13-2019, 11:51 AM   #15
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Ah, ok. Will update that. Thanx
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-29-2019, 08:49 AM   #16
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Update Reaperdocs to Reaper 5.983 and JS-extension 0.990.

Also added tons of new information to the ConfigVars-docs and added the recently added pre-release-ones as well.
If a configvar is a ProjectDefault-related one, it is now documented. That way you can alter now ProjectDefaults, at least those, who are available as "live-editable"-ConfigVars.
Spent two days on that rework
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.