Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 05-12-2008, 06:23 AM   #41
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 857
Default Docker

How do I make a window that can be docked? In other words, can you add the interface for "DockWindow"? Thanks!

EDIT: EnsureNotCompletelyOffscreen would be nice to know about, too.

Last edited by sws; 05-15-2008 at 09:34 AM.
sws is offline   Reply With Quote
Old 05-15-2008, 02:09 AM   #42
pablo
Human being with feelings
 
Join Date: May 2008
Posts: 1
Default vst .cfg .ini

Hello, maybe you could help me.

I'm currently working on vst plugins and i need them to load .cfg files.
A .ini file tell the plug where is the .cfg, but the .ini file doesn't seem to load.

Do you have any ideas about that issue ?

thanks a lot.
pablo is offline   Reply With Quote
Old 05-17-2008, 11:08 PM   #43
Shan
Human being with feelings
 
Shan's Avatar
 
Join Date: Mar 2007
Location: Vancouver
Posts: 2,279
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
What would be a good starting point for a newbie to add a few new actions or two? I'm an intermediate developer with the AHK scripting language and also the audio programming language called Csound...and I use to input hex values on tiny LCD hardware synth displays back in the day, which was quite the PITA.

Shane
__________________
"Music should be performed by the musician not by the engineer."

Michael Wagener 25th July 2005, 02:59 PM
Shan is offline   Reply With Quote
Old 05-19-2008, 09:48 PM   #44
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Shan View Post
What would be a good starting point for a newbie to add a few new actions or two? I'm an intermediate developer with the AHK scripting language and also the audio programming language called Csound...and I use to input hex values on tiny LCD hardware synth displays back in the day, which was quite the PITA.

Shane
The insert random Ninjam Loop example in the SDK served me well, I've furiously built my code over it in the past couple of months...

It demonstrates how to add new menu entries to the Reaper menu, how to create a simple win32 dialog and handle it's messages, how to import and use the Reaper Extension API functions from Reaper and probably some other points as well...

I could probably make my own source code public if it wasn't such a horrendous mess that would confuse the hell out of anyone looking at it...
__________________
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 05-20-2008, 12:20 AM   #45
Deric
Human being with feelings
 
Join Date: Mar 2007
Posts: 794
Default

Xenakios,

That's great to know - thanks very much for the info

I'll be sure to take a look at that stuff when I'm a bit more conversant with the stuff I'm doing/have-been-doing.

Thanks Xenakios

Deric.
__________________
REAPER? Oh yes...
Deric is offline   Reply With Quote
Old 05-21-2008, 01:49 AM   #46
Shan
Human being with feelings
 
Shan's Avatar
 
Join Date: Mar 2007
Location: Vancouver
Posts: 2,279
Default

Quote:
Originally Posted by Xenakios View Post
The insert random Ninjam Loop example in the SDK served me well, I've furiously built my code over it in the past couple of months...

It demonstrates how to add new menu entries to the Reaper menu, how to create a simple win32 dialog and handle it's messages, how to import and use the Reaper Extension API functions from Reaper and probably some other points as well...
Thanks Xen! I'll check that out. That is basically how I learnt Csound and AHK scripting. After scratching my head over the syntax etc, I just started to look a good examples of code and things started to fall into place. I'll have a look at that.

Quote:
Originally Posted by Xenakios View Post
I could probably make my own source code public if it wasn't such a horrendous mess that would confuse the hell out of anyone looking at it...
I hear ya on that one mate. I have a few AHK scripts that I wouldn't even show Bevoss cuz they are quite the work of Spaghetti code.

Shane
__________________
"Music should be performed by the musician not by the engineer."

Michael Wagener 25th July 2005, 02:59 PM
Shan is offline   Reply With Quote
Old 05-25-2008, 07:15 AM   #47
shaman
Human being with feelings
 
Join Date: Mar 2008
Posts: 56
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!
Hi Justin,

I'd like to know how to access time markers.
An ability to read and write their properties such as Position, BPM and time signature would be great. I've seen there is

TimeMap_timeToQN, TimeMap_QNToTime, TimeMap_GetDividedBpmAtTime,

