0:00:00.280,0:00:04.119 Hello, this is X-Raym, for the[br]second part of our Tutorial 0:00:04.120,0:00:09.319 on Lua scripts coding[br]in REAPER 5. 0:00:09.320,0:00:12.598 In the first part,[br]we saw how to use the console. 0:00:12.599,0:00:17.038 Now we will see how to[br]find the documentation 0:00:17.039,0:00:23.038 to run more specifics action[br]on REAPER objects 0:00:23.039,0:00:28.398 Regions, Tracks, Items, Takes...[br]and other stuffs. 0:00:28.399,0:00:33.438 From REAPER, you can display[br]the full functions list. 0:00:33.439,0:00:41.439 Avaible to ReaScript by doing[br]Help -> ReaScript Documentation 0:00:42.679,0:00:45.718 An HTML document appears 0:00:45.719,0:00:48.718 which has been generated[br]by REAPER 0:00:48.719,0:00:51.919 when you clicked on this action. 0:00:51.920,0:00:56.239 This means that this function list[br]will be always up to date 0:00:56.240,0:00:59.078 when you use this method,[br]which is extremly powerful. 0:00:59.079,0:01:03.639 The doc is generated[br]when you open it. 0:01:03.640,0:01:11.640 However, we have to admit that it is[br]a bit hard to look at first sight. 0:01:13.599,0:01:18.239 It lacks a bit of style,[br]we will see an alternative later. 0:01:19.319,0:01:25.798 Here is the List of ReaScript Functions,[br]there is many of them. 0:01:25.799,0:01:32.679 You don't have to learn everything,[br]you will learn them when you'll need it. 0:01:32.680,0:01:36.039 Most of them will never[br]be useful to you. 0:01:36.040,0:01:38.600 In order to make this document[br]more pleasing to read, 0:01:38.601,0:01:44.718 I have created a mod of it,[br]that I put online 0:01:44.719,0:01:50.119 http://bit.ly/reascript 0:01:50.120,0:01:55.238 that will display this page 0:01:55.239,0:01:57.039 (same as this one) 0:01:57.040,0:02:05.040 but with more features and[br]a more readable text. 0:02:05.359,0:02:13.080 Having filterable function list 0:02:14.319,0:02:20.119 is a huge time saver 0:02:20.120,0:02:27.359 Without it, we are a bit lost[br]when we need to find a specific function. 0:02:27.360,0:02:33.079 The downside of this, is that[br]it will not always be up to date 0:02:33.080,0:02:35.799 I'll try to update it[br]as much as I can, 0:02:35.800,0:02:40.318 But it is possible that what[br]you are looking for 0:02:40.319,0:02:43.918 is new feature[br]that I didn't implement yet 0:02:43.919,0:02:47.878 As you can see here,[br]you can filter the functions 0:02:47.879,0:02:53.598 According to you needs. For example,[br]if you want to find the functions 0:02:53.599,0:02:56.119 which are related to[br]items and tracks 0:02:56.120,0:02:57.640 for example, this one. 0:02:58.960,0:03:02.598 You just have to type "item" and track[br]and to click on it. 0:03:02.599,0:03:05.638 Here we see a[br]function explaination. 0:03:05.639,0:03:09.598 It is written for the different[br]languages we can use. 0:03:09.599,0:03:16.598 And you can see here in blue what type[br]of value the function need and return. 0:03:16.599,0:03:22.679 For example, in this function,[br]you have to put an Item as parameter 0:03:22.680,0:03:24.879 and it will return a track. 0:03:25.960,0:03:32.399 So, it is a function that allow[br]to return the parent track of an item. 0:03:32.400,0:03:37.598 However, the details of the functions[br]are not always written 0:03:37.599,0:03:42.119 It is more a reference document[br]than a complete documentation. 0:03:42.120,0:03:48.598 It is confusing some times cause[br]some functions have untold behaviors. 0:03:48.599,0:03:53.318 But for more common functions[br]it is very nice. 0:03:53.319,0:03:58.119 So, we will try to find other functions... 0:03:58.120,0:04:03.999 THis one is very used,[br]it means to display track infos. 0:04:04.000,0:04:06.918 We have to pass[br]a track as 1st parameters 0:04:06.919,0:04:10.999 and a string as second parameters,[br]and it will display a number. 0:04:11.000,0:04:14.359 The parameters here are listed below. 0:04:14.360,0:04:22.360 We can return the Mute state, Phase state,[br]and it will be as a numerical vallue. 0:04:22.879,0:04:24.879 We will see that in practice[br]in a next tutorial. 0:04:26.160,0:04:33.359 An other online ReaScript Doc Ressource[br]is on the Cockos Wiki. 0:04:33.360,0:04:39.119 However, this page is obslete,[br]car it was made from REAPER 3.15 0:04:39.120,0:04:43.799 Sure, because it is a Wiki[br]every one is welcome for update it, 0:04:43.800,0:04:51.359 but it took a lot of times[br]and each function has it's own page 0:04:51.360,0:04:58.160 in opposite to the auto-generated verson,[br]where all is grouped in a single page. 0:04:59.240,0:05:01.878 Another way to have[br]the function list 0:05:01.879,0:05:05.599 is to use an external code editor, 0:05:05.600,0:05:08.560 such as Notepad++[br]or Sublime Text 0:05:10.160,0:05:18.160 For which some users have created files[br]ReaScript functions Automcompletion Files. 0:05:19.480,0:05:26.640 For example, on N++, I have created a file which[br]displays functions list when we type "reaper." 0:05:31.759,0:05:34.799 It can complete the function. 0:05:34.800,0:05:40.518 If I type GetMedia.. the[br]function get completed. 0:05:40.519,0:05:45.518 To have Lua syntax colorisation[br]with REAPER functions 0:05:45.519,0:05:53.519 You'll need to download this file.[br]Install instructions are written there. 0:05:55.439,0:06:02.318 If you use Sublime Text, you will[br]have a native Lua code colorisation 0:06:02.319,0:06:06.679 and if you need autocompletion,[br]you will have to install an extension 0:06:06.680,0:06:10.198 which has been created by Breeder[br]from the SWS REAPER extensions 0:06:10.199,0:06:13.239 which is call ReaSynax. 0:06:13.240,0:06:16.799 You can install it with[br]Package Control Extension. 0:06:16.800,0:06:22.799 However, at this time, this extensions[br]only manage REAPER functions in EEL. 0:06:22.800,0:06:27.239 Lua support may come[br]for the next release. 0:06:27.240,0:06:30.758 I have to admit that ReaSyntax is[br]far more easy to install 0:06:30.759,0:06:34.278 than my N++ files. 0:06:34.279,0:06:37.799 No matter what code editor you will choose, 0:06:37.800,0:06:43.999 Auto-completion is not indpensable[br]for coding a script. 0:06:44.000,0:06:47.799 We continue our course[br]by using Notepad++ 0:06:47.800,0:06:51.039 but you can choose the[br]code editor you want. 0:06:51.040,0:06:58.198 In the next tutorial, we will code[br]our first useful script on items. 0:06:58.199,0:06:59.199 See ya!