Old 12-22-2009, 01:54 PM   #1
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default ReaScript: API: Wish List

Hello all,

Here's the start of a ReaScript wish list. What have I missed? What shouldn't be on the list? What should and shouldn't be in red? (No matter what anyone says I'm not taking the Wiki items off the list.) There aren't many Python items. (can't think why...)

These are the top ten things in the Wish List. Positions are set by +1 or -1 votes, so make sure you vote for what you need and un-vote for what you don't...
  • Numbers in () are item nums in big list below.
  • Items get into top ten with first +1, at bottom of list
  • Items go up list with each +1
  • Items go down in the list with each -1 (usually)
  1. (8) Add a return value for named notes to MIDIEditor_GetMode()
  2. (9) File dialogue, returning OK/Cancel & Filename (Expected v3.21 or thereabouts)
  3. (13) GetSet*State() chunk size limit is currently 16k, too small. (Expected v3.21 or thereabouts)
  4. (10) MIDIEditor_Get|SetView, returning (see big list)
  5. (12) Resizable console window
  6. (23) Get/SetMidiItemInfo_Value() - (see big list)
  7. (25) GetSetProjectState()
  1. ReaPerl. To be able to call RPR_* functions from a module.
  2. For functions that take a named parameter - Get/SetMediaTrackInfo_Value() - to not fail silently when you give them a parameter they don't know about.
  3. ReaPerl. Compile & Runtime Error messages for Perl scripts.(becoming an issue, scripts are getting longer)
  4. ReaPerl. To be able to call RPR_* functions as standard Perl functions, multiple line calls and calls in if statements, e.g.
    PHP Code:
    if(RPR_CountSelectedItems()==0
    and
    PHP Code:
    $var=RPR_FuncWithVeryLongNameAndParamList(
           
    MediaTrack,    # the selected track
           
    MediaItem,     # the item that will be edited
           
    p3,            # etc.
           
    p4,
           
    p5,
           
    p6,            # some random pointer or other...
           
    p7,
           
    p8
         
    ); 
    The solution to this one's related to the "RPR_ from a module wish" (above) I suspect.
  5. To (magically, not with work) know about Python as well as Perl (please).*
  6. A Wiki batch edit facility (please God).*
  7. A Wiki template that is not just a #include by another name.*
  8. Add a return value for named notes to MIDIEditor_GetMode()
  9. File dialogue, returning OK/Cancel & Filename (Expected v3.21 or thereabouts)
  10. MIDIEditor_Get|SetView, returning rectangles, diamonds, triangles, all notes, Hide unused, Hide unused/unnamed
  11. Support for Tk (GUI used by Python & Perl) in Perl as well as in Python.
  12. Resizable console window
  13. GetSet*State() chunk size limit is currently 16k, too small. (Expected v3.21 or thereabouts)
  14. "Possible Infinite Loop" message currently triggered at 16000 API calls in a ReaScript, sfzgeek hitting that limit.
  15. A command to close the console output window from within the script.
  16. API A means to obtain the Actions List contents -- particularly the name strings and the corresponding numeric ID's.
  17. something to get a valid reaper_plugin_info_t *rec (or any alternative other way to register to Reaper's notif)
  18. LICE_IBitmap * b = GetPNGFromCurrentTheme("mcp_volthumb.png", NULL); getting the user's current theme in a cross-plateform way would be cool for VSTs extension plugins
  19. something to work within FX chains in a FX type independent way (VST, JS, Dx) main first needs: trigering reaper's preset (then, FX's one) but also pin connection processing
  20. SWS's plugin_register("hookcommandex", hookCommandProcEx) FR: http://forum.cockos.com/project.php?issueid=1465
  21. padre, klinke & yves: enhanced csurf notif, http://forum.cockos.com/showthread.php?t=44152
  22. Something to validate chunk updates in a reliable way - GetSet*State() funcs bool vals sometimes fib a bit...
  23. Get/SetMidiItemInfo_Value() - perhaps not this API exactly, but something a more ReaScripter friendly than chunks. (Some aspects of friendlier could be user-contributed if we could call RPR_* functions from a module)
  24. GetFuncAddress() call. Not needed now include() is implemented.
  25. Jeffos would like to be able to say GetSetObjectState(ReaProject*), personally I would prefer to see a GetSetProjectState() to allow access to project-wide parameters using chunkish editing.

Oh, and just to be clear. I'm not complaining, I think ReaScript (yes, yes & the C++ API) is the best thing since sliced bread.

Mike

(* Some items may stretch the capabilities of the development team, but we shouldn't let that stop us asking. Remember - hard work is good for them. )
__________________
Mike Lacey, Leicestershire, UK

Last edited by MikeLacey; 01-27-2010 at 09:07 AM.
MikeLacey is offline   Reply With Quote
Old 12-22-2009, 02:00 PM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,669
Default

Thanks Mike.

Also what would be handy is a wish list of particular API functions. Those sorts of wishes even have a chance of being granted (unlike, say, #5 above).
schwa is offline   Reply With Quote
Old 12-22-2009, 02:05 PM   #3
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 21,765
Default

I very much agree with:

8, 9, 10, 12, 13



Also I will add:

15. A command to close the console output window from within the script. For example, currently:

RPR_ShowConsoleMsg("")

clears the console.

RPR_ShowConsoleMsg(close)

could do it?
EvilDragon is online now   Reply With Quote
Old 12-22-2009, 02:15 PM   #4
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

interesting, I've only thought of the console as a debugging tool...
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 12-22-2009, 02:25 PM   #5
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 21,765
Default

...and that is a good point as well. Yeah, we could use messageboxes for whatever we want to return to the user, true.

How about this then:

15. Naming all scripts like this:

"ReaScript: <script name here>"

instead of:

"Custom: <script name here>.py/pl"

EvilDragon is online now   Reply With Quote
Old 12-22-2009, 03:26 PM   #6
Geoff Waddington
Human being with feelings
 
Geoff Waddington's Avatar
 
Join Date: Mar 2009
Location: Dartmouth, Nova Scotia
Posts: 2,428
Default

As per schwa's suggestion I'm posting a wish list item here that is not strictly for ReaScript (but probably useful for ReaScripter's as well).

API: A means to obtain the Actions List contents -- particularly the name strings and the corresponding numeric ID's.

For custom actions and extension actions the ID's are assigned dynamically, so we need to do this at runtime.
Geoff Waddington is offline   Reply With Quote
Old 12-23-2009, 03:19 AM   #7
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Quote:
Originally Posted by schwa View Post
Thanks Mike.

Also what would be handy is a wish list of particular API functions. Those sorts of wishes even have a chance of being granted (unlike, say, #5 above).
Dear Santa schwa,

My (ordered) wish list is:

- Something to validate chunk updates in a reliable way
==> EDIT: this was a REAPER bug fixed in v3.22


- allowing ReaProject* as 1st param for GetSetObjectState() (no need of attached tracks in the setted/getted chunks..)

- something to get a valid reaper_plugin_info_t *rec (or any alternative other way to register to Reaper's notif)

- LICE_IBitmap * b = GetPNGFromCurrentTheme("mcp_volthumb.png", NULL);
getting the user's current theme in a cross-plateform way would be cool for VSTs extension plugins
==> EDIT: no API update needed for that


- something to work within FX chains in a FX type independent way (VST, JS, Dx): main first needs: trigering REAPER's preset (then, FX's one) but also pin connection processing
==> EDIT July 2010: trigering REAPER's preset is doable

I stop here. I really think the two 1st ones would open many doors. I'd be happy only with them.

Other devs wishes I really agree with (ordered too):
- same as SWS: plugin_register("hookcommandex", hookCommandProcEx);
FR: http://forum.cockos.com/project.php?issueid=1465
- same as padre_pc, klinke, yves: enhanced csurf notif, see http://forum.cockos.com/showthread.php?t=44152 (but forget what I said there: now, I know how to do almost everything I asked there)
- same as geoff: a way to enumerate the action list (I promise I won't do a parallèle learn system.. ;-)

Last edited by Jeffos; 08-06-2010 at 08:29 AM. Reason: outdated things -> italic
Jeffos is offline   Reply With Quote
Old 12-23-2009, 12:43 PM   #8
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

Jeff, hi,

So that I can add your items into the wish list... (and my apologies for asking stupid questions)

Quote:
Something to validate chunk updates in a reliable way
The functions GetSetEnv/Item/TrackState return bool (amongst other things), is the bool return value not reliable?

Quote:
allowing ReaProject* as 1st param for GetSetObjectState()
So that we can update project global parameters in a chunkish way? (In the style of GetSetProjectState()?)
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 12-23-2009, 01:15 PM   #9
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 21,765
Default

Quote:
Originally Posted by MikeLacey View Post
The functions GetSetEnv/Item/TrackState return bool (amongst other things), is the bool return value not reliable?
May be so, but when GetSetItemState() sets MIDI CFGEDIT chunk tokens, they are not updated and not reflected, even if you update the item on the timeline...
EvilDragon is online now   Reply With Quote
Old 12-23-2009, 02:04 PM   #10
jedstar2000
Human being with feelings
 
jedstar2000's Avatar
 
Join Date: Apr 2009
Location: Bristol uk
Posts: 1,006
Default

Dear Santa Schwa .

I could really do with .
RPR_GetMidiItemInfo_Value( ) Retries all position pitches and velocities of notes in an item by index.
and
RPR_SetMidiItemInfo_Value( ) Sets all position pitches and velocities of notes in an item by index.

Chunk editing is just two tricksy for your average Rescripter it needs to be transformed into something far more friendly .

Have a very merry Christmas.
__________________
...............Reaper the DIY DAW.....................
MultiTrack Editing Macros http://forum.cockos.com/showthread.php?t=50111
Hybrid Theme http://forum.cockos.com/showthread.php?t=131090
jedstar2000 is offline   Reply With Quote
Old 12-23-2009, 02:32 PM   #11
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

Quote:
Originally Posted by EvilDragon View Post
May be so, but when GetSetItemState() sets MIDI CFGEDIT chunk tokens, they are not updated and not reflected, even if you update the item on the timeline...
Fair comment - it's in the list
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 01-06-2010, 01:44 AM   #12
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Quote:
Originally Posted by MikeLacey View Post
The functions GetSetEnv/Item/TrackState return bool (amongst other things), is the bool return value not reliable?
Hi Mike! sorry for this late anwser. no, I meant that sometimes you have to fight to validate chunk updates (to avoid what you called "a temporary update" in another thread) while the fuction had returned "true". Sometimes it also return true but nothing is applied at all and there're other worst issues (e.g. right now I'm facing some deadlocks when setting, I'm trying to clarify that..)

Quote:
Originally Posted by MikeLacey View Post
So that we can update project global parameters in a chunkish way? (In the style of GetSetProjectState()?)
yes, it's the idea: master enveloppes, tempo, etc...

Last edited by Jeffos; 01-06-2010 at 04:44 AM. Reason: none, see post bellow
Jeffos is offline   Reply With Quote
Old 01-06-2010, 02:06 AM   #13
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

"right now I'm facing some deadlocks when setting"

Interesting, I've not encountered that
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 01-06-2010, 06:40 PM   #14
Malevol3nt
Human being with feelings
 
Join Date: Sep 2009
Posts: 107
Default

Quote:
Originally Posted by MikeLacey View Post
[*]Support for Tk (GUI used by Python & Perl) (long shot) Or... Drop down lists, text boxes and such in windows that can be called from ReaScript functions. (less of a long shot maybe)
Just spotted this one. I had no trouble running tkinter in Reaper, except of course not having the ability to make API calls without some kind of a callback mechanism (which I still have to figure out!). But it certainly is possible to have a GUI.
Malevol3nt is offline   Reply With Quote
Old 01-06-2010, 07:18 PM   #15
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

Quote:
Originally Posted by Malevol3nt View Post
Just spotted this one. I had no trouble running tkinter in Reaper, except of course not having the ability to make API calls without some kind of a callback mechanism (which I still have to figure out!). But it certainly is possible to have a GUI.
Would you mind to post a little (python) demo snippet, because i didn't get this to work either?
Blechi is offline   Reply With Quote
Old 01-06-2010, 08:12 PM   #16
Malevol3nt
Human being with feelings
 
Join Date: Sep 2009
Posts: 107
Default

Quote:
Originally Posted by Blechi View Post
Would you mind to post a little (python) demo snippet, because i didn't get this to work either?
Here you go. Just put it anywhere in the Reaper directory (I have a Reaper\Scripts Dir where I put all the stuff but it doesn't matter). Make a hotkey for it or just run it.

By the way, if you want to design your GUI's without having to code all the time you can use GUI Builder, which generates python ~2.5 compatible code. It's downloadable from here:

http://sourceforge.net/projects/spectcl/

However, all I needed to do was change the import statements from "import Tkinter" to "import tkinter" in the 2 .py files it generates, and the code seemed to work fine with Python 3.1. But I've only tried it briefly. Anyway, have fun!
Attached Files
File Type: zip GuiTest.zip (1.1 KB, 321 views)
Malevol3nt is offline   Reply With Quote
Old 01-06-2010, 09:53 PM   #17
Blechi
Human being with feelings
 
Blechi's Avatar
 
Join Date: Apr 2008
Location: Saarlänner
Posts: 1,141
Default

Thanks a lot. Works fine.
Also thanks for the link to the GUIbuilder thingy. Makes things a lot easier.
Blechi is offline   Reply With Quote
Old 01-07-2010, 08:35 AM   #18
Malevol3nt
Human being with feelings
 
Join Date: Sep 2009
Posts: 107
Default

Quote:
Originally Posted by Blechi View Post
Thanks a lot. Works fine.
Also thanks for the link to the GUIbuilder thingy. Makes things a lot easier.
Right, just be careful with the root.destroy() function. I've removed it from the example since closing the GUI with the X button calls that function anyway. If you were to say, put root.destroy() as a function call for one of the buttons, it will do the same thing.

However putting it in the wrong place can sometimes create an infinite loop spawning a few dozen windows, and you have to crash Reaper via the task manager to get rid of them. But it only happens if you don't know what you're doing (I got burned on that one myself )

Edit: Looks like tkinter seems to be a bit buggy, or I'm doing it wrong. For the life of me I can't figure out why sometimes a button activates itself on it's own. And I'm getting infinite loops, windows popping out everywhere. Argh!

Last edited by Malevol3nt; 01-07-2010 at 05:03 PM.
Malevol3nt is offline   Reply With Quote
Old 01-07-2010, 10:32 AM   #19
Malevol3nt
Human being with feelings
 
Join Date: Sep 2009
Posts: 107
Default

It looks like the maximum number of envelope points I can retrieve with an extension is 629 points. Trying to extract more crashes reaper, with a "Memory could not be 'written' at address 0x********"

It seems Reaper has no problem having more than 629 envelope points. So it's probably a limitation of the size of the chunk RPR_GetSetEnvelopeState can return. At 629 points the string/chunk returned is 15742 characters long.

I'm not saying the limit should be changed. 629 is more than enough for anyone I guess.

On the good side of news, my envelope extraction function (which performs some regular expressions on the chunk) stores all the envelope data and points data in separate dictionaries pretty fast. Around ~20 milliseconds for 629 points, if cProfiler is to be trusted.
Malevol3nt is offline   Reply With Quote
Old 01-08-2010, 02:01 PM   #20
AudiOishi
Human being with feelings
 
Join Date: Dec 2009
Posts: 44
Default

I just wanted to chime in on Item 13. 16384 characters is way too small a limit for GetSetItemState().

+1 to the request to make this a much more useful function.
AudiOishi is offline   Reply With Quote
Old 01-12-2010, 07:03 AM   #21
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,669
Default

Quote:
Originally Posted by MikeLacey View Post
File dialogue, returning OK/Cancel & Filename
Coming soon.

Quote:
Originally Posted by MikeLacey View Post
GetSet*State() chunk size limit is currently 16k, too small.
Will be increased to 1MB.

Last edited by schwa; 01-12-2010 at 07:31 AM.
schwa is offline   Reply With Quote
Old 01-12-2010, 08:31 AM   #22
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

You're a nice man Mr Schwa, and I've always said so...

Thanks, good choices.
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 01-12-2010, 08:51 AM   #23
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 21,765
Default

Quote:
Originally Posted by schwa View Post
Coming soon.
Will this one basically look like the current file dialogue, or?

Because if it's just improved current file dialogue with return values, that is AWESOME!
EvilDragon is online now   Reply With Quote
Old 01-12-2010, 10:10 PM   #24
fingers
Human being with feelings
 
fingers's Avatar
 
Join Date: Dec 2009
Location: Wellington, NZ
Posts: 300
Default

Nice nice!! Sooner then I thought.

Changes in 3.2:

ReaScript: GetSetChunkState chunk length limit increased to 1MB
ReaScript: added GetUserFileNameForRead
fingers is offline   Reply With Quote
Old 01-12-2010, 10:14 PM   #25
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,669
Default

Quote:
Originally Posted by fingers View Post
ReaScript: GetSetChunkState chunk length limit increased to 1MB
ReaScript: added GetUserFileNameForRead
Ah ... oops. Those changes are not in 3.2, they will be in the next release. The whatsnew update got entered with the wrong version number. Sorry!
schwa is offline   Reply With Quote
Old 01-13-2010, 01:59 AM   #26
sfzgeek
Human being with feelings
 
sfzgeek's Avatar
 
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
Default

Quote:
Originally Posted by schwa View Post
Those changes are not in 3.2, they will be in the next release.
No problems. Great to know that some very welcome additions are on the way. The increased chunk limit is going to answer many people's prayers!
__________________
My rawk band: The Hidden Venture.
sfzgeek is offline   Reply With Quote
Old 01-15-2010, 07:34 AM   #27
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

Thx schwa, testing now, test results in pre-release forum.

Mike
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 01-24-2010, 06:46 PM   #28
Andrej88
Human being with feelings
 
Join Date: Jan 2010
Posts: 6
Default

When a (python) script is running, none of the other shortcut keys work until that script exits (although running other scripts via the Actions window work).

A script with a GUI is usually executing an infinite loop until the user hits a close button of some sorts (or the script exits by itself). I've just tried running two GUI scripts at once. After I've ran the first script, the shortcut keys were not responding (as in ctrl-c, escape, F1-F12 buttons etc). I've opened the Actions window and tried executing other scripts. This will work, unless the other script is a GUI script as well. In that case, trying to run that second GUI script will leave Reaper completely frozen.

I think this is worth investigating if we're hoping to some day have GUI scripts running side-by-side. I've tested this with tkinter, and a commercial GUI library, with the same results on Reaper 3.2 and 3.21 beta.
Andrej88 is offline   Reply With Quote
Old 01-25-2010, 05:23 AM   #29
MikeLacey
Human being with feelings
 
Join Date: Dec 2006
Location: UK
Posts: 762
Default

Andre,

Can you run multiple GUI Python scripts outside of REAPER? (sorry, I'm not a Python person)
__________________
Mike Lacey, Leicestershire, UK
MikeLacey is offline   Reply With Quote
Old 01-25-2010, 09:21 AM   #30
Andrej88
Human being with feelings
 
Join Date: Jan 2010
Posts: 6
Default

Quote:
Originally Posted by MikeLacey View Post
Andre,

Can you run multiple GUI Python scripts outside of REAPER? (sorry, I'm not a Python person)
Of course.

Well, maybe I could work on some kind of workaround where the script that runs in Reaper executes another external script which runs independently of Reaper. That's the only thing I can think of.

Try executing a script with an infinite loop like this one (on an empty project please!):

test.py
Code:
while True:
    pass
Reaper will hang. Although that kind of code should never be written, I think Reaper should have some kind of protection against hanging scripts. As people start writing longer extensions it's possible these kinds of bugs could happen by accident, which cause Reaper hangs and users loosing their unsaved projects. I would feel really awful if someone lost their progress in a project due to a hanging script.
Andrej88 is offline   Reply With Quote
Old 01-25-2010, 09:23 AM   #31
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,669
Default

FWIW, Reaper will detect the error in this infinite loop and bail out with an error message:

Code:
while True:
  RPR_DoSomething()
schwa is offline   Reply With Quote
Old 01-25-2010, 12:59 PM   #32
Andrej88
Human being with feelings
 
Join Date: Jan 2010
Posts: 6
Default

Quote:
Originally Posted by schwa View Post
FWIW, Reaper will detect the error in this infinite loop and bail out with an error message:

Code:
while True:
  RPR_DoSomething()
True, just tested it. I guess it would be rather difficult to know if a script is running an infinite loop on purpose or by mistake, except in a case like this when it's constantly calling a Reaper action.
Andrej88 is offline   Reply With Quote
Old 04-18-2015, 06:27 AM   #33
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,923
Default

From this post:
Quote:
A PreventUIRefresh version for the MIDI editor would be nice
Actually, scripts than move the edit cursor intensively are jumpy in the midi editor.
Thanks for listening !
X-Raym is offline   Reply With Quote
Old 04-30-2015, 05:03 PM   #34
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 4,753
Default

reaper.Main_openProjectEx(string name, boolean innewtab)

a boolean option to open in a new tab directly, without having to open a new tab first that loads default template.
__________________
HeDaScripts for REAPER | VIP Donations
heda is offline   Reply With Quote
Old 05-24-2015, 09:12 AM   #35
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,923
Default

Hi !

It would be so nice to have GetMediaItemOnSelectedTrack(mediaTrack, mediaItemSelIndex)

Current solution involve
- select track from selected items
- loop through tracks
-- loop through items on track
--- if selected, then store in a table
-- loop in tbe table

Could be so much easier :P

CountSelectedMediaItemOnTrack will be nice too

EDIT:
Without it, it is very hard to create script like 'group item according to their position on selection per track' (which would group every first selected item on each track together, every second etc...).

Last edited by X-Raym; 05-25-2015 at 03:12 PM.
X-Raym is offline   Reply With Quote
Old 05-24-2015, 12:52 PM   #36
gofer
-blänk-
 
gofer's Avatar
 
Join Date: Jun 2008
Posts: 11,041
Default

SetMediaTrackInfo_Value seems to be missing a means to set auto-record-arm for the track. Could maybe be integrated into "I_RECARM" as a valid value, or be a parameter name of its own.

Or is there another way I am missing? At the moment I use an action call, but it involves selection of the track which means I need to store/recall track selection just for this setting. Seems to be a bit clumsy.
gofer is offline   Reply With Quote
Old 10-23-2015, 02:28 AM   #37
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,054
Default

API to tell reaper to make a backup, so just incase your action causes a crash (when you know the action may have some potential to crash) you could have have reaper make a backup for the user.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template

Last edited by Argitoth; 10-23-2015 at 02:38 AM.
Argitoth is offline   Reply With Quote
Old 10-29-2015, 04:47 AM   #38
kenz
Human being with feelings
 
Join Date: Aug 2013
Posts: 339
Default

Working with envelope scripts I found an irritating lacking functionality.

Testing for GetSelectedEnvelope and GetSelectedTrackEnvelope allows you to see if you have a Take Envelope selected (first is non-zero, second must be 0). This is needed because take envelopes have position relative to their items, so if you use position in any way in the script you need to compensate for this.

AFAIK there's no API to get the take of the specific take envelope (i.e which take it belongs to), which I need to get the item's position... so, API request I guess?
kenz is offline   Reply With Quote
Old 11-04-2015, 01:52 AM   #39
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,977
Default

API to extract/return FX Chain Routing from VST/JS binary data
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 11-05-2015, 06:19 AM   #40
kenz
Human being with feelings
 
Join Date: Aug 2013
Posts: 339
Default

The VST Chunk is stored as base64 in the track chunk. I assume if you look at the track chunk you'll have to decode it manually... The format of the binary blob (once decoded from base64) is like this:

4 bytes <VSTID>
4 bytes <magic value?>
4 bytes <Number of Inputs>
* after that, a bitmask array of 8 bytes each, for the input routings (bit 0 = input channel 1 is set; bit 63 = input channel 64 is set; etc)
* the length of the above array is defined by the number of inputs (so total size is 8*NumInputs bytes)

4 bytes <Number of Outputs>
* again bitmask array 8 bytes each for outputs this time...

Then follows the VST stuff (which you aren't interested in).


I guess this is far from ideal and an API would be much helpful here but, a complicated workaround if you really must have it before then...
kenz 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:17 AM.


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