Let’s learn scripting in REAPER Ep02: Functions, Arguments, Returns & Variables
Channel: IDDQD Sound
Date: 2021-07-05

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: https://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: https://www.youtube.com/channel/UC_R-6HcHW5V9_FlZe30tnGA

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

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

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

 You can donate to me & Leandro here:
 Donations ➡️   https://www.buymeacoffee.com/iddqdsound
                    ➡️   https://www.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