Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 09-22-2018, 04:26 PM   #1
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 775
Default ReaScript (Lua) from total beginner to a working script with a GUI (text AND video)

Text Article here (huge)



Corrections appreciated of course.

This is a complete tutorial, from non-programming beginner to having a working script with a GUI.

(Yes, I intentionally choose dopey pictures. I think it's hilarious.)
__________________
http://www.admiralbumblebee.com
Audio/DAW stuff, Woodworking, Programming and more... new posts every weekend.

Last edited by Robert Randolph; 09-22-2018 at 05:11 PM.
Robert Randolph is offline   Reply With Quote
Old 09-22-2018, 04:46 PM   #2
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 368
Default

This looks very informative. Maybe this should be in the scripts forum?

Actually this looks very very nice. Thank you and all those who helped you for this excellent resource. God I love the Reaper community!
Steviebone is offline   Reply With Quote
Old 09-22-2018, 04:47 PM   #3
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 775
Default

Quote:
Originally Posted by Steviebone View Post
This looks very informative. Maybe this should be in the scripts forum?
I'm trying to reach people that would never think to look there.

This is for the general public that may think they can't script, but they can!
__________________
http://www.admiralbumblebee.com
Audio/DAW stuff, Woodworking, Programming and more... new posts every weekend.
Robert Randolph is offline   Reply With Quote
Old 09-22-2018, 04:54 PM   #4
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 1,301
Default

This is big Robert, gonna share this immediately with some friends who want to dive into it!
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 09-22-2018, 05:01 PM   #5
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 368
Default

Quote:
Originally Posted by Robert Randolph View Post
I'm trying to reach people that would never think to look there.

This is for the general public that may think they can't script, but they can!
Good point. And Dragon kicks ass. I used it for a time to do some database programming. The newer versions have excellent voice recognition right out of the box and with a little careful planning you can create voice commands suitable for dictating computer code complete with formatting. It ends up being light years faster than typing because a single voice command can create entire loop and branching structures automatically.

I've never done any scripting for reaper but it is definitely something I want to delve into if I can ever find the time for some study. Unlike some other tutorials I glanced at this one looks grassroots and accomplishes a real-world scenario that is actually useful in the end instead of just a theoretical "hello world". Good job!
Steviebone is offline   Reply With Quote
Old 09-22-2018, 05:10 PM   #6
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 452
Default

Fantastic.

Very methodical and well laid out. And now I'm not afraid to try Loka's GUI builder. I thought I'd have to learn a whole bunch of UI code LOL... but thankfully Loka made this dead simple, and also thankfully, you demonstrated how easy it is to use!!

Well done!
__________________
Cheers,
Andrew K
Reaper 5.95/64 Mac 10.12.+, i7 Quad 2.9GHz, 24GB
Thonex is offline   Reply With Quote
Old 09-23-2018, 03:31 AM   #7
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,230
Default

Many thanks for this detailed course, I'm sure it could bring new people to the ReaScript community, or even enhance the skills of those who are already in it, thanks to lokasenna library demo :P
X-Raym is offline   Reply With Quote
Old 09-24-2018, 01:40 AM   #8
enroe
Human being with feelings
 
Join Date: Nov 2017
Posts: 188
Default

Thank you Robert!

Your tutorial is "pedagogically" well done also!

With this I mean: Well devised, easy to understand
and fun to read.
__________________
free mp3s + info: andy-enroe.de songs and weird stuff: enroe.de

Last edited by enroe; 09-25-2018 at 04:48 PM. Reason: prevent to be misunderstood
enroe is offline   Reply With Quote
Old 09-24-2018, 11:11 AM   #9
Jeffsounds
Human being with feelings
 
Jeffsounds's Avatar
 
Join Date: Feb 2013
Location: Northeast Michigan
Posts: 2,695
Default

Quote:
Originally Posted by enroe View Post
Thank you Robert!

Your tutorial is pedagocially well done also!
There's no reason to swear at the man...
__________________
"Music is a fundamental human desire." - Mike Butera
Jeffsounds is offline   Reply With Quote
Old 09-24-2018, 12:49 PM   #10
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 775
Default

Quote:
Originally Posted by Jeffsounds View Post
There's no reason to swear at the man...
Nah, it's ok, I think they said that in Mary Poppins.
__________________
http://www.admiralbumblebee.com
Audio/DAW stuff, Woodworking, Programming and more... new posts every weekend.
Robert Randolph is offline   Reply With Quote
Old 09-24-2018, 03:54 PM   #11
CEART
Human being with feelings
 
CEART's Avatar
 
Join Date: Jul 2018
Location: Spain
Posts: 46
Default

Thanks, Robert! this is very encouraging even for myself that not yet decided to cross the ignorance line of script/mod making.
CEART is offline   Reply With Quote
Old 09-25-2018, 09:04 AM   #12
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 11,972
Default

Another big thanks Robert, I have a couple of questions that you may have covered, but I missed them. Also I've only covered 28 minutes so far.

Indentations: Your code went in so fast I couldn't see if you were indenting from your keyboard or if the built in editor was doing that for you?

Do you prefer Reaper's editor or is there an outside editor like Notepad++ that you might like better?
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is online now   Reply With Quote
Old 09-25-2018, 09:38 AM   #13
rothchild
Human being with feelings
 
Join Date: Oct 2007
Posts: 533
Default

Great tutorial Robert, many thanks.

I'm going to try and work my way through it although one (hopefully quick) question.

How do I capture the output of a knob or slider created in the gui designer? I really want to make an editor for a hardware reverb, but I don't know how to capture the output of the knob in order to turn it in to a midi control message.

Much of your lesson I can see ways to interpret to achieve what I want to do, but knobs and sliders aren't covered.
rothchild is offline   Reply With Quote
Old 09-25-2018, 12:25 PM   #14
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 775
Default

Quote:
Originally Posted by Tod View Post
Another big thanks Robert, I have a couple of questions that you may have covered, but I missed them. Also I've only covered 28 minutes so far.

Indentations: Your code went in so fast I couldn't see if you were indenting from your keyboard or if the built in editor was doing that for you?
I did this manually in the video.

Quote:
Do you prefer Reaper's editor or is there an outside editor like Notepad++ that you might like better?
If you want to use an external editor, I suggest https://code.visualstudio.com with the Lua extension and lokasenna's awesome extension https://github.com/jalovatt/reaper-vs-code

I only recommend VS Code because of Lokasenna's fantastic work, and it's very easy to get started with.

I personally prefer another editor (emacs + evil-mode) but I'd never suggest that to a beginner. Once you start developing your own preferences, then you may naturally venture into the world of other editors and IDEs. VS Code is a fantastic product though and you may never outgrow it.
__________________
http://www.admiralbumblebee.com
Audio/DAW stuff, Woodworking, Programming and more... new posts every weekend.
Robert Randolph is offline   Reply With Quote
Old 09-25-2018, 12:40 PM   #15
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 775
Default

Quote:
Originally Posted by rothchild View Post
Great tutorial Robert, many thanks.

I'm going to try and work my way through it although one (hopefully quick) question.

How do I capture the output of a knob or slider created in the gui designer? I really want to make an editor for a hardware reverb, but I don't know how to capture the output of the knob in order to turn it in to a midi control message.

Much of your lesson I can see ways to interpret to achieve what I want to do, but knobs and sliders aren't covered.

Knobs and sliders require something I didn't want to add to the tutorial due to added complexity in the introductory section. (Explaining classes, metatables, method overrides, super classes, etc..)

In the documentation (Reaper/Scripts/ReaTeam Scripts/Development/Lokasenna_GUI v2/Developer Tools/Documentation.html#1.05-Element-methods) you will see an example of overriding a GUI element method.

For a knob or slider, you'll want to generally override the onmousedown() method. So your code will look something like:

Code:
function GUI.elms.rothchilds_knob:onmousedown()
    GUI.Slider. onmousedown(self) -- make sure the slider does its own things if needed

    knob_val = GUI.Val("rothchilds_knob") -- Surely you want the value of the knob?

    -- Code here

end
A similar mechanism is used for sliders.
__________________
http://www.admiralbumblebee.com
Audio/DAW stuff, Woodworking, Programming and more... new posts every weekend.
Robert Randolph is offline   Reply With Quote
Old 09-26-2018, 12:08 AM   #16
rothchild
Human being with feelings
 
Join Date: Oct 2007
Posts: 533
Default

Thanks Robert,

I'll take this away and continue my head-scratching this evening.

Half the battle when you're in the foothills is understanding where to look and what you're looking at in the help files!
rothchild is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.