In part two of my interview with Raymond Radet we discus the powerful things possible with ReaScript and the possibility of fulfilling your own feature wishlist. Go here for part 1.

reaperblog: What got you started with scripting for REAPER? Was it curiosity or the need for something that didn’t exist yet in REAPER?

Raymond: The need came first, but the curiosity keep me into it! And the more I learn, the more I have ideas!

That said, I didn’t discover scripting by myself. In fact I really started in November, after one year and half on the Cockos forum without entering the JSFX/ReaScript subforum once, until someone shows me in a brilliant way what scripting was all about. Before that, I linked Python libraries to REAPER, but the scripts I tested didn’t work, so I didn’t knew how powerful, how useful, and how cool ReaScripts were.

Let me tell you the whole story, cause I still feel excited about it!

I was working on a personal project, a Sci-Fi audio story. The main characters were supposed to be inside a gigantic human cloning factory. All that has to be suggested by sound only.

I recorded a lot of things to create the ambiances, air depressurization stuff and bubbles in a tube (imagine clones in suspension breathing inside some liquid). After editing the audio items, I came up with around 250 sounds that needed to be individually panned, during 4 minutes of action. I naturally thought about randomization, but I didn’t find anything in REAPER that could satisfy my needs. So, as usual, I wrote a feature request. And the answers were way beyond all I could dream of.

Less than one hour after, spk77 brought me support into this task. He coded for me a script that was able to make random pan for selected items. It was coded with EEL, which I didn’t know before that. The plug and play (or should I say, Load and Run) concept seduced me in a second, as it was far easier to integrate than Python. So I tested it and… It worked impressively well. But could we go further? I don’t like to use item pan, cause there is no visual cue to see if an item is panned or not, so I prefer use pan envelope. And here another spk77’s success: a script for converting take pan into take pan envelope. That was fantastic… but still not exactly what I needed.

I needed control on this randomization. The bubbles and the other sounds are not supposed to come from everywhere around the characters, and I definitely wanted to avoid center panned items, for dialog clarity.

And here is spk77 pure magic: he made a script with a user interface (GFX), capable of Gaussian distribution (approx.), different seeds, and the whole thing with take pan envelope. That was so awesome! I don’t even think that a UI for what I asked would be possible. All that power… how hard could it be to learn it? I tried to make a variation with pitch envelope, without success. Spk77 shew me how to do it. That was very stimulating!

I take a look at the source code. I didn’t understand a lot of things, but my code knowledge was enough to let me see some patterns. I succeeded to make a Randomize Take Rate. That was it. I was actually scripting. And thanks to spk77, what I wanted to do in my project was possible, in a matter of seconds, and I had new territories to explore in my favorite DAW! Most important thing, the ambiance sounds in my project were very convincing. Enthusiast, I decided to learn more about ReaScript. I had so many new ideas in mind!

How steep is the learning curve, how long would it take to get started? Prerequisites?

Desire, based on curiosity or based on needs, is a key factor in every learning. This leads to concentration, to perseverance, and finally to understanding. But don’t forget that, if becoming a master take long and long months, becoming just good enough to make nice things is not as difficult as you could think. The hardest thing is to jump into it. Start simple, the feeling of satisfaction will automatically leads you to more ambitious learning and projects… and even more satisfying results.

Few months ago, I was myself a total newbie in ReaScript. I didn’t even know that REAPER was flexible to this extent, and I have to asked a lot of noob questions on the forum. Fortunately, the community is open, and I get enough answers to find info for making what I want. Now, I have now 100 scripts approximately. Some are mods of pre-existing scripts, some are complete rewriting, but the vast majority are original creations.

Wanting to make the things easier for other people, and wanting to demonstrate how anyone could contribute to add functionalities for REAPER, I started a serie of articles, ReaScripts for beginners, to help other people learn ReaScript. There will be other articles very soon. I will resume here some key principles.

For REAPER scripting, basic coding knowledge is required, as there is no “introduction to programming using REAPER” type of course.

If you know what a language is, what are variables, comment, conditions, functions, arrays and loops, you will just have to learn basic syntax of the language you want to use (EEL, Lua or Python). And in few hours, you will be ready to go! A lot of REAPER scripters came from other languages, and you can feel it just by looking at their code.

Total beginners, don’t be afraid of code, with a well written course, you will be able to make simple but effective things very quickly!
I highly suggest you to learn basic programming knowledge first, using online interactive courses such as Codecademy or Codeavengers, with Javascript or Java. These languages are different than those you will use for ReaScript, but it is about learning programming principles, so it does not matter. You will be able to transpose your learning into what you need.

