Quick Start ReaPerl

From CockosWiki

Jump to: navigation, search

This should get you started, for Windows & Perl anyway.

First download your scripting language

Contents

Download and Install Perl

Download and Install an Editor

You'll need a programmer's editor to create and edit scripts. There are a number of options but, if you haven't got one already, you can start here http://www.activestate.com/komodo_edit/ and do ok.

  • Go to http://www.activestate.com/komodo_edit/ and download the Komodo Edit set-up file, save it on your desktop
  • Run the downloaded set-up file; it's a standard Windows installation file, a .msi

Download and Install the FFI Module

This is the Foreign Function Interface module and it's the way Perl talks to REAPER functions.

"Install" is probably a bit of a grand description, it's just two files.

Reboot

Installing Perl changes PATH variables and no doubt other things as well. A reboot won't hurt.

Test Your Set-Up

Two steps

Use REAPER to Test The Perl Installation

  • Start REAPER
  • Actions menu, Show actions list
  • Enter script in the filter text box
  • Run the ReaScript: open ReaScript help (html)... action. A browser window will open, the second line in the browser should say that Perl is installed on this machine.

Run a test Perl script

The test script is a simple one liner and allows us to kill several outstanding birds with one neatly placed stone.

  1. Make sure ReaScript works.
  2. Briefly go through the script creation process.
  3. Make sure your newly downloaded script editor works
  4. Actually run a script
  5. Bind the script to a key combination, just to show we can, and then unbind it.

the ReaScript directory

My ReaScript scripts are in this directory on my development PC

D:\Documents and Settings\Mike\Application Data\REAPER\Scripts

And in this one on my production PC, the machine I use to pay a bill from time to time.

C:\Documents and Settings\Windows User\Application Data\REAPER\Scripts

They're slightly different and I've highlighted the differences in red. The text in red above shows the part of the directory path you may have to change to suit your set-up. I'll call this directory the ReaScript directory.

create the test script

In the ReaScript directory create a file called APITest.pl that contains the following line:

RPR_APITest();

Save the file.

run the test script

Now run the script from within REAPER, like this:

  1. Start REAPER
  2. Actions/Show action list
  3. Find and run the action "ReaScript: run (python/perl)..."
  4. In the Load Script dialogue, change the "Files of type" drop down list to display Perl files
  5. Run the script APITest.pl from the directory listing by double-clicking on the file-name.

You should see a simple dialogue box with an OK button; press the OK button.

install the test script as a REAPER command

  1. Start REAPER
  2. Actions/Show action list
  3. Press the New/Load button
  4. Select the APITest.pl script from the Load Script dialogue box and press Open

Note that there's a new action in the list "Custom: APITest.pl" - now continue with the next section

bind the script to a key combination

This continues on from the previous section.

  1. Select the new action Custom: APITest.pl by clicking on it.
  2. Bottom left of screen, press the Add button
  3. Hold down Ctrl, Alt, Shift and type a 'T' the key combination "Ctrl+Alt+Shift+T" will appear in the text box to the left of the Add button, it also appears to the left of the command name in the list.

The APITest.pl script can now be called with Ctrl+Alt+Shift+T

unbind the script

  1. Start REAPER
  2. Actions/Show action list
  3. Select action "Custom: APITest.pl"
  4. Bottom left of screen, select the key combination Ctrl+alt+Shift+T in the text box to the left of the Add and Delete buttons.
  5. Press the Delete button.

This deletes the binding between the key combination and the custom command, so the APITest.pl script cannot now be called with Ctrl+Alt+Shift+T

Problems?

Don't just push ahead if you have problems getting through the Quick Start section.

Look at it carefully, try to make sure you understand what it is you are trying to do, look to make sure you have actually done what you intended, make sure you have done things step by step and not missed anything out.

Ask questions in the Developer forum, be as specific as you can be.

Don't forget, it might not be you... It might (heaven forfend) be a mistake on the part of the person who wrote this page. So don't feel too bad about asking for help, don't feel bad at all about asking for help.

Personal tools