on the todo's list in reaper_plugin_functions.h i think this comes close to what i'm looking?
Still, a function returning a list or array of marker structs and an OnTimeMapUpdate to pump the modified list back into reaper would be better (i think sws would like something for 'normal' markers as well ).


I thought of attacking this FR: http://www.cockos.com/forum/showthread.php?t=4157 as far as i know it has not been resolved yet.
I need a function to recalc the BPM for markers and update them. In fact this function is almost there: 'Markers: Time signature measure from time selection' but the problem with this is that, the markers on both ends are updated, where only the left marker should.
For making a Drag-Drop Time marker completely transparent in Reaper, a TimeMarkerChanged call coming in from Reaper after the drop, would be perfect

cheers!
shaman is offline   Reply With Quote
Old 05-25-2008, 11:18 AM   #48
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by shaman View Post

TimeMap_timeToQN, TimeMap_QNToTime, TimeMap_GetDividedBpmAtTime,
I don't know what the 3rd function of these does but the first two are for converting between beats/seconds-based times, taking into account the tempo changes of the project. They both take in a double floating point value and return a double floating point value.

Proper APIs to add/edit/delete markers/regions/time signature+tempo changes would be great!
__________________
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 07-11-2008, 10:07 PM   #49
frog_jr
Human being with feelings
 
frog_jr's Avatar
 
Join Date: Sep 2007
Location: Here at the Western World
Posts: 1,253
Default

Hi, I want to make a AHK script to autosave plugin presets. First thing is, how do I get the name of the active plugin into my Windows clipboard? I've made a very simple script that does that, but it's just tabbing through the plugin window etc. which is too crude. Any advice?
frog_jr is offline   Reply With Quote
Old 07-11-2008, 10:38 PM   #50
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by frog_jr View Post
Hi, I want to make a AHK script to autosave plugin presets. First thing is, how do I get the name of the active plugin into my Windows clipboard? I've made a very simple script that does that, but it's just tabbing through the plugin window etc. which is too crude. Any advice?
It may be you don't have other choice than to use such crude solutions with AHK... Some things currently require similar (or, well, a bit more advanced) methods to be used with C++ extension plugin code also...
__________________
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 07-12-2008, 05:40 AM   #51
frog_jr
Human being with feelings
 
frog_jr's Avatar
 
Join Date: Sep 2007
Location: Here at the Western World
Posts: 1,253
Default

Well, thanks anyway. Should anybody come up with any ideas, I'd appreciate. Cheers, frog

FWIW, here is the AHK script. But anybody that can do AHK even just a little bit doesn't need to know this. :-).

;-----------------------
*3:: ; quicksave selected effect as fxp
{
send {f2}
sleep, 500
send ^c
sleep, 500
send {escape}
sleep, 500
send {tab}{tab}{tab}{tab}{tab}
sleep, 500
send {return}
sleep, 500
send {down}{return}
sleep, 500
send ^v --
sleep, 500
clipboard = %A_Hour%.%A_Min%.%A_Sec%
sleep, 500
send ^v
send {return}
}
;--------------------------

Last edited by frog_jr; 07-12-2008 at 11:14 AM.
frog_jr is offline   Reply With Quote
Old 07-20-2008, 12:32 PM   #52
Klinke
Human being with feelings
 
Klinke's Avatar
 
Join Date: Jul 2008
Location: Berlin / Germany
Posts: 832
Default Insert Region with ID

I just working on a modification/enhancement of the Mackie Control Universal CSurf implementation, works fine so far, but i want to insert a region with an given ID just like Markers with the "Add/move marker x to play/edit cursor". In the API i did found only the EnumProjectMarkers function, but no method to set the project markers. First i thought, that it's just not possible with the API at the current state, but the great Marker utilities from SWS prove that their must be a way to do it. It would be nice, if someone can give me a hint, how this is done.

Thanks,
Klinke
Klinke is offline   Reply With Quote
Old 06-26-2009, 06:31 AM   #53
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

* Clarification for GetSetTrackSendInfo()
I don't understand the comment: "// sendidx is 0..n (NULL on any required parameter to stop)"
"to stop" what ? Because if I use NULL on the 4th param for instance, well, something is stopped, indeed (crash ;-)

