![]() |
#1 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
This script implements a REPL shell for Lua ReaScript inside of REAPER, for quickly experimenting code and API functions.
![]() Main Features:
iReaScript is available from ReaTeam's ReaScript repository in ReaPack.
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 08-02-2018 at 08:34 AM. |
![]() |
![]() |
![]() |
#2 |
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 4,351
|
![]()
This is Amazing!
|
![]() |
![]() |
![]() |
#3 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 10,672
|
![]()
This is what I call an experimental script haha
![]() Well done, it seems pretty good !
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
![]() |
![]() |
![]() |
#4 |
Human being with feelings
Join Date: Aug 2014
Location: New York
Posts: 135
|
![]()
This is awesome, gonna have to give it a shot later tonight. I can see this becoming a very handy tool while reascripting
|
![]() |
![]() |
![]() |
#5 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
iReaScript v0.2
+ enhance formatting of arrays containing nil values + implement Delete key + implement word movement keys (Shift+Left and Shift+Right) + imply the return statement by default + limit maximum depth when formatting tables + protect against overriding of built-in variables
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui |
![]() |
![]() |
![]() |
#6 |
Human being with feelings
Join Date: Jun 2008
Posts: 4,923
|
![]()
yes !!
|
![]() |
![]() |
![]() |
#7 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
iReaScript v0.3
+ added autocompletion with Tab key + added PageUp/PageDown keys to scroll faster + fix formatting of multiline text chunks + implement clipboard read/write with Ctrl+C and Ctrl+V (works best on OS X) + preserve current input and history on .clear + protect against invalid access on reaper/gfx tables (using X-Raym's workaround) + set global `_` variable to the first return value of last statement + support multi-line statements (like long functions, conditions...) ![]()
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 07-14-2016 at 08:03 PM. |
![]() |
![]() |
![]() |
#8 |
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,470
|
![]()
wow... I didn't know about this.
mind blown ![]() amazing! |
![]() |
![]() |
![]() |
#9 |
Human being with feelings
Join Date: Jun 2008
Posts: 4,923
|
![]()
my new favorite script
|
![]() |
![]() |
![]() |
#10 |
Human being with feelings
Join Date: Jul 2015
Location: Yekaterinburg, Russia
Posts: 400
|
![]()
omg wow
|
![]() |
![]() |
![]() |
#11 |
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,945
|
![]()
Neat.
![]() |
![]() |
![]() |
![]() |
#12 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
iReaScript v0.4
+ autocomplete partial matches + don't execute empty code input (v0.3 regression) + enhance formatting of string values + fix input of tildes + increase maximum buffer size to 2048 lines + limit maximum size of tables values when formatting + optimize layout by only computing new or modified text segments + preserve current input when using Ctrl+L shortcut + prevent cursor position from affecting text position + remove reaper/gfx proxy variable workaround (requires REAPER v5.23 [t=177319]) + rewrite drawing & scrolling code + wait at least one second before blinking the cursor
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 08-18-2016 at 12:19 PM. |
![]() |
![]() |
![]() |
#13 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
iReaScript v0.4.1
+ fix auto-completion of exact matches + fix caret display in multiline input + improve how partially visible lines affect the scrollbar + remember docked state (use `gfx.dock(N)` to put in dock) iReaScript v0.4.2 + fix formatting of zero-indexed table + fix formatting of zero-sized (yet non-empty) tables + override global 'print' function + use braces instead of non-lua brackets for tables with numeric indexes
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 10-07-2016 at 05:17 PM. |
![]() |
![]() |
![]() |
#14 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
@TonE It's called "cfillion_Interactive ReaScript.lua" in the action list and ReaPack v1.0 (in v1.1 the "iReaScript" is also displayed).
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 11-29-2016 at 04:29 PM. |
![]() |
![]() |
![]() |
#15 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
iReaScript v0.5
+ add Copy/Paste/Clear/Dock/Close actions to the right click context menu + display errors using bold font + document the built-in functions and variables in .help + fix formatting of \t and \r in strings when they are followed by numbers + implement (fix) display of empty lines + remember window position, size and docked state + store every return values in _ global variable iReaScript v0.6 + allow .clear to be recorded in the history + do not crash on clipboard read/write failure (eg. 32-bit windows) + don't evaluate command/actions while in a lua block + implement !ACTION for Main actions, !!ACTION for MIDI Editor actions + remove extra newline inserted when executing an empty command since v0.5
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 01-20-2017 at 04:26 PM. |
![]() |
![]() |
![]() |
#16 |
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,945
|
![]()
Bravo!
![]() |
![]() |
![]() |
![]() |
#17 |
Human being with feelings
Join Date: Feb 2014
Posts: 842
|
![]()
This is exactly what I need, Thank you.
__________________
Outboarder Scripts |
![]() |
![]() |
![]() |
#18 |
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 349
|
![]()
Very very useful tool, thanks.
__________________
Ceanganb |
![]() |
![]() |
![]() |
#19 |
Banned
Join Date: Nov 2015
Posts: 406
|
![]()
Very cool! Is there any way to have a default script run at startup? I could probably modify the code, but probably better for it to be done by the repository. Is there still a gfx issue? I assume the problem is due to the script itself using the gfx?
|
![]() |
![]() |
![]() |
#20 |
Banned
Join Date: Nov 2015
Posts: 406
|
![]()
There seems to be some bugs in the script. When I execute the script in reaper it works fine but when I execute it in repl it fails iwth
attempt to compare nil with number. I am simply trying to execute `reaper.CountTracks(0)` and so it should work fine, this suggests it is a script. Other code works fine. If I copy the code I'm using in to repl: function NumTracks() return reaper.CountTracks(0) end and then call it, it works fine. Seems like some type of parsing issue of the library I'm importing using "require". --- Ok, what it is, is that it is not loading the new library after I save it. Could we get an update that monitors any require's for changes(file size/hash) and if it changes to reload it automatically or to even restart the repl session if necessary? repl is great for debugging but if it can't refresh after changes without requiring it to restart, it slows things down greatly. |
![]() |
![]() |
![]() |
#21 | ||
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]() Quote:
Quote:
Perhaps the script you are loading is defining and using some local variables? If so, Lua erases those after the evaluation. This would explain the nil.
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui |
||
![]() |
![]() |
![]() |
#22 |
Banned
Join Date: Nov 2015
Posts: 406
|
![]()
Thanks. Could you had the ability for it to execute a simple script at startup automatically. e.g.,
iReaScriptStartup.lua (if it exists in the scripts or lua dir it is executed automatically) Should be simple to add(load file then parse it line by line as if the user typed it in) By having that and the the history, it should work well. It would still require one to reload the script but it won't require a complete restart of the entire process like it does now. Also, it would be nice if the `esc` key would clear the current line. It seems that the graphics window also loses focus when pasting which requires one to grab the mouse and reselect it... pretty annoying ;. Also, when starting the script for the first time, it loses focus. It would be nice to do simple expressions. e.g., one can't compute 1/3 I suppose this is because you are simply eval the expression as is. Maybe add a test for something like an expression and if the line seems like an expression(doesn't start with local, =, alpha, etc) then prepend a `local val =` to it then report the `value of val`. If it fails try executing the line directly(or vice versa). Last edited by Airal; 03-22-2017 at 03:37 PM. |
![]() |
![]() |
![]() |
#23 |
Human being with feelings
Join Date: Feb 2017
Posts: 305
|
![]()
Thank you a lot!
|
![]() |
![]() |
![]() |
#24 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
iReaScript v0.7
Implemented text selection! ![]()
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 10-05-2017 at 06:54 PM. |
![]() |
![]() |
![]() |
#25 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 10,672
|
![]()
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
![]() |
![]() |
![]() |
#26 |
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,067
|
![]()
Looks great for learning, now we need to find best resources about as much reaper lua as possible, besides having the millions of .lua examples!
We need a separate reaper blog with youtube videos where any of the million .lua is taken as an example, then analyzed, brought to its minimal form. As a formula the tutorial should do: luaexample := skelett + flesh The goal would be removing the complete flesh, leaving only the skelett which could be used then for other related experiments. One example: Can we have dynamic arrangements, rather than static arrangements? Like for all items in a folder, and around playing bar region, like current bar plus and minus 2 bars, every 15 seconds, switch to another item (next,prev,random). Could be fun, something like a probability, but on item level. Then watching in Interactive ReaScript some statistics which files were used how often. Another example: Reprogramming all available midi mappings, for a set of tracks/effects according to some algorithm. Directly inside Reaper. I did something in the past with Autohotkey, by simply editing .rpp and generating another .rpp, but doing it directly inside the project would be more fun, if everything would work properly. Interactive ReaScript could show the current mapping values for example. Last edited by TonE; 11-21-2017 at 07:31 PM. |
![]() |
![]() |
![]() |
#27 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
iReaScript v0.8
+ Added support for multibyte and full-width characters (though they can't be typed directly) ![]() + iReaScript's global print(...) function can now be used from external scripts for debugging ![]() + allow reaper and gfx to be overwritten without crashing + autocomplete multi-dimensional tables + fix table autocompletion when the variable name contains digits + fix table autocompletion when there are more than one spaces surrounding the dot + fix {[1]=1, [255]=2} being displayed as just {1} + redraw the screen only when necessary for reduced CPU usage + show a full traceback when iReaScript crashes iReaScript v0.8.1 + add ctrl+w to erase the current word from the cursor + fix moving the cursor to the start of the previous word (shift+left) with multiple leading whitespaces # fix off-by-one character offsets in double-click whole word selection (0.8 regression) + harden against ill-formed UTF-8 sequences in the history file
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 08-02-2018 at 08:38 AM. |
![]() |
![]() |
![]() |
#28 |
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
![]()
So hot.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :( Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate |
![]() |
![]() |
![]() |
#29 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 10,672
|
![]()
Thnks for the update !
Few things:
![]() :P
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
![]() |
![]() |
![]() |
#30 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
This behavior is similar to common terminal emulators and shells where selection is separate from edit operations.
You can use Ctrl+U to erase to the beginning or Ctrl+W to erase a single word (I've just added the later in 0.8.1): ![]() Shift+Left moves the caret the the start of the current/previous word. For convenience, Ctrl+C copies the whole line when there is no selection.
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 08-02-2018 at 08:35 AM. |
![]() |
![]() |
![]() |
#31 |
Human being with feelings
Join Date: Aug 2015
Posts: 3,747
|
![]()
this seems like it'll be really helpful as i dive into scripts more.
i'm not quite getting it, though. i want to use reaper.TrackFX_GetParam( track, fx, param ) to see the retval of "param." what syntax would i type in order to see that? i keep getting bad argument messages and can't figure out what to input.
__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer |
![]() |
![]() |
![]() |
#32 | |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]() Quote:
To get the first track's first FX's first parameter: Code:
track = reaper.GetTrack(0, 0) reaper.TrackFX_GetParam(track, 0, 0)
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui Last edited by cfillion; 08-02-2018 at 03:11 PM. |
|
![]() |
![]() |
![]() |
#33 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 10,672
|
![]()
@cfillion
Ok so no prolem if it is the expected behavior :P
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
![]() |
![]() |
![]() |
#34 |
Human being with feelings
Join Date: Aug 2015
Posts: 3,747
|
![]()
got it, thanks! great tool.
__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer |
![]() |
![]() |
![]() |
#35 | |
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,067
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#36 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 10,672
|
![]()
Hi !
It seems that \ character become _\ on the console... I was trying to input windows path. :S Thx !
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
![]() |
![]() |
![]() |
#37 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
I can't reproduce that on macOS or Windows (typing a \ inserts only a \). Maybe it's tied to a specific keyboard layout? What does gfx.getchar() and utf8.char(theReturnValueFromGetChar) returns?
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui |
![]() |
![]() |
![]() |
#38 |
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 10,672
|
![]()
Win x10 Azerty keyboard (I press ALT GR + 8 to get \ )
gfx.getchar() returns 0 in your console script, so the utf8 is \0
__________________
Free ReaScripts - Premium Scripts - Custom Scripts Dev - Learn ReaScript - XR Theme - Stash Files - ReaLinks - Website - ReaComics - Alien 2347 - Donation |
![]() |
![]() |
![]() |
#39 |
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 5,365
|
![]()
With an AZERTY layout, pressing AltGr+8 produces a single '\' character in iReaScript here. gfx.getchar returns 92.0 once for it without a leading underscore.
Do you get the same issue in other ReaScripts that use keyboard input?
__________________
🇨🇦 Donate (PayPal) | Sponsor (GitHub) | The Endless Journey (Keyboard Ensemble) ReaPack, a package manager for REAPER | SWS 2.14 is now available in ReaPack [new!] Developer tools: Lua profiler | Interactive ReaScript | ReaPack Editor | ReaImGui |
![]() |
![]() |
![]() |
#40 |
Human being with feelings
Join Date: May 2018
Posts: 13
|
![]()
I confirm the same problem on my side(french azerty keyboard). Actually I have it not only for \ but also for other AltGr keys:
AltGr + 3 => "# AltGr + 4 => '{ AltGr + 5 => ([ AltGr + 6 => -| AltGr + 8 => _\ AltGr + ° => =} AltGr + + => =} The 1st char is the one that is obtained when you don't press AltGr + the concerned key (and the second the one that is expected while pressing AltGr). NB: numbers are what are obtained with shift + <key> I also tested on a GUI build with Scythe V3 and I have the same behavior. The input field event reports 2 key strokes... Config : Reaper 6.15/x64 on Windows 10 (1909). |
![]() |
![]() |
![]() |
Thread Tools | |
|
|