|
|
|
09-27-2015, 04:52 PM
|
#1
|
Human being with feelings
Join Date: Sep 2015
Location: Poland
Posts: 33
|
EEL: Set time selection to items on selected tracks
(Parent thread: Przemoc's ReaScripts)
Necessity is the mother of invention, so I'm joining the community of ReaScripters with very modest script for starters. I read about scattered EEL knowledge in pages dedicated to ReaScript at REAPER SDK and ReaScript documentation generated from REAPER. I cannot say I love EEL syntax, but it does have some inner beauty in its simplicity, so I thought: why not write something in it and improve my workflow along the way? Next I looked into some existing user scripts to get a bit more familiar with it. Then I applied my conventions regarding C/C++ programming to start developing my own (IMHO clean and readable, I always strive for these traits in code) EEL style. And in the end I finished the script. Without further ado, here it is:
PPP - Set time selection to items on selected tracks.eel
Only after creating this script I have noticed, that it can be imitated using custom action with following steps: - SWS: Save selected items,
- Item: Select all items in track,
- Time selection: Set time selection to items,
- SWS: Restore saved selected items.
Anyway, I find dedicated script/function much cleaner. I believe that (some) others here may share this mindset. Hope my script will help you to save a few seconds a day or at least a year.
You can view/download raw script using convenient shortlink:
http://git.io/PPP_SetTimeSelToItemsOnSelTracks.eel
Last edited by przemoc; 09-04-2016 at 02:55 AM.
Reason: Added new parent thread link
|
|
|
09-28-2015, 04:50 AM
|
#2
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
Hi !
Thanks for sharing
Indeed, EEL is pretty simple... Until we have to face complex strings operations, and tables.
There is some limitations of the language, you can't for example build multi dimensional arrays.
That's why most advanced scripts out there are in Lua.
But yes, some people successively mastered EEL in a very impressive way, but I think Lua is more simple to learn, due to its syntax and it's flexibility.
Anyway, feel free to pursue your script journey with EEL if you like it, it pretty easy to switch from this language to Lua
|
|
|
09-28-2015, 06:09 AM
|
#3
|
Human being with feelings
Join Date: Sep 2015
Location: Poland
Posts: 33
|
Quote:
Originally Posted by X-Raym
Thanks for sharing
|
You're welcome!
But from what I realized during ReaScript resources hunting (and I've already seen some of your docs and scripts, obviously) you're one of people that possibly benefits the least from such simple scripts, because you have written tons of them already and writing another one of that kind would be a no-brainer for you.
Quote:
Originally Posted by X-Raym
Indeed, EEL is pretty simple... Until we have to face complex strings operations, and tables.
There is some limitations of the language, you can't for example build multi dimensional arrays.
|
EEL is simple or, what I avoided writing in my first post in reascript part of the forum, possibly overly simple from scripter PoV. Number-based string handling is clunky and I didn't need tables yet, so cannot rant about them yet.
Quote:
Originally Posted by X-Raym
|
Lua is great for many reasons. I had some minor experience with it before (even from the other side of the fence - maintaining and fixing some server embedding Lua in one of my previous jobs). I would like more C-ish syntax, but Lua can be bearable. I always hated lack of 64-bit ints (for the same reason I cannot seriously think about JS), though. Lua 5.3 finally fixed this by introducing integer subtype (so I clearly understand why Cockos devs didn't approach Lua earlier). LuaJIT had its own approach before. This is another thing why I'm not that fond of Lua, its community is more or less divided between 3 camps: Lua up to 5.1/5.2, LuaJIT (which is mostly 5.1 compatible with some stuff from 5.2) and newly emerged Lua 5.3+. Various Luas are used in various places.
Quote:
Originally Posted by X-Raym
But yes, some people successively mastered EEL in a very impressive way, but I think Lua is more simple to learn, due to its syntax and it's flexibility.
|
Thanks for the link, I'll check it later. Having parentheses for block scoping instead of curly braces or using ?: as if-else is something that feels awkward and hard to learn in EEL.
Quote:
Originally Posted by X-Raym
Anyway, feel free to pursue your script journey with EEL if you like it, it pretty easy to switch from this language to Lua
|
I wanted to try EEL, becuase I knew completely nothing about it and it looked C-ish enough to appeal to me. I may definitely try Lua for ReaScripts in future if EEL won't be enough.
|
|
|
09-28-2015, 09:16 AM
|
#4
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
Of course Feel free to use it if you like it, and if it does the job, in a simple way !
Most of my simpler early days scripts were EEL, too, and they works just as fine as if they were written in Lua.
Quote:
you're one of people that possibly benefits the least from such simple scripts,
|
I am thankful for the gift you made to the community
Scripting and sharing have to be encourage !
|
|
|
09-28-2015, 09:46 AM
|
#5
|
Human being with feelings
Join Date: Sep 2015
Location: Poland
Posts: 33
|
Quote:
Originally Posted by X-Raym
I am thankful for the gift you made to the community
Scripting and sharing have to be encourage !
|
Fair enough. And thanks for encouraging REAPER users to dive into ReaScripts realms!
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:11 AM.
|