COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 02-12-2012, 09:42 PM   #1
Fredass
Human being with feelings
 
Join Date: Feb 2012
Posts: 2
Default eel2 documentation

Hi,


I am in the process of switching the expression evaluation part of a personal project to eel2. Being familiar with Milkdrop, this seems much more powerful than what I am currently using.

However, I can't find any documentation of what it does & does not support and on how to use it.

I would be surprised if such a library did not have at least a small bit of documentation.

Can anyone point me in the right direction ?

Thanks !
Fredass is offline   Reply With Quote
Old 02-13-2012, 03:59 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Fredass View Post
Hi,


I am in the process of switching the expression evaluation part of a personal project to eel2. Being familiar with Milkdrop, this seems much more powerful than what I am currently using.

However, I can't find any documentation of what it does & does not support and on how to use it.

I would be surprised if such a library did not have at least a small bit of documentation.

Can anyone point me in the right direction ?

Thanks !
Hello. I am using eel2 in my HourGlass sound processing application to allow generating/transforming sound grain/fragment parameter values and transform incoming MIDI CC messages.

Much of the eel2 language syntax and available function calls is described here (some of the stuff is spesific to the Jesusonic variant made from eel2, but not too much) :

http://www.reaper.fm/sdk/js/js.php#js_basic

The C-API to use eel2 from C or C++ is not terribly complicated, apart from how to add new functions to the eel2 virtual machine. I can write you a small example later today...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 02-13-2012, 04:30 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Here's the example code :

http://pastebin.com/4XrW87aG
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 02-13-2012 at 04:38 AM.
Xenakios is offline   Reply With Quote
Old 02-13-2012, 07:26 AM   #4
Fredass
Human being with feelings
 
Join Date: Feb 2012
Posts: 2
Default

Thanks, exactly what I was looking for.
Fredass is offline   Reply With Quote
Old 02-13-2012, 04:50 PM   #5
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

The code has a misinformed comment, as pointed out by the eel2 developer Justin :

Code:
char codetext[65536]; // this needs to be larger than might be anticipated as eel2 uses this buffer as workspace
Justin said the buffer doesn't need to be larger than the text passed to be compiled plus the terminating null character.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 02-14-2012, 03:49 AM   #6
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

thanks xenakios for this example. I am having some trouble compiling on OSX

Code:
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c: In function 'nseel_asm_2pp':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c:151: error: expected ':' or ')' before 'EEL_F_SUFFIX'
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c: In function 'nseel_asm_1pp':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c:188: error: expected ':' or ')' before 'EEL_F_SUFFIX'
and

Code:
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:65:25: error: fpu_control.h: No such file or directory
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c: In function 'GLUE_CALL_CODE':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: '_FPU_RC_ZERO' undeclared (first use in this function)
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: (Each undeclared identifier is reported only once
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: for each function it appears in.)
this is a 32bit build and I'm only including asm-nseel-x86-gcc.c, not the ppc or msvc versions
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 02-14-2012, 06:33 AM   #7
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by olilarkin View Post
thanks xenakios for this example. I am having some trouble compiling on OSX

Code:
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c: In function 'nseel_asm_2pp':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c:151: error: expected ':' or ')' before 'EEL_F_SUFFIX'
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c: In function 'nseel_asm_1pp':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c:188: error: expected ':' or ')' before 'EEL_F_SUFFIX'
and

Code:
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:65:25: error: fpu_control.h: No such file or directory
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c: In function 'GLUE_CALL_CODE':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: '_FPU_RC_ZERO' undeclared (first use in this function)
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: (Each undeclared identifier is reported only once
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: for each function it appears in.)
this is a 32bit build and I'm only including asm-nseel-x86-gcc.c, not the ppc or msvc versions
Hopefully Justin or someone else familiar with compiling eel2 on OS-X can chime in...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 02-14-2012, 08:47 AM   #8
liteon
Human being with feelings
 
