Old 06-07-2023, 02:39 AM   #1
Bassman002
Human being with feelings
 
Join Date: Aug 2022
Location: Göppingen, Deutschland
Posts: 337
Default Script for insert pooled automation item

Hi

Code:
EDIT: Finally got a working action from Schwa, but it would be anyway nice to see how a script would look like, perhaps it helps me to write my own scripts in the future! Thanks;)

Ctrl+V inserts a copy of an automation item. As I searched for an action to insert an pooled automation item I found the Shortcut Ctrl+Shift+V, but there's no action to insert a pooled copy and the shortcut is attached to another action on my system.

So I searched for a script and just found 2 API functions:

Code:
Lua: integer reaper.InsertAutomationItem(TrackEnvelope env, integer pool_id, number position, number length)

Python: Int RPR_InsertAutomationItem(TrackEnvelope env, Int pool_id, Float position, Float length)

Insert a new automation item. pool_id < 0 collects existing envelope points into the automation item; if pool_id is >= 0 the automation item will be a new instance of that pool (which will be created as an empty instance if it does not exist). Returns the index of the item, suitable for passing to other automation item API functions. See GetSetAutomationItemInfo.
and:

Code:
Lua: number reaper.GetSetAutomationItemInfo(TrackEnvelope env, integer autoitem_idx, string desc, number value, boolean is_set)

Python: Float RPR_GetSetAutomationItemInfo(TrackEnvelope env, Int autoitem_idx, String desc, Float value, Boolean is_set)

Get or set automation item information. autoitem_idx=0 for the first automation item on an envelope, 1 for the second item, etc. desc can be any of the following:
D_POOL_ID : double * : automation item pool ID (as an integer); edits are propagated to all other automation items that share a pool ID
D_POSITION : double * : automation item timeline position in seconds
D_LENGTH : double * : automation item length in seconds
D_STARTOFFS : double * : automation item start offset in seconds
D_PLAYRATE : double * : automation item playback rate
D_BASELINE : double * : automation item baseline value in the range [0,1]
D_AMPLITUDE : double * : automation item amplitude in the range [-1,1]
D_LOOPSRC : double * : nonzero if the automation item contents are looped
D_UISEL : double * : nonzero if the automation item is selected in the arrange view
D_POOL_QNLEN : double * : automation item pooled source length in quarter notes (setting will affect all pooled instances)
So it should be possible to write a script for it, but I'm not able to put these 2 things together😒

I'm pretty sure there are coders woh can do this, so please can someone help me out with some easy code for this function?

Should do the following!

Insert a previously copied automation item on the timeline as a pooled copy, which I can attach to for example Ctrl+Shift+V as a Shortcut.

Similar to Ctrl+V which inserts just an unpooled copy.

For sure I can do this with the mouse action Ctrl+Alt+Drag, but sometimes you're far away from the to copy auto item or even on another track so insert would be the better solution.(Even better than save and load)

Many thanks


Bassman.

Last edited by Bassman002; 06-07-2023 at 05:13 AM.
Bassman002 is online now   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 01:02 PM.


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