* API improvement (correct me if it's already available !!)
- I'd like the 5th param of GetSetTrackSendInfo() not been ignored when it's non-null and when the 4th one is either "P_DESTTRACK" or "P_SRCTRACK" (i.e. read only => read/write). [EDIT] in other words, I'd like to add/update send/recv
- I'd like a new interface similar to: void (*DeleteTrackSend)(MediaTrack *tr, int category, int sendidx);
- I'd like a new interface similar to: int (*GetNumTrackSends)(MediaTrack *tr, int category); this one could help but is not mandatory as there's an indirect way to get that...
- last but not least, how do I edit (+ add, remove) pin connectors within a FX chain ?

Thanks!

Last edited by Jeffos; 06-26-2009 at 07:03 AM.
Jeffos is offline   Reply With Quote
Old 06-26-2009, 09:57 PM   #54
Rubberfrog
Human being with feelings
 
Join Date: Jun 2009
Location: vancouver
Posts: 6
Default For live work.

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
I'm just starting to get into programming after well...probably 92? C++ seems to make sense. Anyways, what I'm wanting to do is just make it so you can assign a key command (midi)to select a particular track. for effect changes live. Also, so I can nest my other input device, Assign a key command for selecting the the fx slot in the selected track.

Wonderring if you might know of examples I could use, that would be compact just to do that as a starting point.
Rubberfrog is offline   Reply With Quote
Old 06-27-2009, 08:01 AM   #55
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Rubberfrog View Post
I'm just starting to get into programming after well...probably 92? C++ seems to make sense. Anyways, what I'm wanting to do is just make it so you can assign a key command (midi)to select a particular track. for effect changes live. Also, so I can nest my other input device, Assign a key command for selecting the the fx slot in the selected track.

Wonderring if you might know of examples I could use, that would be compact just to do that as a starting point.
You can do actions to select particular tracks easily. (Once you have everything else set up for programming Reaper extensions.) However opening the window of a particular fx in a track isn't supported directly by the Reaper APIS.
__________________
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 06-27-2009, 07:32 PM   #56
Rubberfrog
Human being with feelings
 
Join Date: Jun 2009
Location: vancouver
Posts: 6
Default

Quote:
Originally Posted by Xenakios View Post
You can do actions to select particular tracks easily. (Once you have everything else set up for programming Reaper extensions.) However opening the window of a particular fx in a track isn't supported directly by the Reaper APIS.
Hmmm... I was kind of assuming that since the fx window opens when you click the effect, the same would be true calling it from the sdk. It's really too bad the commands in the fx browser aren'ts available... I could set up my foot pedal to send midi note on off, for browsing, loading, etc, and still have my hands free for playing.
Rubberfrog is offline   Reply With Quote
Old 06-30-2009, 11:34 AM   #57
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 857
Default

Quote:
Originally Posted by Jeffos View Post
* Clarification for GetSetTrackSendInfo()
I don't understand the comment: "// sendidx is 0..n (NULL on any required parameter to stop)"
"to stop" what ? Because if I use NULL on the 4th param for instance, well, something is stopped, indeed (crash ;-)

* API improvement (correct me if it's already available !!)
- I'd like the 5th param of GetSetTrackSendInfo() not been ignored when it's non-null and when the 4th one is either "P_DESTTRACK" or "P_SRCTRACK" (i.e. read only => read/write). [EDIT] in other words, I'd like to add/update send/recv
- I'd like a new interface similar to: void (*DeleteTrackSend)(MediaTrack *tr, int category, int sendidx);
- I'd like a new interface similar to: int (*GetNumTrackSends)(MediaTrack *tr, int category); this one could help but is not mandatory as there's an indirect way to get that...
- last but not least, how do I edit (+ add, remove) pin connectors within a FX chain ?

Thanks!
Jeffos, currently the only way to add/remove sends is through the GetSetObjectState() interface. (Defined in the latest SDK available at LoL.) It's a little tricky as it's a string parsing exercise. I've been meaning to write a wrapper class around GSOS to do exactly the types of things you're describing; I'll post up here when I get it done.
sws is offline   Reply With Quote
Old 06-30-2009, 12:22 PM   #58
drew
Mobile
 
drew's Avatar
 
Join Date: Jan 2006
Location: London & São Paulo. Hardcore commercial REAPERite
Posts: 1,669
Default

That'll be excellent sws! The ability to change track & item states is really something very special and powerful.

When playing back I do get some crashes when setting state on a track with more complex chains.. I guess it can't be avoided though - unless there is a different way REAPER could update the FX chain (maybe seeing if plugin data has changed for each one and only overwriting when it has for a specific plugin and, i guess, bypassing as it does so?)
__________________
Proudly using REAPER exclusively for...
* Media and event music composition & production, sound design + auto-processing at Qsonics.com
* Broadcast branding, promos, education & training and narration voice-overs at DrewWhite.com
drew is offline   Reply With Quote
Old 06-30-2009, 04:31 PM   #59
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Quote:
Originally Posted by sws View Post
Jeffos, currently the only way to add/remove sends is through the GetSetObjectState() interface. (Defined in the latest SDK available at LoL.) It's a little tricky as it's a string parsing exercise. I've been meaning to write a wrapper class around GSOS to do exactly the types of things you're describing; I'll post up here when I get it done.
Thanks a lot for that, SWS!! I thought my post was just lost in space...

I'm using this "under-coat" SDK, I saw this mysterious GetSetObjectState() but I didn't realize that AT ALL! How do you know that? But... Hummmm.. with your info I understand that the 1st param may be, say, a MediaTrack*, a MediaItem*, etc... and that the XML "slice" is the one we can see int the .RPP files, and sax & dom are good friends of mine...
... but NO! I'll wait for your wrapper, 'cause I've got lot of other issues - begining with a runtime license on the main component I use, needs a switch to LGPL !

I just hope we're not working on the same idea

- Jeffos (future SWS Wrapper user since 1902)
Jeffos is offline   Reply With Quote
Old 06-30-2009, 04:40 PM   #60
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Jeffos View Post
Thanks a lot for that, SWS!! I thought my post was just lost in space...

I'm using this "under-coat" SDK, I saw this mysterious GetSetObjectState() but I didn't realize that AT ALL! How do you know that? But... Hummmm.. with your info I understand that the 1st param may be, say, a MediaTrack*, a MediaItem*, etc... and that the XML "slice" is the one we can see int the .RPP files, and sax & dom are good friends of mine...
... but NO! I'll wait for your wrapper, 'cause I've got lot of other issues - begining with a runtime license on the main component I use, needs a switch to LGPL !

I just hope we're not working on the same idea

- Jeffos (future SWS Wrapper user since 1902)
You may be out of luck in any case trying to use XML parsing code on the Reaper data format, as it's not really XML but something that kinda looks like it. I doubt standard XML parsing/generating code will work with it. If you prove me wrong that'd be nice too though...
__________________
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 07-01-2009, 12:09 AM   #61
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Xenakios,
you totally right. I tested that quickly, indeed "<something <something_else>..." is not XML ! That's why SWS is talking about "string" parsing, I think => another good reason to wait for the wrapper class!

SWS,
Thanks again for this effort, much appreciated, it'll open lot of new doors...
Jeffos is offline   Reply With Quote
Old 07-10-2009, 03:31 AM   #62
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

ok... couldn't resist... manage to do lot of things thanks to SWS's tip!
But, now I'm stuck here:
Code:
<VST "VSTi: ReaSamplOmatic5000 (Cockos)" "reasamplomatic.dll" 0 ""
bW9zcu5e7f4AAAAAAgAAAAEAAAAAAAAAAgAAAAAAAACVAAAAAQAAAA==
AAAAAAAAAAAAAADwPwAAAAAAAOA//anx0k1iUD8AAAAAAAAAAAAAAA==
AAAA8D+amZmZmZmxP83MzMzMzOs/AAAAAAAAAAAAAAAAAAAAAPyp8Q==
0k1iQD/8qfHSTWJAPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAA==
AAAA8D8AAAAAAADgPwIAAAAAAAAAAAAAAAAAAAAAAPA/
>
... I think I known how to decode that, but... then? can someone explain me this kind of byte sequence ? or point me to a doc ?
rmq: this stuff is of course FX type depend. It looks different for a JS, for ex. (plain text)
Jeffos is offline   Reply With Quote
Old 07-10-2009, 03:41 AM   #63
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Jeffos View Post
ok... couldn't resist... manage to do lot of things thanks to SWS's tip!
But, now I'm stuck here:
Code:
<VST "VSTi: ReaSamplOmatic5000 (Cockos)" "reasamplomatic.dll" 0 ""
bW9zcu5e7f4AAAAAAgAAAAEAAAAAAAAAAgAAAAAAAACVAAAAAQAAAA==
AAAAAAAAAAAAAADwPwAAAAAAAOA//anx0k1iUD8AAAAAAAAAAAAAAA==
AAAA8D+amZmZmZmxP83MzMzMzOs/AAAAAAAAAAAAAAAAAAAAAPyp8Q==
0k1iQD/8qfHSTWJAPwAAAAAAAPA/AAAAAAAAAAAAAAAAAAAAAAAAAA==
AAAA8D8AAAAAAADgPwIAAAAAAAAAAAAAAAAAAAAAAPA/
>
... I think I known how to decode that, but... then? can someone explain me this kind of byte sequence ? or point me to a doc ?
rmq: this stuff is of course FX type depend. It looks different for a JS, for ex. (plain text)
You are totally out of luck with these opaque data structures. It's the VST plugin's configuration in binary format, encoded here as base64 text strings. It'll be different for each plugin, is in 99.99% of cases undocumented by the plugin maker etc...Pretty much the only thing you can do with these is to copy them as they are or omit them.
__________________
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 07-10-2009, 04:18 AM   #64
drew
Mobile
 
drew's Avatar
 
Join Date: Jan 2006
Location: London & São Paulo. Hardcore commercial REAPERite
Posts: 1,669
Default

You can decode & re-encode the BASE64 data there and I've done that, but the only success I've been able to achieve was in repointing ReaSamplOmatic sample file references when I moved a bunch to a new folder. Of course nothing is guaranteed once you mess with the structure of any 3rd party plug unless you know how it was formatted in the first place.

I don't think that's a good way to try to change param values, but I'm trying to think of any way to get & set parameters by their name - it would make sense since REAPER automation & param knobs obviously get & set each parameter.
__________________
Proudly using REAPER exclusively for...
* Media and event music composition & production, sound design + auto-processing at Qsonics.com
* Broadcast branding, promos, education & training and narration voice-overs at DrewWhite.com
drew is offline   Reply With Quote
Old 07-10-2009, 05:27 AM   #65
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

hey guys! thanks for the quick replys!!
I recognized the base64. I understand what you say but I still think I should be able to do what I want (see bellow): I understand that some setting bytes are FX dependent but - as it's the reaper's view of them - some common properties should be saved in a common way, perhaps even at the same byte offset (?). What I call a 'common property' is typically audio/midi I/O configuration. Am I wrong (?). TBC by cockos (?)

So Drew,
I know that! Changing param values is NOT what I want to do. What I want to do is to update pin connectors within a fx chain (I'm working on something 'like' http://forum.cockos.com/showthread.php?t=14718 but in my own way). I was on the good lane with pin connections: if the FX 'n' is a JS and 'n+1' is whatever-you-want I can see this:
Code:
<JS_PINMAP
6AMAABwAAADoAwAAAgAAAAIAAAABAAAAAAAAAAIAAAAAAAAAHAAAAA==
6AMAAAIAAAACAAAAAwAAAAAAAAAAAAAAAAAAAA==
>
but if the FX 'n' is a VST... nothing => this info seems embedded in that VST plugin's configuration I was talking about (?). But this part should be common to all VSTs, isn't it?

- Jeff

Sidenote: Xenakios, I'll eat some python this WE!
Jeffos is offline   Reply With Quote
Old 07-12-2009, 05:53 AM   #66
drew
Mobile
 
drew's Avatar
 
Join Date: Jan 2006
Location: London & São Paulo. Hardcore commercial REAPERite
Posts: 1,669
Default

It seems the block of BASE64-encoded VST data keeps the pin details at a constant place.

From what I can tell, there are a bunch of little endians from byte 9 as follows:
number of inputs channels the plug accepts = 4 bytes (eg. "02 00 00 00")
mapping for each input = 8 bytes per input (eg. "01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00")
number of outputs channels the plug gives = 4 bytes (eg. "04 00 00 00")
mapping for each output = 8 bytes per output (eg. "01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00")

That would be the mapping for a plug with 2 in, 4 out

What's beyond that I really don't know, but the length shouldn't change for a particular plugin.

The 8 byte mapping block obviously shows there is a hard-coded 64 channel limit.

If you wanted to add and immediately channel map a plug I guess you'd need to add it some other way (not with the State calls) then edit the data it creates.

Using WDL's base64decode & encode routines you should be able to change the pin mappings directly in the block of plugin data - BUT no guarantee that REAPER will realise immediately I guess.
__________________
Proudly using REAPER exclusively for...
* Media and event music composition & production, sound design + auto-processing at Qsonics.com
* Broadcast branding, promos, education & training and narration voice-overs at DrewWhite.com

Last edited by drew; 07-12-2009 at 05:56 AM.
drew is offline   Reply With Quote
Old 07-15-2009, 01:33 AM   #67
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

wooo ! that's a good start, so I wasn't wrong! Thanks a lot for that, Drew (especially if you did some reverse to see that). Amazing community!!
So, on my part, I'll also do some tests that and I'll do some "SET" => I'll tell you how it crashes ;-)
Jeffos is offline   Reply With Quote
Old 07-20-2009, 10:43 AM   #68
drew
Mobile
 
drew's Avatar
 
Join Date: Jan 2006
Location: London & São Paulo. Hardcore commercial REAPERite
Posts: 1,669
Default

looking forward to finding out more!
__________________
Proudly using REAPER exclusively for...
* Media and event music composition & production, sound design + auto-processing at Qsonics.com
* Broadcast branding, promos, education & training and narration voice-overs at DrewWhite.com
drew is offline   Reply With Quote
Old 07-21-2009, 12:07 AM   #69
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

coming soon drew... right now, I'm just busy with...
... MUSIC !
Jeffos is offline   Reply With Quote
Old 07-26-2009, 06:26 AM   #70
boreg
Human being with feelings
 
Join Date: Jul 2009
Posts: 162
Default Plugin for drag-zooming?

Hi, Reaper gurus!
Since I can't get over the fact that Reaper does not implement drag zooming, and having some experience with Windows programming, I thought maybe I can implement it as a plugin. I thought about something like this:
- Subclass the main application window to get mouse notifications
- Detect when mouse is dragged (WM_MOUSEMOVE notification with left button down) and is over the timeline (is this info available from SDK?)
- translate vertical mouse movement to adjustZoom() calls (found this function in the SDK, seems right for the job).
Is this possible? Am I on the right track?

thanks!
boreg is offline   Reply With Quote
Old 07-26-2009, 12:12 PM   #71
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by boreg View Post
Hi, Reaper gurus!
Since I can't get over the fact that Reaper does not implement drag zooming, and having some experience with Windows programming, I thought maybe I can implement it as a plugin. I thought about something like this:
- Subclass the main application window to get mouse notifications
- Detect when mouse is dragged (WM_MOUSEMOVE notification with left button down) and is over the timeline (is this info available from SDK?)
- translate vertical mouse movement to adjustZoom() calls (found this function in the SDK, seems right for the job).
Is this possible? Am I on the right track?

thanks!
It might work, the timeline window appears to be class REAPERTimeDisplay with caption "timeline", so if you find that with win32's FindWindowEx, you could try subclassing it (not the Reaper main window!). There's not really anything in the Reaper APIs to know about the Reaper screen elements, their coordinates etc, so you can only hope you can find and manipulate the things you are interested in using the win32 APIs.
__________________
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 07-27-2009, 12:24 PM   #72
boreg
Human being with feelings
 
Join Date: Jul 2009
Posts: 162
Default

Thanks a lot Xenakios!
boreg is offline   Reply With Quote
Old 09-29-2009, 02:09 PM   #73
hantymansy
Human being with feelings
 
Join Date: May 2008
Location: Kazakhstan
Posts: 94
Default

Is it possible to get the access to midi item and all the notes inside of it?

the idea is to make alternate midi editor
hantymansy is offline   Reply With Quote
Old 09-29-2009, 03:34 PM   #74
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by hantymansy View Post
Is it possible to get the access to midi item and all the notes inside of it?

the idea is to make alternate midi editor
Possible but very complicated.
__________________
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 09-30-2009, 02:51 AM   #75
hantymansy
Human being with feelings
 
Join Date: May 2008
Location: Kazakhstan
Posts: 94
Default

Xenakios, So what's the basics of getting that kind of access?
hantymansy is offline   Reply With Quote
Old 09-30-2009, 03:41 AM   #76
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by hantymansy View Post
Xenakios, So what's the basics of getting that kind of access?
-Get media item
-Get media take of interest from the item
-Get media source of the take
-Check media source type with GetType() if it is "MIDI"
-If MIDI, then something like :
Code:
midi_List *miji=new midi_List();
PCM_source_transfer_t tb;
tb.midi_events=miji;
tb.time_s=0;
tb.samplerate=44100.0;
tb.nch=1;
tb.length=44100*itemLen;
tb.samples=0;
tb.absolute_time_s=0.0;
tb.force_bpm=120;
theSource->GetSamples(&tb);
miji->CreateNoteEventsList();
miji->TransposeNoteList(5);
miji->UpdateEventList();
midi_realtime_write_struct_t *midiwrite=new midi_realtime_write_struct_t;
midiwrite->length=44100*itemLen;
midiwrite->item_playrate=1.0;
midiwrite->global_item_time=0.0;
midiwrite->global_time=itempos;
midiwrite->latency=0.0;
midiwrite->overwritemode=-1;
midiwrite->srate=44100;
midiwrite->events=miji;
PCM_source *newMidisource=theSource->Duplicate();
newMidisource->Extended(PCM_SOURCE_EXT_ADDMIDIEVENTS,midiwrite,0,0);
GetSetMediaItemTakeInfo(TheTakes[0],"P_SOURCE",newMidisource);
There midi_List is a class that has to deal with the MIDI data etc...(class midi_List : public MIDI_eventlist, look for what you must implement yourself from the reaper_plugin.h, it doesn't do things like midi note transpose what you see me calling above, you have to parse the notes and everything yourself.)

As you can see, the whole process involves many steps that can potentially go wrong. The above code probably has many errors already.

Another possible approach would be to get the media item's state as text data (formatted as it is in the RPP files) using the GetSetObjectState() API and then manipulate the text appropriately and set the state back to the media item. That approach obviously has it's difficulties too, unfortunately...
__________________
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 09-30-2009, 08:12 AM   #77
hantymansy
Human being with feelings
 
Join Date: May 2008
Location: Kazakhstan
Posts: 94
Default

Yep.. that's a lot of stuff to do. anyway thanks for showing the way Xen
hantymansy is offline   Reply With Quote
Old 09-30-2009, 09:06 AM   #78
Padre_PC
Human being with feelings
 
Join Date: Sep 2009
Posts: 262
Default

How do I... get notice that project has just been saved under a new name?

I use project filenames to show information on a control surface. "Open" will call IReaperCSurf::TrackInfoChanged() (or whatever it's called), but "Save as"... is there an event I could use?
Padre_PC is offline   Reply With Quote
Old 09-30-2009, 02:03 PM   #79
klankschap
Human being with feelings
 
Join Date: Feb 2007
Posts: 99
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
I've got a personal package to create reaper rpp project files.
This works very smooth.
But having native access through the API is very nice indeed.

However:
I'm using OSX 10.6 with python 2.6.2
Would it be possible to get reascript using that as well (for the time being)

Thanks!
Floris
klankschap is offline   Reply With Quote
Old 09-30-2009, 03:14 PM   #80
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by klankschap View Post
I've got a personal package to create reaper rpp project files.
This works very smooth.
But having native access through the API is very nice indeed.

However:
I'm using OSX 10.6 with python 2.6.2
Would it be possible to get reascript using that as well (for the time being)

Thanks!
Floris
Why could you not install the latest Python on OS-X? Can't OS-X handle multiple Python versions installed or some other problem like that?
__________________
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
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 12:49 AM.


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