liteon's Avatar
 
Join Date: Apr 2008
Posts: 510
Default

Quote:
Originally Posted by olilarkin View Post
Code:
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c: In function 'nseel_asm_2pp':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c:151: error: expected ':' or ')' before 'EEL_F_SUFFIX'
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c: In function 'nseel_asm_1pp':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/asm-nseel-x86-gcc.c:188: error: expected ':' or ')' before 'EEL_F_SUFFIX'
make sure that for "asm-nseel-x86-gcc.c", EEL_F_SUFFIX is defined to "l" . the definition will normally come from "ns-eel-addfuncs.h", based on EEL_F_SIZE (only 8 should be used). EEL_F_SUFFIX will suffix the AT&T formatted instructions for 32bit integers or 64bit floating point operands.

Quote:

Code:
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:65:25: error: fpu_control.h: No such file or directory
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c: In function 'GLUE_CALL_CODE':
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: '_FPU_RC_ZERO' undeclared (first use in this function)
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: (Each undeclared identifier is reported only once
/Users/oli/Dev/MyPlugins/IPlugExamples/IPlugEEL/../../WDL/eel2/nseel-compiler.c:252: error: for each function it appears in.)
fpu_control.h is used in nseel-compiler.c for some definitions and the function _controlfp that updates the FPU control word (there is function with the same name in float.h/the msvc runtime).

a couple of things can be done here:
1) you can disable the compatibility mode (ns-eel.h: #define NSEEL_EEL1_COMPAT_MODE), which will then define on its own - EEL_NO_CHANGE_FPFLAGS (nseel-compiler.c) and prevent the change of FPU flags for x86, when gluing the code on execution or more specifically setting the RC flag to truncate, calling, then setting the RC flag to the original value (and flushing the pipeline while doing so).
2) while float.h can be used on msvc and mingw, fpu_control.h is a non-standard header, yet it should be available on gcc for linux and osx.
you can simply copy a version of fpu_control.h in the "eel2" directory or create the missing definitions / macros.

EDIT:
here is an example fpu_control.h:
http://frs.web.cern.ch/frs/Source/MA.../fpu_control.h


--

Last edited by liteon; 02-14-2012 at 09:05 AM. Reason: added link
liteon is offline   Reply With Quote
Old 02-15-2012, 01:56 AM   #9
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

hmm, i tried that fpu_control.h, but it tries to #include <features.h> , which is missing

and as far as I can tell EEL_F_SUFFIX is "l" / EEL_F_SIZE is 8 , it seems like EEL_F_SUFFIX is not getting injected by the preprocessor

thanks
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 02-15-2012, 02:44 AM   #10
liteon
Human being with feelings
 
liteon's Avatar
 
Join Date: Apr 2008
Posts: 510
Default

Quote:
Originally Posted by olilarkin View Post
hmm, i tried that fpu_control.h, but it tries to #include <features.h> , which is missing
i think you can just remove the line "#include <features.h>", as it doesn't seem to be needed in the example "fpu_control.h". "features.h" is a gcc specific (non-standard) header that is also missing on some OSes.

--
liteon is offline   Reply With Quote
Old 02-15-2012, 07:03 AM   #11
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Sorry, this is non-obvious, but don't include asm-*.c in your project, just include nseel-cfunc.c which includes the correct version of that file. On x86_64 targets, though, you should include asm-nseel-x64.obj (win64) or asm-nseel-x64-macho.o (osx64) in the project as well.

If you do the above, you shouldn't have to modify eel2 at all...
Justin is offline   Reply With Quote
Old 02-15-2012, 03:00 PM   #12
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Quote:
Originally Posted by liteon View Post
i think you can just remove the line "#include <features.h>", as it doesn't seem to be needed in the example "fpu_control.h". "features.h" is a gcc specific (non-standard) header that is also missing on some OSes.

--
thanks it worked, & thanks justin. Compiling fine now
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin 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 05:22 PM.


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