You could also start learning Python but I feel it is less and less used by REAPER scripters, who prefer to use language natively interpreted by REAPER, which results in a file easier to share with everyone. They are also easier to code!

When you will feel ready, you will be able to start with a script template I made, for both Lua and EEL: with this, some simple actions can be done in matter of seconds. It contains all you need to get your started: basic loops structure for common actions (selected items, selected tracks, regions…), code references, optional but often used functions etc… I plan to make a video of how to use it.

As spk77 told me, after having finished the Randomize Take Pan Scripts:

Scripting is (mostly) fun!

He was right. Definitely.

What things have you built for REAPER using ReaScripts?

I’ve tried to make a script per day since December, so it’s a pretty long list! Last week, I released 21 scripts in one day! (They all involve text items).

Fortunately, I manage to synchronize a Google SpreadSheet to an HTML table on my website. Every time I write a script, I update the table, and the web page is updated as well. This table contains a lot of info: script names, script languages, categories, dates of release, screenshots, links to the forum… Just as the SWS extensions developers and all the scripts authors on Stash, I share all of it for free!

That said, I will introduce you here to my most valuable ReaScript work! It is not the most complicated scripts you will find, but they definitely help a lot! I don’t code if I don’t feel the need for an action to exist.

One of my top work is in fact a collaborative one, which wouldn’t have been possible without HeDa. The script is called Export selection as SRT subtitles with offset. It is a subtitles exporter based on items notes and edit cursor position. HeDa did the SRT conversion part of the script and the basic structure (that was the hard part), then I optimized the whole thing to make it more flexible and avoids any bug. It is now able to export text items as subtitles, even if they are not on the same track. In two words, we created Multi-Tracks subtitling… inside REAPER! I don’t know any other software which has this capability, including in dedicating subtitling softwares.

Export SRT based on item notes on track selection

On the same idea, we can reference my whole text items formatting collection, which uses SRT formating markup, and which can use actual items properties. The great thing is that the SRT markup can be interpreted by the HeDa’s Notes Reader!

Various Text Items Formatting Scripts by X-Raym
Various Text Items Formatting Scripts by X-Raym

I made also a whole new pack of actions for text items creations, based on regions, items names, etc… With that, we now have the ability to glue text items together, preserving last item notes or merging all their notes.

Create Text Items from Selected Items Names

I just started a set of envelope actions for envelope track that will be a real life changer in my workflow: as you know we can’t select multiple envelopes. So, we can’t copy paste points from one envelope to several other tracks envelopes, or copy sections of several envelopes from one track and paste it at another place. Until scripting came to play!

There is different trick used depending on the script but basically, it works for selected tracks, and visible + armed envelopes only. This is how we can consider our “envelopes” selection.

If you like track envelope, I strongly recommend you to take a look at this thread.

copy track envelope
Copy multiple envelopes on multiple tracks? Possible, with scripts!

The Insert time signature markers from selected items scripts was a real time saver when composing my last polymetric metal song. You just need to select items and create time markers based on their length and actual BPM.

Insert time signature markers from selected items
Insert time signature markers from selected items

My Glue selected items independently (preserving item names and color), is a simple but precious script in my workflow.

Glue selected items independently
Glue selected items independently

In MIDI Editor, based on SWS API functions, I made a script which is able to select all notes at the same row of the mouse cursor and after its position. It is a handy script for composing MIDI drums parts.

Select/Unselect all MIDI notes with same pitch right of the mouse
Select/Unselect all MIDI notes with same pitch right of the mouse

One last. 😀

I made a script that I wanted for a long time; Randomize selected envelope points value. The cool thing with this script is that it is a mod of a spk77 script, which is able to compress/expand selected envelope point value by a certain amount. I thought it would be hard to convert it into a randomizer. It took me 10 minutes; there were just few lines to change.
That’s what is great with script sharing, everybody can make something great from someone else work, and give it back to the community.

Randomize selected envelope points value

If you want to see the (approx) 90 others, go to my website, you may find some useful stuffs! I personally used all of them in a project… or I will use it… at least one time! 😀

Have you ever written a simple script for an essential function and wondered why Cockos couldn’t have done it themselves.

Sure thing, if we wrote a script, it answer a need, something that we want to do in REAPER. So the first thing we thought is “can we do that in REAPER?”. And if the answer is no, the solution may be possible via scripting. If I wondered why they didn’t do it themselves? Not really. They already have done, and are still doing, so many things!

I think I understand what seems to be their priorities, and I like the fact that they want to provide the most flexible and optimized DAW possible. Modularity is the key for trying to satisfy everyone’s desire. There is so many things we can do with a DAW: recording, live, electronic music, audio story, audio for video, engineering, video game, radio, sound design… Giving to the users the tools to write the features they want/need is one of the greatest thing that a software could provide. I don’t remember where, but one guy on the forum said that the Forum Community was one of the nicest feature included in REAPER. That’s totally true, and all the great REAPER resources shared online by users are a proof of that.

