Lua Scripting with REAPER 5 - Part. 2: The API Documentation
-
0:00 - 0:04Hello, this is X-Raym, for the
second part of our Tutorial -
0:04 - 0:09on Lua scripts coding
in REAPER 5. -
0:09 - 0:13In the first part,
we saw how to use the console. -
0:13 - 0:17Now we will see how to
find the documentation -
0:17 - 0:23to run more specifics action
on REAPER objects -
0:23 - 0:28Regions, Tracks, Items, Takes...
and other stuffs. -
0:28 - 0:33From REAPER, you can display
the full functions list. -
0:33 - 0:41Avaible to ReaScript by doing
Help -> ReaScript Documentation -
0:43 - 0:46An HTML document appears
-
0:46 - 0:49which has been generated
by REAPER -
0:49 - 0:52when you clicked on this action.
-
0:52 - 0:56This means that this function list
will be always up to date -
0:56 - 0:59when you use this method,
which is extremly powerful. -
0:59 - 1:04The doc is generated
when you open it. -
1:04 - 1:12However, we have to admit that it is
a bit hard to look at first sight. -
1:14 - 1:18It lacks a bit of style,
we will see an alternative later. -
1:19 - 1:26Here is the List of ReaScript Functions,
there is many of them. -
1:26 - 1:33You don't have to learn everything,
you will learn them when you'll need it. -
1:33 - 1:36Most of them will never
be useful to you. -
1:36 - 1:39In order to make this document
more pleasing to read, -
1:39 - 1:45I have created a mod of it,
that I put online -
1:45 - 1:50http://bit.ly/reascript
-
1:50 - 1:55that will display this page
-
1:55 - 1:57(same as this one)
-
1:57 - 2:05but with more features and
a more readable text. -
2:05 - 2:13Having filterable function list
-
2:14 - 2:20is a huge time saver
-
2:20 - 2:27Without it, we are a bit lost
when we need to find a specific function. -
2:27 - 2:33The downside of this, is that
it will not always be up to date -
2:33 - 2:36I'll try to update it
as much as I can, -
2:36 - 2:40But it is possible that what
you are looking for -
2:40 - 2:44is new feature
that I didn't implement yet -
2:44 - 2:48As you can see here,
you can filter the functions -
2:48 - 2:54According to you needs. For example,
if you want to find the functions -
2:54 - 2:56which are related to
items and tracks -
2:56 - 2:58for example, this one.
-
2:59 - 3:03You just have to type "item" and track
and to click on it. -
3:03 - 3:06Here we see a
function explaination. -
3:06 - 3:10It is written for the different
languages we can use. -
3:10 - 3:17And you can see here in blue what type
of value the function need and return. -
3:17 - 3:23For example, in this function,
you have to put an Item as parameter -
3:23 - 3:25and it will return a track.
-
3:26 - 3:32So, it is a function that allow
to return the parent track of an item. -
3:32 - 3:38However, the details of the functions
are not always written -
3:38 - 3:42It is more a reference document
than a complete documentation. -
3:42 - 3:49It is confusing some times cause
some functions have untold behaviors. -
3:49 - 3:53But for more common functions
it is very nice. -
3:53 - 3:58So, we will try to find other functions...
-
3:58 - 4:04THis one is very used,
it means to display track infos. -
4:04 - 4:07We have to pass
a track as 1st parameters -
4:07 - 4:11and a string as second parameters,
and it will display a number. -
4:11 - 4:14The parameters here are listed below.
-
4:14 - 4:22We can return the Mute state, Phase state,
and it will be as a numerical vallue. -
4:23 - 4:25We will see that in practice
in a next tutorial. -
4:26 - 4:33An other online ReaScript Doc Ressource
is on the Cockos Wiki. -
4:33 - 4:39However, this page is obslete,
car it was made from REAPER 3.15 -
4:39 - 4:44Sure, because it is a Wiki
every one is welcome for update it, -
4:44 - 4:51but it took a lot of times
and each function has it's own page -
4:51 - 4:58in opposite to the auto-generated verson,
where all is grouped in a single page. -
4:59 - 5:02Another way to have
the function list -
5:02 - 5:06is to use an external code editor,
-
5:06 - 5:09such as Notepad++
or Sublime Text -
5:10 - 5:18For which some users have created files
ReaScript functions Automcompletion Files. -
5:19 - 5:27For example, on N++, I have created a file which
displays functions list when we type "reaper." -
5:32 - 5:35It can complete the function.
-
5:35 - 5:41If I type GetMedia.. the
function get completed. -
5:41 - 5:46To have Lua syntax colorisation
with REAPER functions -
5:46 - 5:54You'll need to download this file.
Install instructions are written there. -
5:55 - 6:02If you use Sublime Text, you will
have a native Lua code colorisation -
6:02 - 6:07and if you need autocompletion,
you will have to install an extension -
6:07 - 6:10which has been created by Breeder
from the SWS REAPER extensions -
6:10 - 6:13which is call ReaSynax.
-
6:13 - 6:17You can install it with
Package Control Extension. -
6:17 - 6:23However, at this time, this extensions
only manage REAPER functions in EEL. -
6:23 - 6:27Lua support may come
for the next release. -
6:27 - 6:31I have to admit that ReaSyntax is
far more easy to install -
6:31 - 6:34than my N++ files.
-
6:34 - 6:38No matter what code editor you will choose,
-
6:38 - 6:44Auto-completion is not indpensable
for coding a script. -
6:44 - 6:48We continue our course
by using Notepad++ -
6:48 - 6:51but you can choose the
code editor you want. -
6:51 - 6:58In the next tutorial, we will code
our first useful script on items. -
6:58 - 6:59See ya!
- Title:
- Lua Scripting with REAPER 5 - Part. 2: The API Documentation
- Description:
-
In this tutorial, you will learn how to find REAPER functions that we will use to build our future scripts.
Source Article:
http://extremraym.com/en/reascript-video-api-doc/X-Raym ReaScript Doc Mod:
http://bit.ly/reascriptSublime Text:
http://www.sublimetext.com/Package Control for Sublime Text:
https://packagecontrol.io/Breeder's ReaSyntax for Sublime Text:
https://packagecontrol.io/packages/ReaSyntaxNotepad++:
https://notepad-plus-plus.org/X-Raym's ReaScript Monokai for Notepad++:
http://stash.reaper.fm/v/23811/notepadReaScriptMonokai.zipCockos Wiki - API Functions List
http://wiki.cockos.com/wiki/index.php/REAPER_APIHope you still like the serie, feel free to make any suggestions !
- Video Language:
- French
- Duration:
- 07:00
Extrem Raym edited English, British subtitles for Lua Scripting with REAPER 5 - Part. 2: The API Documentation |