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 & 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