We can’t say that Cockos members don’t listen to the community, as prove their active participation on pre-releases threads, and the simple fact that these pre-releases are open to everyone. Yes, because we are so inspired by their work, it stimulates our imagination, and we ask a lot from these guys, so they can’t read or answer to every comment. We can understand that. Everyone’s need and vision is different. They are talented people, we have to trust them for taking REAPER in a right direction! They did an incredible work so far, so we are not worried about that.

I have to admit that there is features I deeply want, things that cannot be done with scripts. These concerns the REAPER core. But some of these are related to scripts anyway.

In top of my list, the way we actually load scripts: it doesn’t answer our need to be able to load of lot of scripts at once. We can load several scripts at once. But it is not “plug and play” as JFX, VSTs, Themes, or any other REAPER resources. And when we have more than 150 scripts to move or rename… well, you are stuck. You would have to re-import everything, and re-assign your keyboard shortcuts, your buttons… And you will have to find all your residual actions on the actions list and delete them manually.
Scripts may have been something a bit casual… It is not the case anymore. Everyone’s support for this feature is welcome!

Secondly, I would love that the API doc generation were a bit more modern. The actual documentation is a bit raw, it really misses some features to be user-friendly and developer friendly, it may afraid scripting beginners. It took me a long time and people on the forum had to help me for understanding how to use it properly. It is a document we have always open in our browser when scripting, so it is important. I proposed some ideas on this subject, but I didn’t have any answer from Cockos.

Have user scripts ever become natively implemented into REAPER?

We cannot really talk about implementation, as REAPER is written in another language than those we use for scripts.

As far as I know, there is no recent scripts that have been rewritten for a REAPER integration.

However, it happen that a user develops something and Cockos developed a similar thing, but it was a pure coincidence. The problem is that they don’t communicate a lot about future features. Every release came with its surprises!

HeDa gave me a nice quote, from Breeder (one of the great SWS extensions developers), about this subject:

Welcome to coding for reaper, where you have to find workarounds all the time 🙂
I guess it’s a love/hate relationship – you get mad when they fix something you spent hours to find a workaround, but you still love that you created your own way around it 😀

It also happen to me that I write a script for something that already exist, but was named totally differently. And it also happen than I write a script that a user already did, but that was not very exposed online (such as scripts written as plain text in a forum post).

About REAPER integration, we could also speak about the Jeff0s story, which is inspiring. He worked on SWS extensions, and he has now been hired by Cockos… How cool is that?

It seems like instead of trying to fulfill every single feature request, the REAPER dev team have instead given us (the users) the tools and access to complete the wishlist. I’m not sure if this is brilliant or insane. What do you think?

I have that feeling too! I don’t know if it was always like that, but when you compare the recent REAPER changelog and the SWS one, you will be surprised about one thing: there are not so many actions in REAPER, unless it is about new core features of course, but you have tons of them with SWS. REAPER updates contains a lot of bug-fixes or optimization that the average user may not be aware of. And there is also, especially recently, a lot of new things for scripts and extensions! That said, there is already plenty things we can do with native actions!

Brilliant or insane? Hm… You may feel more confident and secure with a software that have low updates cycle, and that keep the user out of development process, and with a more rigid behavior and a low level of customization. Or you may feel excited and enthusiastic about a software that allows the user to do develop is own tools if needed.

I really like the way REAPER is. We often see in movie making-of how the Visual Effects team developed their own software for crowd simulation, particles or fire physics etc… Why major DAW out there don’t offer this opportunity? Having this freedom of creativity with JFX, extensions and scripts is something that make REAPER really stands out from its competitors. It is so incredible that REAPER is capable to allow these stuffs (EEL, Python, Lua, C++…) when you consider the lightweight size of the software (less than 10 MB!). Its a proof of it’s high level optimization and its developers genius, which has been already proven many times. That’s the kind of things I want to work with.

But you may prefer to be totally free and independent and choose a totally open source software, entirely build by a community, including core itself. No matter what solution you choose, as long as you don’t feel limited by the software functionality and performance!

Justin Frankel, Cockos/REAPER creator, consider coding as a form of self-expression. It is generous to him to let the users express themselves back within REAPER.

Brilliant or insane? Without any doubt, it’s both. And I love it.


Posted

in

, ,

by

Tags:

Comments

3 responses to “ReaScripting with Raymond Radet Part-2”

Leave a Reply

Your email address will not be published. Required fields are marked *