Old 09-30-2009, 05:45 AM   #1
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default ReaScript - Perl - missing FFI.pm

The zip file in the CPan directory only contains the file FFI.dll , but not the FFI.pm file. Is the FFI.pm file required to use Perl ?
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 09-30-2009, 05:59 AM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,758
Default

oops, yes. FFI.pm is available elsewhere (it's a generic module), but I'll update that zip as well. It may take a day for the CPAN upload to get distributed.

Last edited by schwa; 09-30-2009 at 06:02 AM.
schwa is offline   Reply With Quote
Old 09-30-2009, 11:12 AM   #3
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

Ah, yeah. Thanks, I found it in CPan.

Foreign Function Interface. Sounds like fun more and more. Could be the gateway to conforming tools.

Will some programming examples be coming ?

Is it just "use FFI;" and then firing off the Reaper functions ? Somehow that seems too easy.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom

Last edited by airon; 09-30-2009 at 11:16 AM.
airon is offline   Reply With Quote
Old 09-30-2009, 11:48 PM   #4
snebenan
Human being with feelings
 
Join Date: Jan 2008
Location: Sweden
Posts: 97
Default

airon: Could you give a link to the FFi.pm you are using?
I tried this one
http://svn.openfoundry.org/perlffi/trunk/FFI/
but still no cigar.
//s
snebenan is offline   Reply With Quote
Old 10-01-2009, 05:29 AM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,758
Default

While waiting for the dist to propagate, here is the module needed for Perl ReaScript.
Attached Files
File Type: zip FFI-W32.zip (9.3 KB, 113 views)
schwa is offline   Reply With Quote
Old 10-01-2009, 02:02 PM   #6
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

Yeah, that's the same as what I downloaded. Thanks.

snebenan, I searched for "FFI" in CPan.org and downloaded the tar.gz, where the ffi.pm file was located.

Schwa, I can't get that test to run. When I've chosen my Perl script, hit OK, and then the "Run" button, nothing happens. Nothing happens when I hit the EDIT button as well.

The script is in my Scripts directory in "c:\Users\UserName\AppData\Roaming\REAPER\Scripts\ Test.pl"

Perl can be started from anywhere from any command prompt, so that's there. I ran the script by itself "perl -w test.pl", and no errors apart from the obvious one Snebenan mentions.

I don't know what else to do.

The script looks like this:
Code:
#! /usr/bin/perl -w
#
use FFI;
RPR_APITest();
Btw, this user-centric approach to config data sucks. I had a serious fight with Win7 just to find my data sometimes, because navigating to your own roaming folder requires that "Show Hidden Files" be active in the Folder Options of the Explorer. And forget using any USB installation on a machine like that. It took me a while to find newly created config and setting files, and after a while I just abandoned the idea of using a portable installtion in combination with in an installed one. Win7 spreads shit to an overlay of the program directory ("c:\Users\UserName\AppData\Local\VirtualStore\Pro gram Files (x86)\Reaper"), the directory I mention above and of course the program directory itself. Mess^(!51). Guck! Suddenly I hate Windows for a day.</little offtopic rant> Reaper might as well get its own user management.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom

Last edited by airon; 10-01-2009 at 02:12 PM.
airon is offline   Reply With Quote
Old 10-01-2009, 02:05 PM   #7
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,758
Default

Does it work if you use the action "ReaScript: run" and browse to your script?
schwa is offline   Reply With Quote
Old 10-01-2009, 02:19 PM   #8
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

Yes, then it runs.

Win7 x64 RC, fresh Reaper 3.12pre2 install, ActivateStatePerl from a few days ago.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 10-01-2009, 02:25 PM   #9
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,758
Default

OK, there's some bug with running the script from the action window. For now feel free to play with ReaScript running via the actions "ReaScript: run" or "ReaScript: run last action".


By the way, you don't need any of that header stuff in the script, Reaper will take care of that.
Code:
RPR_APITest();
is a complete ReaScript.
schwa is offline   Reply With Quote
Old 10-01-2009, 02:34 PM   #10
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

Ok , thanks.

"Learning Reascript" ? Llama book mate.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 10-02-2009, 01:47 AM   #11
snebenan
Human being with feelings
 
Join Date: Jan 2008
Location: Sweden
Posts: 97
Default

Thanks for the info Airon, as I mentioned in the prerelase forum I had the same issue as you.

I'm not a big fan of the User/Application data folder either. I'd rather keep it in my Reaper installation folder, or a user specified folder.

Now I just need to think of something more useful than a new way of pressing the playbutton... ;-)
" RPR_Main_OnCommand(1007, 0);"

But it works! =D
//s
snebenan 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 03:34 PM.


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