Let’s learn scripting in REAPER Ep02: Functions, Arguments, Returns & Variables @IDDQDSound
Let’s learn scripting in REAPER Ep02: Functions, Arguments, Returns & Variables  @IDDQDSound
Uploaded July 2021 | Updated September 2026, 3 days ago
Let’s learn scripting in REAPER Ep02: Functions, Arguments, Returns & Variables

In Episode 02, we are talking about lua functions, their arguments and returns, and different types of data (integers, numbers, strings, boolean, object)

Join us Every Tuesday, 1.30pm EST (10.30am PT, 5.30pm GMT) for live scripting tutorials. This is the upcoming one: youtu.be/WR8PtyfLAVc

Joins us on starting this Wednesday, 1.30pm EST (10.30am PT, 5.30pm GMT) for another special live stream on Leandro's channel: youtube.com/channel/UC_R-6HcHW5V9_FlZe30tnGA

LINKS:
This week's blog post: iddqdsound.com/post/let-s-learn-scripting-in-reaper-ep02-functions-arguments-returns-variables
Leandro Facchinetti’s channel: youtube.com/channel/UC_R-6HcHW5V9_FlZe30tnGA /
Leafac Repository: github.com/leafac/reaper

Documentation:
REAPER API: https://www.reaper.fm/sdk/reascript/reascripthelp.html
XRaym API: extremraym.com/cloud/reascript-doc

For beginners:
XRaym Repository (tons of micro-scripts to use and learn from): github.com/X-Raym/REAPER-ReaScripts
For Programmers:
Learn X in Y minutes (Where X=Lua): learnxinyminutes.com/docs/lua
Programming in Lua: lua.org/pil

You can donate to me & Leandro here:
Donations ➡️ buymeacoffee.com/iddqdsound
➡️ patreon.com/leafac

Chapters:
0:00 Intro & Recap
0:20 Episode 02 Breakdown
0:34 1.1 What's a Function?
1:20 1.2 What are arguments & returns?
2:21 1.3 Two ways to call functions
3:50 2.1 Example 1: GetCursorPosition
5:07 2.2 Defining function returns as variables
5:39 2.3 Using ShowConsoleMsg as a debugging tool
7:37 2.4 Moving Edit Cursor using SetEditCurPos
11:29 3.1 Example 2: GetFXEnvelope
11:58 3.2 Integer Arguments & Index IDs
14:03 3.3 Using GetSelectedTrack
16:12 4.1 Local vs. Global Variables
17:26 Episode Summary & Review (TL;DR version)
19:29 Outro, Homework & Livestream Tease
Let’s learn scripting in REAPER Ep02: Functions, Arguments, Returns & VariablesVertical Background Zebra Shading (1-min REAPER Tips) | #shortsMapping Drum Kits & Keyswitches to Piano Roll (Rapid-Fire Reaper Tutorials Ep42)De-Cluttering Big Projects with Track Visibility Actions (Rapid-Fire REAPER Tutorials Ep87)Geeking out with Schwa (feat. Leafac & Tale)How to do Audio Tutorials (Episode 1: Setting up your DAW & OBS)If Waves Plugins was founded in 1552 | #shortsGeeking out with Justin Frankel (with Leandro Facchinetti & Danerius)Optimizing Zooming defaults in REAPER w/ Hotkeys & Mouse Mods (Rapid-fire Reaper Tutorials Ep66)1-min REAPER Tips: Taking Notes with SWS | #shorts1-min REAPER Tips: Triggering MIDI Drums with a practice pad | #shortsChanging REAPERs Editing Behaviour with Hotkeys (Rapid-fire REAPER Tutorials Ep70)
IDDQD Sound |

Let’s learn scripting in REAPER Ep02: Functions, Arguments, Returns & Variables

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER