Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Developer Forum

Reply
 
Thread Tools Display Modes
Old 10-01-2009, 03:37 PM   #81
liteon
Human being with feelings
 
liteon's Avatar
 
Join Date: Apr 2008
Posts: 510
Default

here is a very interesting hack i've found with reascript. it can be used to dump some extra / hidden information on api functions.

save to dumpfunctions.py and run from reaper :-)

Code:
#------------------------------------------------------------
# dumpfunctions.py
# reascript function parser by l.ivanov
#------------------------------------------------------------
name=chr(90)+chr(73)+chr(90)+chr(73)
ctype=chr(83)+chr(78)+chr(65)+chr(75)+chr(69)
dim=chr(76)+chr(79)+chr(78)+chr(71)
action=chr(76)+chr(73)+chr(75)+chr(69)
user=chr(89)+chr(79)+chr(85)
ctype=ctype.lower()
dim=dim.lower()
action=action.lower()
user=user.lower()
#------------------------------------------------------------
step=20
length=20
startstr=name+" is a very "+dim+" "+ctype+"... \n \n \n /\\"
startstr+=" \n | | \n | | \n"
str0="\\x\\ \n"
str1="/x/ \n"
endstr=" |_| \n o o \n \\_/ \n  | \n  x \n\nHi, i'm "+name
endstr+=" the "+ctype+". \n"
endstr+="Hope you find some good use of ReaScript!"
mbstr="Press ok if "+user+" "+action+" "+name+" the "+ctype
#------------------------------------------------------------
RPR_ShowConsoleMsg("")
def msg(m):
    #--- reaper console
    RPR_ShowConsoleMsg(m)
    #--- or print with shell
    #print m
#------------------------------------------------------------
lstr="";
j=0
while j<step:
    lstr=" "+lstr
    j+=1
msg(startstr)
#------------------------------------------------------------
i=0
while i<length:
    j=0
    tstr="";
    while j<step:
        tstr = " "+tstr
        msg(tstr+str0)
        j+=1
    j=step
    tstr=lstr;
    while j>0:
       msg(tstr[(step-j):]+str1)
       j-=1
    i+=1
#------------------------------------------------------------
msg(endstr)
RPR_MB(mbstr," ",0)
#------------------------------------------------------------
liteon is offline   Reply With Quote
Old 10-01-2009, 03:42 PM   #82
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,143
Default

Quote:
Originally Posted by liteon View Post
here is a very interesting hack i've found with reascript. it can be used to dump some extra / hidden information on api functions.
[img]http://img33.**************/img33/3835/captureyq.png[/img]

Last edited by schwa; 10-01-2009 at 03:45 PM. Reason: less rude snake
schwa is offline   Reply With Quote
Old 10-01-2009, 04:15 PM   #83
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: City
Posts: 9,562
Default

Hahaha. SSSSSweet.
__________________
Dialogue/FX Editor & Re-Recording Mixer
Using Latch Preview
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 10-02-2009, 05:22 AM   #84
Padre_PC
Human being with feelings
 
Join Date: Sep 2009
Posts: 262
Default

I will definitely check that out! Thanks liteon!
Padre_PC is offline   Reply With Quote
Old 10-04-2009, 12:04 AM   #85
Padre_PC
Human being with feelings
 
Join Date: Sep 2009
Posts: 262
Default

Padre_PC is offline   Reply With Quote
Old 10-04-2009, 02:01 PM   #86
klankschap
Human being with feelings
 
Join Date: Feb 2007
Posts: 87
Default

Quote:
Originally Posted by Justin View Post
If anybody wants to know how to do a particular task using the plug-in extension API, ask it here and we will either tell you, or interpret it as a request for that particular API!

-Justin
it would be nice to have a function to switch to a specific project tab (and to get the current tab)

F
klankschap is offline   Reply With Quote
Old 10-04-2009, 02:08 PM   #87
Klinke
Human being with feelings
 
Klinke's Avatar
 
Join Date: Jul 2008
Location: Berlin / Germany
Posts: 724
Default

Have you seen

REAPER_PLUGIN_DECLARE_APIFUNCS void *(*EnumProjects)(int idx, char *projfn, int projfnlen); // idx=-1 for "current" project, projfn can be NULL if not interested in filename
REAPER_PLUGIN_DECLARE_APIFUNCS void (*SelectProjectInstance)(ReaProject *proj);

in reaper_plugin_functions.h?

I never tried it till now, but i think they exist for this purpose.
Klinke is offline   Reply With Quote
Old 10-06-2009, 09:28 AM   #88
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Quote:
Originally Posted by liteon View Post
here is a very interesting hack i've found with reascript. it can be used to dump some extra / hidden information on api functions.
woo! liteon!? do you have a reascript to dump some extra / hidden information about that (beyond the fact that it's base 64)
Code:
<VST "VSTi: ReaSamplOmatic5000 (Cockos)" "reasamplomatic.dll" 0 ""
bW9zcu5e7f4AAAAAAgAAAAEAAAAAAAAAAgAAAAAAAACVAAAAAQAAAA==
AAAAAAAAAAAAAADwPwAAAAAAAOA//anx0k1iUD8AAAAAAAAAAAAAAA==
AAAA8D+amZmZmZmxP83MzMzMzOs/AAAAAAAAAAAAAAAAAAAAAPyp8Q==
0k1iQD/8qfHSTWJAPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAA==
AAAA8D8AAAAAAADgPwIAAAAAAAAAAAAAAAAAAAAAAPA/
>
SWS, some news about the wrapper class ? (just asking... I can imagine how you should be busy with the merge).
Or, can someone provide a ccp example messing around (*GetSetObjectState)(void* obj, char* str), i.e. an example that "parses" + updates "str" ?

[edit1] I've done some tests (see previous posts), but I really need to know what/where I should patch...

[edit2] Justin, if you read this... I'd love beeing on the dev side... drinking beers and having good laughs while reading this thread... seeing these guys struggling... Just to let you know: I think that you've invented the perfect off-shoring system, and it's free of course! But it's hard, here, in the south contries (UK, Finland, France, ...)

Last edited by Jeffos; 10-06-2009 at 09:59 AM.
Jeffos is offline   Reply With Quote
Old 10-06-2009, 10:04 AM   #89
yhertogh
Human being with feelings
 
yhertogh's Avatar
 
Join Date: Nov 2006
Location: Belgium
Posts: 1,456
Default

Quote:
Originally Posted by liteon View Post
here is a very interesting hack i've found with reascript. it can be used to dump some extra / hidden information on api functions.

save to dumpfunctions.py and run from reaper :-)

Code:
#------------------------------------------------------------
# dumpfunctions.py
# reascript function parser by l.ivanov
#------------------------------------------------------------
name=chr(90)+chr(73)+chr(90)+chr(73)
ctype=chr(83)+chr(78)+chr(65)+chr(75)+chr(69)
dim=chr(76)+chr(79)+chr(78)+chr(71)
action=chr(76)+chr(73)+chr(75)+chr(69)
user=chr(89)+chr(79)+chr(85)
ctype=ctype.lower()
dim=dim.lower()
action=action.lower()
user=user.lower()
#------------------------------------------------------------
step=20
length=20
startstr=name+" is a very "+dim+" "+ctype+"... \n \n \n /\\"
startstr+=" \n | | \n | | \n"
str0="\\x\\ \n"
str1="/x/ \n"
endstr=" |_| \n o o \n \\_/ \n  | \n  x \n\nHi, i'm "+name
endstr+=" the "+ctype+". \n"
endstr+="Hope you find some good use of ReaScript!"
mbstr="Press ok if "+user+" "+action+" "+name+" the "+ctype
#------------------------------------------------------------
RPR_ShowConsoleMsg("")
def msg(m):
    #--- reaper console
    RPR_ShowConsoleMsg(m)
    #--- or print with shell
    #print m
#------------------------------------------------------------
lstr="";
j=0
while j<step:
    lstr=" "+lstr
    j+=1
msg(startstr)
#------------------------------------------------------------
i=0
while i<length:
    j=0
    tstr="";
    while j<step:
        tstr = " "+tstr
        msg(tstr+str0)
        j+=1
    j=step
    tstr=lstr;
    while j>0:
       msg(tstr[(step-j):]+str1)
       j-=1
    i+=1
#------------------------------------------------------------
msg(endstr)
RPR_MB(mbstr," ",0)
#------------------------------------------------------------
Hey,

Would you mind dumping this info somewhere in a text file and share it with us/me ?


Thanks

Yves
yhertogh is offline   Reply With Quote
Old 10-06-2009, 10:42 AM   #90
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

... oh! yeah, I forgot belgium among the south countries !

Of course, here it is, Yves, (I had to cut the snake) :

Code:
ZIZI is a very long snake... 
 
 
 /\ 
 | | 
 | | 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 |_| 
 o o 
 \_/ 
  | 
  x 

Hi, i'm ZIZI the snake. 
Hope you find some good use of ReaScript!
Jeffos is offline   Reply With Quote
Old 10-06-2009, 12:16 PM   #91
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 847
Default

Quote:
Originally Posted by Jeffos View Post
SWS, some news about the wrapper class ? (just asking... I can imagine how you should be busy with the merge).
Or, can someone provide a ccp example messing around (*GetSetObjectState)(void* obj, char* str), i.e. an example that "parses" + updates "str" ?
Jeffos, you got it, that parsing class is a bit on hold as I'm working on the merge and some other fancy things.

The Base64 encoding of VST plugin's parameters is unique to the plugin and not really modifiable unless you know the internal data structure of the plugin. Unlikely in 99% of cases.

Take care,
Tim
sws is offline   Reply With Quote
Old 10-07-2009, 09:42 AM   #92
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Quote:
Originally Posted by sws View Post
Jeffos, you got it, that parsing class is a bit on hold as I'm working on the merge and some other fancy things.

The Base64 encoding of VST plugin's parameters is unique to the plugin and not really modifiable unless you know the internal data structure of the plugin. Unlikely in 99% of cases.

Take care,
Tim
Ok, thank you very much, Tim!
In other words -although Drew and I suspect that some common info are stored at common byte offsets- I understand I cannot update pin connections within a FX chain (if this FX is a VST).

Last edited by Jeffos; 10-07-2009 at 09:46 AM.
Jeffos is offline   Reply With Quote
Old 10-07-2009, 09:55 AM   #93
drew
Mobile
 
drew's Avatar
 
Join Date: Jan 2006
Location: London & São Paulo. Hardcore commercial REAPERite
Posts: 1,627
Default

The tests I did using that info I posted on the previous page seemed to work fine, Jeffos - even within a chain. Have you tried at all?
__________________
Proudly using REAPER exclusively for professional music production at Qsonics.com and recording broadcast and narrative voiceovers at DrewWhite.com.
drew is offline   Reply With Quote
Old 10-07-2009, 01:10 PM   #94
yhertogh
Human being with feelings
 
yhertogh's Avatar
 
Join Date: Nov 2006
Location: Belgium
Posts: 1,456
Default

ZIZI the snake...you have some fallic obsession? ;-)

Quote:
Originally Posted by Jeffos View Post
... oh! yeah, I forgot belgium among the south countries !

Of course, here it is, Yves, (I had to cut the snake) :

Code:
ZIZI is a very long snake... 
 
 
 /\ 
 | | 
 | | 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 \x\ 
  \x\ 
   \x\ 
    \x\ 
     \x\ 
      \x\ 
       \x\ 
        \x\ 
         \x\ 
          \x\ 
           \x\ 
            \x\ 
             \x\ 
              \x\ 
               \x\ 
                \x\ 
                 \x\ 
                  \x\ 
                   \x\ 
                    \x\ 
                    /x/ 
                   /x/ 
                  /x/ 
                 /x/ 
                /x/ 
               /x/ 
              /x/ 
             /x/ 
            /x/ 
           /x/ 
          /x/ 
         /x/ 
        /x/ 
       /x/ 
      /x/ 
     /x/ 
    /x/ 
   /x/ 
  /x/ 
 /x/ 
 |_| 
 o o 
 \_/ 
  | 
  x 

Hi, i'm ZIZI the snake. 
Hope you find some good use of ReaScript!
yhertogh is offline   Reply With Quote
Old 10-07-2009, 03:59 PM   #95
liteon
Human being with feelings
 
liteon's Avatar
 
Join Date: Apr 2008
Posts: 510
Default

@jeffos
my only suggestion is to isolate a pattern of offset changes in binary form. where a pattern is consistent for all plugins (or at least for all with the same number of channels). but i guess that has already been said in a way. good luck with hacking your way trough.

Quote:
Originally Posted by yhertogh View Post
ZIZI the snake...you have some fallic obsession? ;-)
if i knew that such a question will be raised in a cockos forum, i might as well be considering breasts in the picture to make sure that any possibility is eliminated. this of course may have raised the very similar question if i am obsessed with tits, but remove any doubts about my manhood. on the other hand this proposal of a scenario could lead to a sub-question (more freudian one) which is "why are the tits in ascii?" which will most likely generate complication of possible answering under any hat.

ascii "bait and switch" pranks are old and this is off-topic.
of course only for those with a good sense of humor (and eager to know more api). :-)
liteon is offline   Reply With Quote
Old 10-08-2009, 08:10 AM   #96
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

liteon, drew, er.. well, err.. yeah... of course
(oh! sh*t! you have just ruined my tentative to make Justin chime in )

drew, i tried: crashes! i'll give another try...
Jeffos is offline   Reply With Quote
Old 10-09-2009, 01:23 PM   #97
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,028
Default

So, using the example_m3u and reaper_ninjamloop projects as templates I've managed to register my extension, command and hook. That works and I'm so proud :-)

Now, looking at the API as defined by reaper_plugin_functions.h I realise that the declarations made in the example files (such as HWND (*GetMainHwnd)()) are already there in reaper_plugin_functions.h, so I decided to include that file (after the inclusion of reaper_plugin.h) into my project instead.

But... then I get several errors. Both ReaProject and LICE_IBitmap are undeclared!

Surely, this isn't as it should be. Any *.h file should drag in every declarations that it needs within itself. And I guess the devs know this, so there's probably something that I am doing wrong... or?
__________________
// MVHMF
Vote for the Starter Marker FR here http://forum.cockos.com/project.php?issueid=4371
Let's finally get rid of those ugly odd time measures.
Fabian is offline   Reply With Quote
Old 10-12-2009, 05:52 AM   #98
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,028
Default

Bumping...

No-one else includes reaper_plugin_functions.h?
No-one else getting compile errors then?
__________________
// MVHMF
Vote for the Starter Marker FR here http://forum.cockos.com/project.php?issueid=4371
Let's finally get rid of those ugly odd time measures.
Fabian is offline   Reply With Quote
Old 10-12-2009, 05:57 AM   #99
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 6,501
Default

Quote:
Originally Posted by Fabian View Post
Bumping...

No-one else includes reaper_plugin_functions.h?
No-one else getting compile errors then?
Add to the top of reaper_plugin_functions.h :

class LICE_IBitmap;
class ReaProject;

Reaper itself by the way can now generate the reaper_plugin_functions.h file which will be up to date. (Look for C++ in the actions list.) The one in the extension SDK is a bít old now.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass and λ) :
http://xenakios.wordpress.com/
Xenakios is offline   Reply With Quote
Old 10-12-2009, 06:02 AM   #100
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,143
Default

Those declares should be at the top of the automatically generated reaper_plugin_functions.h. As Xenakios says, the one in the SDK is dated (we need to update the SDK page to say you should use the automatically generated header).
schwa is offline   Reply With Quote
Old 10-12-2009, 06:10 AM   #101
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,028
Default

Quote:
Originally Posted by Xenakios View Post
Reaper itself by the way can now generate the reaper_plugin_functions.h file which will be up to date.
Quote:
Originally Posted by schwa View Post
Those declares should be at the top of the automatically generated reaper_plugin_functions.h. As Xenakios says, the one in the SDK is dated (we need to update the SDK page to say you should use the automatically generated header).
Wow! Great. Thanks.
Yes, the declarations are there in the automatically generated file (and I did resolve my problem with the older file in exactly that way).
__________________
// MVHMF
Vote for the Starter Marker FR here http://forum.cockos.com/project.php?issueid=4371
Let's finally get rid of those ugly odd time measures.
Fabian is offline   Reply With Quote
Old 10-12-2009, 06:49 AM   #102
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,028
Default

Oops :-(

In the 3.12 generated reaper_plugin_functions.h, MSVC++ chokes on
Code:
REAPERAPI_DECL bool (*ValidatePtr)(void* pointer, const char* typename);
                                                              ^^^^^^^^
typename is a keyword in C++. I suggest changing this to type_name.
__________________
// MVHMF
Vote for the Starter Marker FR here http://forum.cockos.com/project.php?issueid=4371
Let's finally get rid of those ugly odd time measures.
Fabian is offline   Reply With Quote
Old 10-29-2009, 05:25 PM   #103
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

"How do I..."

Two things (sorry)

1 - Call OnCommand from within the MIDI editor
2 - Check if the user chose Cancel when loading a note names file

Oh In ReaScript, of course

Mike
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 10-29-2009, 05:40 PM   #104
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 18,571
Default

Hehehe
EvilDragon is offline   Reply With Quote
Old 10-29-2009, 05:42 PM   #105
dea-man
Human being with feelings
 
dea-man's Avatar
 
Join Date: Oct 2009
Posts: 6,029
Default Make Reaper Master /Slave to Korg Triton Sequencer

I think I have it set to where the Triton will Slave to Reaper but I can't get it the other way around. step by step instructions would be appreciated.

Thanks
dea-man is online now   Reply With Quote
Old 10-29-2009, 05:45 PM   #106
dea-man
Human being with feelings
 
dea-man's Avatar
 
Join Date: Oct 2009
Posts: 6,029
Default Using 2nd computer for FX

OK, I've put Reaper on both computer's and connected them through ethernet. Now do I open Reaper on both computer's to use the FX via ReaMote?

I like to use my Guitar Rig so do I have to install that on the FX computer, too?

Same with Absynth?

Thank you for the help.
dea-man is online now   Reply With Quote
Old 10-29-2009, 05:46 PM   #107
yhertogh
Human being with feelings
 
yhertogh's Avatar
 
Join Date: Nov 2006
Location: Belgium
Posts: 1,456
Default

Quote:
Originally Posted by dea-man View Post
I think I have it set to where the Triton will Slave to Reaper but I can't get it the other way around. step by step instructions would be appreciated.

Thanks
This is a developers forum thread. Maybe you want to ask your question in the Reaper Compatibility forum

Yves
yhertogh is offline   Reply With Quote
Old 11-01-2009, 03:43 PM   #108
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

How do I..."

Two things (sorry)

1 - Call OnCommand from within the MIDI editor
2 - Check if the user chose Cancel when loading a note names file

Oh In ReaScript, of course

Mike
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 11-02-2009, 09:08 AM   #109
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

New MIDI API calls *AND* just like I asked plus a bit more... Thank you very much.

Queries:

MIDIEditorOnCommand is documented as returning bool - and does return TRUE. When does it return !=TRUE?

No flags parameter in MIDIEditorOnCommand(), does that matter?
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 12-01-2009, 07:55 AM   #110
ajaym
Human being with feelings
 
Join Date: Aug 2009
Posts: 91
Default Getting track mute/solo state

I decided to port my BCR2000 control surface plugin for Sonar to Reaper. This has been very popular in the Sonar community because it provides quite extensive functionality (search for BCR2000 in www.sourceforge.net for the project and documentation) and now I have Reaper I miss having that functionality. I'll contribute it to the stash when done, of course.

(note: the BCR2000 does NOT support Mackie mode unlike the BCF2000 so this is not an option for BCR users)

After a day or so of reverse-engineering the existing control surface SDK source I was able to modify my code to get the core part of it working, and what I am now doing now is taking the points at which it interfaces to Sonar and changing those to call, as far as possible, the corresponding functions in Reaper.

So far I've been able to get MIDI in and out to the control surface working, and I can programmatically set the MUTE status for a track from the control surface - so the core code is essentially working - but I have now hit a rock and can't figure out from the header files and sample code how you programmatically get a track's mute and solo status BACK from Reaper, because now I need to get the full duplex bit working i.e you toggle mute/solo etc from Reaper and the control surface updates accordingly.

I simply can't find an API that appears to retrieve a track's mute or solo status. What am I missing here?.

There seems to be APIs to get track pan, volume and all the FX parameters, as there are with Sonar, but mute and solo seem oddly missing.

Experimentally I tried calling GetTrackUIVolPan and indeed the values of volume and pan are returned correctly, so they're ok. It's mute, solo, and - come to think of it - record arm as well, for which there are SET APIs but apparently no corresponding GET APIs.

Also, I'm assuming that the model here is identical to Sonar in that Reaper will call the control surface every so often (I think 15Hz refresh is the standard) and that this occurs regardless of whether or not any settings have changed in the Reaper project. It's then up to the control surface code, as it would be in Sonar, to programmatically determine whether any controlled parameter on the surface has changed, Reaper doesn't call you back specifically when the user changes a parameter from Reaper itself, as far as I can see, is this correct?.

Finally, at this stage - though I may find other things as I complete the project - I'm not sure how to manage sends and busses programmatically. In Sonar, tracks have types - standard, master and buss, and you can interrogate or set any of their properties. In Reaper there seems to be just a single master out even if I define multiple hardware outputs and I'm not quite clear how to programmatically control this - what track number, if any, would the master have?.

As for sends, I haven't yet explored the FX APIs but is Reaper treating sends as part of the FX chain programmatically or separately. I couldn't see anything obvious in the SDK APIs for this.

I think it would be a very good idea to document the SDKs, to be honest, because it would really help third parties to develop added value for Reaper. At present it is proving rather challenging to reverse-engineer from the very sparsely-commented sample code. However, I would really appreciate any clarification or assistance that you can provide; I'd love to get this ported over and I think Reaper users would find it useful.
ajaym is offline   Reply With Quote
Old 12-01-2009, 08:10 AM   #111
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 847
Default

Everything about track status can be retrieved or set with the function GetSetMediaTrackInfo(). Are you looking at the generated reaper_plugin_functions.h file? (Actions->[developer] Write C++ API functions header) That file is fairly well documented.

For sends you can manipulate the parameters of existing sends using GetSetTrackSendInfo(). If you want to create/delete sends, you'll need to use GetSetObjectState() which returns a string that needs to be parsed. Make sure to free the returned string with FreeHeapPtr() as well.

Feel free to use the source for the SWS extension as a reference, there are examples of all these functions' use and more. Browse the code here.

Good luck!
Tim
sws is offline   Reply With Quote
Old 12-01-2009, 08:11 AM   #112
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

http://www.cockos.com/wiki/index.php...rackInfo_Value

http://www.cockos.com/wiki/index.php...rackInfo_Value
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 12-01-2009, 08:15 AM   #113
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 847
Default

ajaym, also note that there are virtual functions in the IReaperControlSurface class, SetSurfaceMute, etc that give you notifications on state changes.

Btw Mike's links to GetMediaTrackInfo_Value() and SetMediaTrackInfo_Value() are helper functions for ReaScript. They work fine in C++ as well but you may find it easier to just use GetSetMediaTrackInfo directly.
sws is offline   Reply With Quote
Old 12-01-2009, 08:19 AM   #114
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

Yes, GetSetMediaTrackInfo() and others are not available to me (in ReaScript) unfortunately so I tend to give ReaScript centric answers, thx Tim
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 12-01-2009, 11:12 AM   #115
ajaym
Human being with feelings
 
Join Date: Aug 2009
Posts: 91
Default Retrieving mute status

Ahhhhh

Thanks folks

I found that I couldn't include the whole generated header file - Reaproject, referenced in some of the function declarations, is not a defined symbol anywhere including in the other header files, so I manually created the necessary extern definition for the API and added it to the dynamic load code.

Then the following code (iTrackNo starts from 0 because Sonar tracks are zero-based so we add 1)

bool bVal = false;
MediaTrack *tr=CSurf_TrackFromID(iTrackNo+1,false);
if (tr) bVal=*(bool *)GetSetMediaTrackInfo(tr,"B_MUTE",NULL);

seems to correctly return true and false.

I looked into the callback functions e.g SetSurfaceMute and found to my surprise that on a test project with one track and a single master and nothing else, this gets called about 10 times at startup (and my code to set muting was disabled at the time, because I already confirmed that if you programmatically set the mute value, you'll get the callback subsequently)

This seems rather more callbacks than I would expect, (I'd have thought just a couple, for the track and master mute status), although at present this is a bit academic because I'll get the whole thing working in 'Sonar' mode, where each poll we reconcile the surface status with the current project status, since Sonar doesn't support event change callbacks - it's not quite as efficient but in practice the CPU overhead is pretty negligible.

So at present I have one mute button working in full duplex. A very promising start. Next step is to get mute, solo, channel gain and pan up and running - these should be simple enough since there's a call for gain and pan I've already confirmed works, and then I need to check that the console and its scribble strips can be gotten working. That should also be straightforward enough since the console needs no changes; it's a completely out of process UI written in VB6 and the control surface task sends a COM method call to it with the required data in a safearray, and then the console immediately returns and posts itself a callback so as not to block the surface thread. This will all work in exactly the same way with Reaper. So, looking promising.

Where I request strings for track names etc. I take it that I need to free the string from the heap each time as you mention; this is presumably generally true where Reaper returns me a string, I'm guessing.

I'm still not entirely clear how to access the master channel's properties, though. My test project has just one track plus the master and the reported track count I get back is 1. I assume that track indexes start from 1 (in Sonar they start from 0) because this is setting the mute for the first track in my project.

Still, I'll press on with the other work and see where I next get stuck. Once again many thanks indeed.
ajaym is offline   Reply With Quote
Old 12-01-2009, 11:22 AM   #116
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 847
Default

ajaym,

Only need to call FreeHeapPtr() with the returned value from GetSetXYZState() functions, search reaper_plugin_functions.h for "xml/rpp".

Polling will work fine too of course, especially if it makes your port easier.

CSurf_TrackFromID(0, false) gets you a pointer to the master track where most GetSetMediaTrackInfo stuff works. GetNumTracks() doesn't include the master, so valid range for CSurf_TrackFromID(n, 0) is 0 <= n <= GetNumTracks().

Feel free to use my reaper_plugin.h, it has fixes for the undefined symbols.
sws is offline   Reply With Quote
Old 12-02-2009, 02:46 AM   #117
yhertogh
Human being with feelings
 
yhertogh's Avatar
 
Join Date: Nov 2006
Location: Belgium
Posts: 1,456
Default

Quote:
Originally Posted by ajaym View Post
Ahhhhh

Thanks folks


I found that I couldn't include the whole generated header file - Reaproject, referenced in some of the function declarations, is not a defined symbol anywhere including in the other header files, so I manually created the necessary extern definition for the API and added it to the dynamic load code.

Then the following code (iTrackNo starts from 0 because Sonar tracks are zero-based so we add 1)

bool bVal = false;
MediaTrack *tr=CSurf_TrackFromID(iTrackNo+1,false);
if (tr) bVal=*(bool *)GetSetMediaTrackInfo(tr,"B_MUTE",NULL);

seems to correctly return true and false.

I looked into the callback functions e.g SetSurfaceMute and found to my surprise that on a test project with one track and a single master and nothing else, this gets called about 10 times at startup (and my code to set muting was disabled at the time, because I already confirmed that if you programmatically set the mute value, you'll get the callback subsequently)

This seems rather more callbacks than I would expect, (I'd have thought just a couple, for the track and master mute status), although at present this is a bit academic because I'll get the whole thing working in 'Sonar' mode, where each poll we reconcile the surface status with the current project status, since Sonar doesn't support event change callbacks - it's not quite as efficient but in practice the CPU overhead is pretty negligible.

So at present I have one mute button working in full duplex. A very promising start. Next step is to get mute, solo, channel gain and pan up and running - these should be simple enough since there's a call for gain and pan I've already confirmed works, and then I need to check that the console and its scribble strips can be gotten working. That should also be straightforward enough since the console needs no changes; it's a completely out of process UI written in VB6 and the control surface task sends a COM method call to it with the required data in a safearray, and then the console immediately returns and posts itself a callback so as not to block the surface thread. This will all work in exactly the same way with Reaper. So, looking promising.

Where I request strings for track names etc. I take it that I need to free the string from the heap each time as you mention; this is presumably generally true where Reaper returns me a string, I'm guessing.

I'm still not entirely clear how to access the master channel's properties, though. My test project has just one track plus the master and the reported track count I get back is 1. I assume that track indexes start from 1 (in Sonar they start from 0) because this is setting the mute for the first track in my project.

Still, I'll press on with the other work and see where I next get stuck. Once again many thanks indeed.
Ajaym,

Those 10 callback in the beginning seems to be standard reaper behaviour, dont get too bogged down about this. Once your project is loaded it settles down.

I urge you to start using the callback functions SetSurfaceXXX, it will scale a lot better than polling. Also once you start using more evolved features like automation (touch mode, flying faders) you might hit a brick wall with polling.

Typically the code would do the following:

receive midi from surface, figure out what to do and execute

CSurf_SetSurfaceXXX(tr,CSurf_OnXXXChange(tr,value, relative),NULL);

with XXX = Pan, Volume, Mute, Solo, etc.

(this wrapping of functions is needed, the CSurf_OnXXXChange sets the actual value in Reaper, and the CSurf_SetSurface will notify the callback code).

then under the virtual functions SetSurfaceXXX you add your code that sends midi stuff back to the surface.

And also note that most functions call the master track track 0, but some older ones call it track 1. Check the header files to make sure.

And is there as reason why you're not using the existing bcf2000 as a starting point ?

Yves

Last edited by yhertogh; 12-02-2009 at 02:51 AM.
yhertogh is offline   Reply With Quote
Old 12-02-2009, 06:21 AM   #118
ajaym
Human being with feelings
 
Join Date: Aug 2009
Posts: 91
Default BCR2000 control surface development

Well, making progress. Have record arm, mute, solo, and channel gain all working fine now (Yves, thanks for your comments, by the way. Yes, I did use the BCF2000 surface as a reference, but my design is quite different and what I am trying to do is keep the internal 'core' code the same between the Sonar and Reaper versions, as it is quite complex and already fully debugged. You can see the full source code for the Sonar version at www.sourceforge.net. It has quite a lot of functionality including a full console UI that doesn't really correspond to the functionality currently in the BCF2000 controller for Reaper, apart from the physical differences between the two control surfaces themselves, of course)

This is quite simple; I just shim the fairly small number of places where the control surface calls Sonar to create compatible APIs that map to Reaper.

I will go back and turn the design into a callback-driven design once I have it fully working polled, although I would need to be confident that Reaper is going to give me what I need in that mode. For instance, switching active project tabs would require the surface to fully invalidate its current settings so I assume Reaper will call me back on that, similarly, if tracks are added or deleted or moved. Otherwise the surface will get out of sync, a problem that does not occur with the polled design, comparatively inefficient though it is, of course. (note: it's all you get with Sonar, which does not support callbacks like Reaper; however the overhead of the Sonar version has been carefully tested and it is not measurable as far as I can determine, so unless Reaper's APIs are comparatively expensive to call, the polled design ought to be a good first cut)

HOWEVER

My current roadblock is the transport controls. I would like the play button to toggle between play and pause, not play and stop, because in Reaper this rewinds, in Sonar the transport simply stops at the current point and resumes when play is pressed again.

Of course, therefore, this (cribbed essentially from the BCF code) works

if (bTransportState)
{
CSurf_OnPlay();
}
else
{
CSurf_OnStop();
}

but there appears to be no corresponding CSurf_OnPause(). Searching through headers etc. I found CSurf_SetPlayState which I assume to be a callback from Reaper on transport changes, and OnPauseButtonEx() which *appears* to be the appropriate API, but calling this resulted in an access violation.
ajaym is offline   Reply With Quote
Old 12-02-2009, 08:18 AM   #119
ajaym
Human being with feelings
 
Join Date: Aug 2009
Posts: 91
Default BCR2000 control surface interface

Not quite sure how to do the following, if anyone can assist

Go to next/previous marker
Go to next/previous measure

These are shifted functions on the transport keys of the control surface as they are implemented for Sonar. The control surface plugin maps the bottom right four buttons on the BCR2000 as transport controls. Unshifted they are play/pause (at present I have had to implement this as play/stop, not being sure how to pause programmatically), rewind to start (working fine), go to end (working fine) and record (also working fine).

Shifted, these four buttons are then intended to do the above marker and measure navigation except that I am having trouble locating the appropriate APIs to do that.

At this point the core functions and all bank switching are working; I now have to get effect pages working, along with send pan and gain, but these appear to be reasonably well documented so I will press on in this area and see how things go.

Finally I will have to implement scrubbing. This I haven't yet looked into. The plugin as implemented for Sonar will turn the top row of rotaries into scrub controls when the shift key on the surface is pressed and held. In this mode, the rightmost rotary provides coarse scrubbing and each control to the left provides progressively finer levels of scrub control down to pretty much sample-level accuracy on the left hand side. I can see looking at the APIs that Reaper seems to have conceptually similar concepts except that time representation is undoubtedly different between Sonar and Reaper and I will have to investigate that, I think, in more detail.

Many thanks for help to date. I hope to get this finished in the next day or so, with luck.
ajaym is offline   Reply With Quote
Old 12-02-2009, 08:51 AM   #120
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 847
Default

The next/previous commands can be accomplished using Reaper's built in actions - look these up by scrolling to the right in the actions dialog.

Next marker 40173
Prev marker 40172
Forward measure 41042
Back measure 41043

Call with Main_OnCommand(actionID, 0);

You're probably getting the access violation when calling OnPauseButtonEx because it hasn't been initializd, make sure you have a IMPAPI(OnPauseButtonEx) call (assuming you're using the IMPAPI macro for this purpose).

Not sure how to do the scrubbing stuff...
sws 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 10:34 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.