Posted on

Why should you code Reascript?

Yesterday we covered a few reasons why you should start coding in general.

Today we’re going to cover the 2nd part of that topic: Why should you code Reascript?

Or even better…

Why Reascript is the perfect first project for audio people who can’t code

Let’s set the scene – you work in audio (or with audio people).  You don’t know how to program anything but you’ve wanted to learn.  You’re probably afraid you can’t make anything worthwhile, you don’t have any ideas, or what you write might not even work.  Worst case, you get frustrated and want to throw your computer across the room.

But there’s still this… what if I could?

Cockos has done you a service – as Reascript is right up your alley.  Yes, you specifically.  I’m not kidding, this was literally made for you.  Here’s why:

1. It’s a niche tool for a niche software

The box you’re working in to learn how to create a Reascript is incredibly small.  Reaper itself (currently) does not have the lion’s share of the DAW market.  This means two things:

  • You can only do so much
    Reaper itself is an audio program.  Reascript works with Reaper – so the amount of gigantic projects you can dream up is limited.  This gives you a great starting box, where you can do something effective yet also small.
  • The pressure to “make something cool” is smaller
    Most people making Reascripts are individuals who simply share them online.  There’s no major sales market (yet) for this work.  Instead of being tempted to make the next big thing, you can be tempted to simply make a thing that works for you.

2. You can program a script in multiple languages

Reascripts are coded in one of 4 languages:

  • C/C++
  • EEL (A language specific for Reaper, to my understanding)
  • Lua
  • Python

By making tools available in 4 different languages, Cockos has done you (again, you specifically!) a massive favor.  Let’s check out why on a per-language basis:

  • C/C++
    Having a Reascript written in C++ means that it can do some seriously heavy lifting.  Writing your code in C++ means that it can interact with other C++ code and potentially completely separate programs.  Does your video editing software have an API in C++?  How about a game audio middleware?  Yeah… we might be able to get them to talk…
  • EEL
    To be fair – I know little to nothing about EEL.  From what I could research, it appears to be a language specific for Reaper-based programming.  The fact that something like that is available is great, and screams to me that it should be easy to learn and jump off from.
  • Lua
    Of all the available languages – I believe this is the nicest one for newcomers.  Like Python and C++, Lua is its own language so you can conceivably write non-Reaper Lua programs by learning it.  The biggest benefit in my mind though is that Lua is incredibly legible.  It’s super easy to read and follow, and therefore super easy to learn.  It’s also powerful enough that you can get some pretty awesome things done.  My future Reascript tutorials will be written with Lua.
  • Python
    Python is freaking incredible, and you can do so much with it.  Unlike C++ which is compiled, Python is interpreted.  At its most general, that means you don’t create an executable file usually when you write Python code.  But like C++, Python is the language that a ton of things are written in.  Consider this a step between C++ and Lua – if you’re looking to step into writing things in other languages, Python is the perfect place to start (or go to after you write a Lua script)

3. You can quickly see the fruits of your labor

Though Reascripts can be quite large, they almost inherently beg to do few-task smaller jobs.

After writing your script, you’ll bind the script to a shortcut key with the idea that you’ll be using this over and over to make a process more efficient.  So you won’t be writing a code that tells Reaper “hey Reaper, mix my song” or “hey Reaper, get my post production work done”.  Instead you’ll be writing something more like “hey Reaper, would you batch process all my post-production metadata based on these criteria that I always use so it doesn’t take me four hours?” or “hey Reaper, I like my tracks colored and organized a certain way based on their names… would you do that for me?”

Most of these tasks don’t take a really long time to write, and because of that you’ll be able to reach your payoff very quickly.  After that, you can go brag to share it with all of your audio friends who can’t do this.

Now, go get started!

I’ve compiled a simple list of resources if you want to go ahead and jump further into this without me.  But shortly I’ll be walking you through writing a “Hello, World!” Reascript in Lua, and one that goes into a bit more depth as well.  But regardless, I encourage you to go get started – and have fun!


Copyright 2016-2017, Adam T. Croft, all rights reserved.