|
|
|
01-12-2015, 06:32 PM
|
#2
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
code documentation updated (and now working :P)
|
|
|
01-19-2015, 01:58 AM
|
#3
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
Update 1.1
Update 1.1 :
- Display "ERROR : Empty String" if a string is NULL (prevent auto-non desired-cleaning of the console)
- Added msg_clean function to reset the console
New code to put a the beginning of your functions :
Code:
// ----- DEBUGGING ====>
//@import X-Raym_Functions - console debug messages.eel
//debug = 0; // 0 => No console. 1 => Display console messages for debugging.
//clean = 0; // 0 => No console cleaning before every script execution. 1 => Console cleaning before every script execution.
//msg_clean();
// <=== DEBUGGING -----
Hope it could help you write some great scripts
EDIT : There was a small bug, it is corrected now !
Last edited by X-Raym; 01-19-2015 at 03:16 AM.
|
|
|
01-21-2015, 07:38 AM
|
#4
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
Hi again !
I made some enhancement to it :P It become serious :P
to define the start of something in particular (put it under msg_clean()
It will display ▼▼▼▼▼ in the console
to define the end of an action (put it last in your script file)
it will display▲▲▲▲▲ in the console
Code:
msg_stl(text,variable,line);msg_dtl(text,variable,line);msg_ftl(text,variable,line);
Text parameters display some text in the console before your variable
Variable parameters is the name of the variable you want to debug
Line parameters is a boolean (1 insert a line after the variable, 0 do nothing);
Use the function according to your variable type.
This way for example, if you want to debug a decimal variable, you just have to write this :
Code:
msg_dtl("My variable value:", decimalVariable, 1)
and it will display this in the console :
Code:
My variable value:
0
-----
Of course, all of these support the debug and clean variable already explained before.
Last edited by X-Raym; 01-28-2015 at 06:11 AM.
|
|
|
02-01-2015, 05:54 AM
|
#5
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
msg_tvold !!
Hi !
I know there is some people out there that use this script (they told me in other thread), so let show you a great update to this !
Context :
I had trouble remembering the function name... msg_stl etc... it looks simple but i, practice, it was hard to remember, especially because the order of the letter was not the order of the argument.
I also needed a function that could override the global debug setting. It is useful if there info that have to be displayed, even is debug is set to 0 (such as instructions).
So,
Introducing,
The multipurpose function
msg_tvold(); !
msg_tvolt, has an nice name name for :
Code:
msg_tvold(text,variable,output,line,debug)
Yes, this time, letters are in the order of the argument ! And because the name is more human friendly, it is way easier to remember !
So what msg_tvold can do ?
Here, from the script itself :
Code:
// MULTI PURPOSE FUNCTION
// Text is string
// Variable is your variable
// Output format are string "s", integer "d", and floating point "f"
// Debug value can be overide localy with 0 and 1.
// Line is bolean
//
// Example:
// msg_tvold("My variable", variableString, "s", 1, debug)
// will ouput in the console :
//
// My variable
// *value of variableString* formated into string
// -----
// Only if global debug is set to 1 in file header.
//
// All variables can be set to 0
So yes, you can output your variable, with title text or not, or only text, with a line or not, and override the global debug value.
5 arguments, that's a lot, but because "tvold", you will always remember it :P
Hope you will like it,
for backward compatibility with script written with older functions, all the previous functions are still in the file
Cheers !
Last edited by X-Raym; 02-01-2015 at 07:57 AM.
|
|
|
02-01-2015, 07:45 AM
|
#6
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,268
|
Very nice X-Raym. Debugging is very important while writing a script.
Maybe it would be good idea to color the debugging functions differently in the notepad++ language file. There are also new functions to include for EEL in REAPER v5
|
|
|
02-01-2015, 07:56 AM
|
#7
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@heda
What new functions do you have in mind ?
Can we color the console output text v5 ?
(when v5 will become more official, I will convert this to LUA)
|
|
|
02-01-2015, 08:08 AM
|
#8
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,268
|
ah sorry I was wrong, you did the walter syntax highlighting and it is spk77 who did the EEL one for notepad++. I was thinking it would be nice to update the file to include new EEL functions too for v5. Your debugging are not official EEL functions but could be colored differently to clearly see those are debugging functions.
by the way... the best way to debug is to use the internal editor in REAPER... But I still like to use Notepad++
|
|
|
02-01-2015, 08:22 AM
|
#9
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@heda
Take this UDL :P
hope you like orange.
Agree that future v5 build in editor is a great tool, I must use it more often. But I like my current editors so I stick with them for the moment :P
|
|
|
02-01-2015, 02:09 PM
|
#10
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,268
|
Thanks. Debugging lines are clearly visible now.
I'm ready for my next scripting adventure
|
|
|
02-01-2015, 03:01 PM
|
#11
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@heda
I am very confident about it, your first try was a huge success !
|
|
|
02-02-2015, 09:24 AM
|
#12
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
1.7
Just updated
Code:
msg_tvold(text,variable,output,line,debug)
with to define output format (rather than just the letter), to be conformed with the other functions conventions !
|
|
|
02-03-2015, 04:18 PM
|
#13
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
I also added wich basicaly do the same thing as msg_tvold, but with 6th bolean parameter to allow display text + variable inline, just like this
Very useful for debugging incrementation variable, just like this
Cheers !
Last edited by X-Raym; 02-10-2015 at 06:25 AM.
|
|
|
02-23-2015, 10:23 AM
|
#14
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
coverting to lua
I'm trying to convert the script in LUA, it is my first attempt in this language.
I'm pretty close to make it work, but I get an error:
Code:
...EL-Scripts\X-Raym_Functions - console debug messages.lua:171: attempt to call a nil value (global 'strlen')
There must be thing I don't know about declaring variables in LUA; or using the strlen function.
I'm stuck with it so... if you want to contribute:
X-Raym_Functions - console debug messages.lua
Any help is welcome :P
Last edited by X-Raym; 02-24-2015 at 05:03 AM.
|
|
|
02-23-2015, 05:29 PM
|
#15
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,268
|
hey! I finally know what this is.
strlen() is Lua 4
in Lua 5 it has changed to string.len()
try this
Code:
mystring = "Hello X-Raym!"
long = string.len(mystring);
reaper.ShowConsoleMsg(mystring .. " has " .. long .. " characters")
|
|
|
02-24-2015, 05:21 AM
|
#16
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
LUA release
This works
And more, it leads me to find all the solutions of the other EEL string function conversion!
So here it is: the LUA version of the script !
X-Raym_Functions - console debug messages.lua
Next step, convert my template :P Should be a bit more tricky as there is loop in it, but I have a good feeling. LUA is indeed pretty human friendly
(I know I shouldn't really speak about LUA here but I don't wont to flood the forum with several posts the same thing. It will confuses every one. People who told me they use this scripts are people I know they use pre-release version of REAPER).
|
|
|
09-16-2015, 04:19 AM
|
#17
|
Human being with feelings
Join Date: Sep 2015
Posts: 63
|
404
Quote:
Originally Posted by X-Raym
|
Tried to download and it's not available ...
|
|
|
09-16-2015, 04:49 AM
|
#18
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@ mduque
Hi !
The link is invalid but the download is still avaible online.
Just go on my script pack in my signature, and download it. You will find it in functions subfolder.
When you create a script, create it in the same folder of the functions script.
I rarely use them anymore thanks to the IDE or to simpler function in Lua.
Putting
Code:
function Msg(variavle)
reaper.ShowConsoleMsg(tostring(variable).."\n")
end
is enough in most cases.
But for eel, yes, it can still be useful :P
ps: please don't quote whole post like that, it is very confusing. =/
|
|
|
07-06-2016, 10:28 PM
|
#19
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
This is so great, X-Raym. Getting into scripting without your tools and tutorials would be damn harder. Thanks!
Still I ask you, since you are ´converted´ to Lua, my purposes are both scripting and JSfx (for Lua ain't realtime). Do you think EEL is still good to go for basic/intermediate scripts? So I can avoid learning two languages.
__________________
Ceanganb
|
|
|
07-07-2016, 03:49 AM
|
#20
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@ceanganb
Cool ! What kind of script are you working on ?
Lua is so much easier than EEL for scripting that I consider that learning the two languages is simpler than only learning EEL and try to use it for ReaScript.
Because the difficulty is not really in learning the language by itself,
it is to learn the different API (ReaScript API and JSFX API), aka the functions provided by REAPER to allow scripting.
Also, please note than Lua can do "realtime thing", there is a lot of Lua script that have a GUI etc...
The difference is JSFX are for effects (audio or midi) and Lua/EEL are for actions (and these actions can have a "real time" display of something).
|
|
|
07-07-2016, 04:57 AM
|
#21
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
Well, it all began with a little project, copying every CC received in any channel to every other channel. But reading the forums and seeing the potential of customization, I started reading your tutorials and plenty of posts and got interested in going deeper.
Main purpose is still MIDI manipulation in realtime, so I guess I should stick with EEL for now. Maybe after getting used to API, I can think of Lua.
I'm still struggling, but I don't think I can stop now.
By the way, how can I use these debug messages in a JSfx? You see, I'm still stuck in the basics
__________________
Ceanganb
|
|
|
07-07-2016, 05:07 AM
|
#22
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@ceanganb
Ok :P
Oh it is for ReaScript, not JSFX,
use the native IDE to have current state of variable with JSFX.
|
|
|
07-07-2016, 05:12 AM
|
#23
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
But in JSFX Programming it says:
"import filename -- REAPER v4.25+
You can specify a filename to import (this filename will be searched within the JS effect directory). Importing files via this directive will have any functions defined in their @init sections available to the local effect."
Can't I adapt? The fact is that I tried many syntaxes and none worked :P
__________________
Ceanganb
|
|
|
07-07-2016, 05:16 AM
|
#24
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@ceanganb
It works if the file type are the same,
JSFX can import other JSFX functions form other file,
EEL can import other EEL functions from other file,
But it seems you are trying to import EEL (ReaScript) function into a JSF, so it can't work.
JSFX and EEL may share the same syntax but they don't use the same function and they don't communicate. It is two very different things.
|
|
|
07-07-2016, 05:18 AM
|
#25
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
But I am using your EEL version.
__________________
Ceanganb
|
|
|
07-07-2016, 05:20 AM
|
#26
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
I even tested it in an EEL script and it worked well!
__________________
Ceanganb
|
|
|
07-07-2016, 05:28 AM
|
#27
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
Ops, I misunderstood your statement, sorry. I see now, sorry.
I'll slowly find my way through these intricacies .
Thank you very much, X-Raym!
__________________
Ceanganb
|
|
|
07-07-2016, 05:35 AM
|
#28
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,900
|
@ceanganb
You have perseverance so I have no doubt you will succeed :P
Good coding !
|
|
|
07-07-2016, 05:42 AM
|
#29
|
Human being with feelings
Join Date: May 2009
Location: Brazil
Posts: 323
|
I'm slow, but I'll get it
Cheers, pal!
__________________
Ceanganb
|
|
|
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 10:55 AM.
|