Old 05-23-2020, 06:21 PM   #321
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,119
Default

Would it be possible to allow scripts to write Take Markers during recording, please?

The intention is to enable this script to utilise the great new Take Marker system: https://forum.cockos.com/showthread.php?t=175925
__________________
Dax Liniere
Puzzle Factory Sound Studios, London [Website] [Instagram]
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUFX, REAPER x64]
daxliniere is offline   Reply With Quote
Old 06-29-2020, 12:26 AM   #322
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 529
Default pin feature

is thrr any API can allow us to make a auto-pin fx & fx chain window script?

kinda frustrating when I try to open multiple fx window on MCP.
they keep falling back to the lower layer If I forgot to pin them manually.
really wish they can b always on top.
__________________
Reaper 6.15 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 03:57 AM   #323
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,916
Default

Quote:
Originally Posted by todoublez View Post
is thrr any API can allow us to make a auto-pin fx & fx chain window script?

kinda frustrating when I try to open multiple fx window on MCP.
they keep falling back to the lower layer If I forgot to pin them manually.
really wish they can b always on top.

Auto-pin lua script:

Code:
local pinned = {}
local click = reaper.NamedCommandLookup('_S&M_MOUSE_L_CLICK')

function main()
  local retval, list = reaper.JS_Window_ListFind( "tb", true )
  for address in list:gmatch("[^,]+") do
    local pin = reaper.JS_Window_HandleFromAddress( address )
    local parent = reaper.JS_Window_GetParent( pin )
    local title = reaper.JS_Window_GetTitle( parent )
    if not pinned[title] then
      if title:find("^FX:") or title:find("^VST:") or title:find("^JS:") then
        local x, y = reaper.GetMousePosition()
        local _, left, top, right, bottom = reaper.JS_Window_GetClientRect( pin )
        reaper.JS_Mouse_SetPosition( left+8, top+8 )
        reaper.Main_OnCommand(click, 0)
        reaper.JS_Mouse_SetPosition( x, y )
        pinned[title] = true
        reaper.ShowConsoleMsg("pinned " .. title .. "\n")
      end
    end
  end
end
main()
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 06-29-2020, 05:31 AM   #324
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 529
Default

Quote:
Originally Posted by amagalma View Post
Auto-pin lua script:

Code:
local pinned = {}
local click = reaper.NamedCommandLookup('_S&M_MOUSE_L_CLICK')

function main()
  local retval, list = reaper.JS_Window_ListFind( "tb", true )
  for address in list:gmatch("[^,]+") do
    local pin = reaper.JS_Window_HandleFromAddress( address )
    local parent = reaper.JS_Window_GetParent( pin )
    local title = reaper.JS_Window_GetTitle( parent )
    if not pinned[title] then
      if title:find("^FX:") or title:find("^VST:") or title:find("^JS:") then
        local x, y = reaper.GetMousePosition()
        local _, left, top, right, bottom = reaper.JS_Window_GetClientRect( pin )
        reaper.JS_Mouse_SetPosition( left+8, top+8 )
        reaper.Main_OnCommand(click, 0)
        reaper.JS_Mouse_SetPosition( x, y )
        pinned[title] = true
        reaper.ShowConsoleMsg("pinned " .. title .. "\n")
      end
    end
  end
end
main()
Hi amagalma !
Just tried the script,but nothing happen here :/
is this a background wrking script ? or do I have to fire them everytime I need the FX window be pinned ?
Perhaps I miss something , plz help
__________________
Reaper 6.15 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 06:05 AM   #325
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,916
Default

Oh, yes. You are on OSX.
Change this:
Code:
reaper.JS_Mouse_SetPosition( left+8, top+8 )
To this:
Code:
reaper.JS_Mouse_SetPosition( left+8, bottom+8 )
It's a background script

Oh. And get rid of the ShowConsoleMsg line!

I am on Android mobile now and can't do it myself...
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)

Last edited by amagalma; 06-29-2020 at 06:21 AM.
amagalma is offline   Reply With Quote
Old 06-29-2020, 06:19 AM   #326
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 529
Default

Quote:
Originally Posted by amagalma View Post
Oh, yes. You are on OSX.
Change this:
Code:
reaper.JS_Mouse_SetPosition( left+8, top+8 )
To this:
Code:
reaper.JS_Mouse_SetPosition( left+8, bottom+8 )
It's a background script
Still not wrking
and it doesn't shows on/off state. is it normal ?
__________________
Reaper 6.15 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 07:54 AM   #327
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 2,426
Default

Quote:
Originally Posted by amagalma View Post
Auto-pin lua script:
Neat! I didn't know about '_S&M_MOUSE_L_CLICK'.

Did you ever figure out how to detect if a pin is enabled or not? My only guess is to check if a certain style is set, but I'm not sure which one, quick test,..

EDIT Trying style & WS_EX_TOPMOST...

Code:
local style = reaper.JS_Window_GetLong(pin, "EXSTYLE") & 0x8 -- WS_EX_TOPMOST
reaper.ShowConsoleMsg( style .. "\n") 
-- Win10 x64(1909) results,
-- pinned = 8
-- Not pinned = 0

Last edited by Edgemeal; 06-29-2020 at 08:18 AM.
Edgemeal is offline   Reply With Quote
Old 06-29-2020, 08:36 AM   #328
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,916
Default

Quote:
Originally Posted by todoublez View Post
Still not wrking
and it doesn't shows on/off state. is it normal ?

It is missing the on/off state code. I did it quickly. I can add it.. Unfortunately, I can't test at the moment why it is not working on macOS because my VMWare Catalina broke :/ I have to re-install...


Quote:
Originally Posted by Edgemeal View Post
Neat! I didn't know about '_S&M_MOUSE_L_CLICK'.
EDIT Trying style & WS_EX_TOPMOST...

Code:
local style = reaper.JS_Window_GetLong(pin, "EXSTYLE") & 0x8 -- WS_EX_TOPMOST
reaper.ShowConsoleMsg( style .. "\n") 
-- Win10 x64(1909) results,
-- pinned = 8
-- Not pinned = 0

Nice Edgemeal!


I used the S&M action because I could not make it work using WM_LBUTTON messages for some reason...
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 06-29-2020, 09:10 AM   #329
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 529
Default

Quote:
Originally Posted by amagalma View Post
It is missing the on/off state code. I did it quickly. I can add it.. Unfortunately, I can't test at the moment why it is not working on macOS because my VMWare Catalina broke :/ I have to re-install...
waiting for ur final code
this is a wonderful and handy feature !
many thanx to u ,have a wonderful day !
__________________
Reaper 6.15 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 06-29-2020, 10:05 AM   #330
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 2,426
Default

Quote:
Originally Posted by amagalma View Post
I used the S&M action because I could not make it work using WM_LBUTTON messages for some reason...
Ya, when I was working on same thing I tried every msg I could think of (using VS/Win32) and only way to change pin state was the same way your doing it.

Just be aware that if a pin is behind another window you'll be clicking whatever window is in front of that pin!

EDIT Possible better way, Send "WM_ACTIVATE" message with "WA_CLICKACTIVE" flag to the pin, this also sets focus on the windows but windows can be stacked on top of each other without the worry of clicking the wrong window!

Tested on Win10 only...
Code:
-- Pin all FX windows test
-- Edgemeal - May 31, 2021

function PinFx()
  local fgw = reaper.JS_Window_GetForeground() -- OPTIONAL save current foreground window
  local retval, list = reaper.JS_Window_ListFind( "tb", true )
  for address in list:gmatch("[^,]+") do
    local pin = reaper.JS_Window_HandleFromAddress( address )
    if (reaper.JS_Window_IsVisible(pin)) then -- ignore invisible pins 
      local parent = reaper.JS_Window_GetParent( pin )
      local title = reaper.JS_Window_GetTitle( parent )
      if title:find("^FX: ") or title:find("^VST: ") or title:find("^JS: ") then
        local style = reaper.JS_Window_GetLong(pin, "EXSTYLE") & 0x8 -- 0x8 = WS_EX_TOPMOST
        if style == 0 then -- 0 = window is not pinned
          reaper.JS_WindowMessage_Send(pin, "WM_ACTIVATE", 2, 0, 0, 0) -- 2 = WA_CLICKACTIVE
          reaper.ShowConsoleMsg("pinned " .. title .. "\n")
        end -- is pinned?
      end -- check parent title
    end -- is pin visible?
  end
  reaper.JS_Window_SetForeground(fgw) -- OPTIONAL restore foreground window.
end

-- test the function
PinFx()

Last edited by Edgemeal; 06-04-2021 at 05:55 AM. Reason: UPDATE CODE
Edgemeal is offline   Reply With Quote
Old 10-31-2020, 08:41 AM   #331
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,119
Default REQ: Write Take Markers during record

It would be great if we could get API functions to write Take Markers with specified colour and name during recording, please.

One example of use case:
https://forum.cockos.com/showthread....51#post2359251
__________________
Dax Liniere
Puzzle Factory Sound Studios, London [Website] [Instagram]
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUFX, REAPER x64]
daxliniere is offline   Reply With Quote
Old 10-31-2020, 01:27 PM   #332
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

This will probably never happen, as takes during recording actually don't exist yet(only in the gui), so altering them isn't possible unless they are "liberated from the recording".
So unless the devs add some kind of "temporary items" who have unchangeable and temporary attributes(like position and length) who allow limited editing(take markers, notes, other data) it'll probably not gonna happen.
I refrained from requesting that a while back because of the complicated implications coming from "temporary items".

Having said that, I would love to see that happen too.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 10-31-2020, 01:42 PM   #333
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 2,119
Default

Quote:
..takes during recording actually don't exist yet(only in the gui)..
Then it obviously exists somewhere. Perhaps it's not a place we can access directly, but it definitely exists. My suggestion is for the API to allow writing TMs (Take Markers) to that same space.

But to be clear, I'm not proposing writing cue markers to the WAV files themselves, just to the takes, which I expect are stored in the RPP file anyway.

In the current situation, without this API access implemented, it would conceivably be possible for a script to store TMs with name and colour until after recording has finished, then write them to the item. This is actually quite similar to how the existing Take Commenter script works.

Thoughts?
__________________
Dax Liniere
Puzzle Factory Sound Studios, London [Website] [Instagram]
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia GTX1080ti, UAD2-OCTO, FireFaceUFX, REAPER x64]
daxliniere is offline   Reply With Quote
Old 10-31-2020, 02:20 PM   #334
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

Quote:
Originally Posted by daxliniere View Post
Then it obviously exists somewhere.
Well, Yes and No, they don't exist, at least not yet. The recorded files exist and Reaper keeps some information in its back for later management, but the takes/items-datastructures are only created AFTER you ended the recording, or you could access them via reaper.GetMediaItem().
I had the same idea back then as the UI obviously shows an existing and growing item but in fact, Reaper creates the datastructure for item/takes only after that.
So you can't access them until then.

Technically it would be possible to make something like that working, so the devs could add accessible items of the items in recording as well.
BUT as I said, you would need to limit access to such items. You have plenty functions who allow setting attributes like position or length who shouldn't be alterable during recording to prevent possible playback-problems.
Others, as I said like take markers could be easily changed during recording.

That's the challenge. This must be balanced with the current paradigms of Item/Take-objects as no script is expecting items only halfway alterable and access of the other half restricted. This could make old scripts incompatible who rely on that paradigm.
So the paradigm of getting an item/take-object and working with it has potential backwards-compatibility-problems with items currently in recording. I mean, try to delete an item currently in recording. You don't want this at all nor can't you, not even via Reaper's GUI.

So to make this go real good, you would either need to overhaul the current system, as take-objects and item-objects have a precise way of working who must be compatible with old scripts.

Or, you add takemarker-functions that can be used only for items currently in recording and not for any existing item.

For instance:
Quote:
boolean retval, integer take_marker_idx, string take_marker_guid, integer itemidx, integer takeidx = reaper.AddTakeMarker_WhileRecording(MediaTrack track, string markername, integer colorvalue)
which would add a take-marker to the item/take currently in recording on a certain track and would be added to the item/take after recording automatically by Reaper, which could be accessed after recording with the regular take-marker-functions, as you know the itemnr, takenr and takemarker-number and therefore can "refind" the takemarker.

This would keep the already existing item/take-system intact while allowing to add take-markers for items currently recording, as you don't need to get Item/Take-objects first before adding a stretch-marker.
But it also means, that setting or deleting them during recording wouldn't work. And if the item in recording isn't finished yet, the returned item/take-number is still invalid and therefor you need to wait until the recording is finished, before this item/take is actually accessible.

I personally would love to see GetSetMediaItemInfo_String() for items in recording as well.
And plenty of other item/take-attributes accessible like getting these during recording:
Code:
D_POSITION : double * : item position in seconds
I_LASTY : int * : Y-position of track in pixels (read-only)
I_LASTH : int * : height in track in pixels (read-only)
I_CUSTOMCOLOR : int * : custom color, OS dependent color|0x100000 (i.e. ColorToNative(r,g,b)|0x100000). If you do not |0x100000, then it will not be used, but will store the color.
I_CURTAKE : int * : active take number
IP_ITEMNUMBER : int, item number on this track (read-only, returns the item number directly)
Ooof....I guess, I was overspecific with that one, as I'm too deep into developing properly designed API-functions for my Ultraschall-API and immediately see the nightmarish dependencies coming up.
Sorry for that.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish

Last edited by Meo-Ada Mespotine; 10-31-2020 at 02:27 PM.
Meo-Ada Mespotine is online now   Reply With Quote
Old 11-06-2020, 05:16 PM   #335
todoublez
Human being with feelings
 
todoublez's Avatar
 
Join Date: Aug 2019
Location: beijing
Posts: 529
Default

it would be great to have a API that can manipulate track groups name.
Like we can set the group name based on VCA's name in one go.
just to make the groups easier to manage.
__________________
Reaper 6.15 / SWS/S&M: v2.11.0 / Hackintosh OSX High Sierra 10.13.6
i9 9900KS / 8 Cores base:4.0Ghz turbo:5.0Ghz / 64G RAM /
JS_ReaScriptAPI: v1.215 / Ultraschall API: v43220.00
todoublez is offline   Reply With Quote
Old 12-06-2020, 10:20 AM   #336
en5ca
Human being with feelings
 
Join Date: Dec 2018
Posts: 159
Default

Code:
Lua: bool reaper.TrackFX_SetComment(MediaTrack tr, integer fx, string str)
en5ca is offline   Reply With Quote
Old 12-06-2020, 10:24 AM   #337
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

Quote:
Originally Posted by en5ca View Post
Code:
Lua: bool reaper.TrackFX_SetComment(MediaTrack tr, integer fx, string str)

How can you set a comment for fx?
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 12-06-2020, 10:30 AM   #338
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,610
Default

It's the text field at the top of the FX GUI in the FX chain. It's stored in a <COMMENT subchunk in the RPP.
cfillion is offline   Reply With Quote
Old 12-06-2020, 10:40 AM   #339
en5ca
Human being with feelings
 
Join Date: Dec 2018
Posts: 159
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
How can you set a comment for fx?
Quote:
Originally Posted by cfillion View Post
It's the text field at the top of the FX GUI in the FX chain. It's stored in a <COMMENT subchunk in the RPP.
I was wishing for that API call.

Is it possible to modify Track State Chunk <FXCHAIN section safely without excessive string manipulation?
en5ca is offline   Reply With Quote
Old 12-06-2020, 10:45 AM   #340
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

Ahh, thnx.

@en5ca
Expect that in the next Ultraschall-API release. Shouldn't be that hard for me to add that.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 12-06-2020, 03:49 PM   #341
en5ca
Human being with feelings
 
Join Date: Dec 2018
Posts: 159
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Ahh, thnx.

@en5ca
Expect that in the next Ultraschall-API release. Shouldn't be that hard for me to add that.
Ok. Do you know if it's possible to parse ReaScript API Chunks reliably with native Lua functions?
en5ca is offline   Reply With Quote
Old 12-06-2020, 04:16 PM   #342
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

Quote:
Originally Posted by en5ca View Post
Ok. Do you know if it's possible to parse ReaScript API Chunks reliably with native Lua functions?
Yes, but that wouldn't be enough, as the comment is stored as Base64-string. So to change it, you would need to encode the new string as Base64.
I have such a function in Ultraschall-API and also other functions to parse FXChains, so adding/setting/deleting the comment shouldn't be that hard.

Haven't checked yet, whether changing the statechunk immediately updates the shown comment in the fx-chain, but I will see.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 12-07-2020, 05:13 AM   #343
en5ca
Human being with feelings
 
Join Date: Dec 2018
Posts: 159
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Yes, but that wouldn't be enough, as the comment is stored as Base64-string. So to change it, you would need to encode the new string as Base64.
I have such a function in Ultraschall-API and also other functions to parse FXChains, so adding/setting/deleting the comment shouldn't be that hard.

Haven't checked yet, whether changing the statechunk immediately updates the shown comment in the fx-chain, but I will see.
Ok. Actually, I am more interested in plain machine readable/writable tagging, so any method of adding some sort of custom identifier to TrackFX would be welcome. Preferably with a native Lua/ReaScript API.
en5ca is offline   Reply With Quote
Old 12-07-2020, 07:43 AM   #344
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

That's not possible currently, afaik. Only "reusing" comment or maybe even the fx-name(which is editable as well) were an option, if it shall be connected to the FX(so copying the FX would retain the information).

You could ask as FR for a equivalent of

https://mespotin.uber.space/Ultrasch...temInfo_String

for FX.

GetSetMediaItemInfo_String allows setting something like "tags" to items(there's something similar available for tracks, takes and envelopes as well). For this, it uses the attribute

Quote:
P_EXT:xyz : char * : extension-specific persistent data
So if something similar would be added for FX in general, it could be done via API. And more convenient than any statechunk-manipulation could ever do(even if statechunks would allow it already).
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 12-09-2020, 12:24 AM   #345
en5ca
Human being with feelings
 
Join Date: Dec 2018
Posts: 159
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
That's not possible currently, afaik. Only "reusing" comment or maybe even the fx-name(which is editable as well) were an option, if it shall be connected to the FX(so copying the FX would retain the information).

You could ask as FR for a equivalent of

https://mespotin.uber.space/Ultrasch...temInfo_String

for FX.

GetSetMediaItemInfo_String allows setting something like "tags" to items(there's something similar available for tracks, takes and envelopes as well). For this, it uses the attribute



So if something similar would be added for FX in general, it could be done via API. And more convenient than any statechunk-manipulation could ever do(even if statechunks would allow it already).
Ok. So far I've solved this by first reading all project track state chunks into an internal 'cache' table (Lua script) with MediaTrack* as the key, and chunk as value. Then manipulating chunks in the cache by keys, discarding untouched chunks from cache, and then finally syncing/flushing the 'difference' back to project. Seems to work reliably and relatively fast, as long as the track count in difference stays relatively small, no matter the project size. Just hoping there won't be any 'sync difference errors' with this method, and my string manipulations arent't off.
en5ca is offline   Reply With Quote
Old 12-24-2020, 04:00 AM   #346
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 117
Default

Feature Request:

reaper.GetProjectLength(ReaProject proj)

current behavior:
returns length of project (maximum of end of media item, markers, end of regions, tempo map

proposed behavior
returns length of project (maximum of end of media item, markers, end of regions, tempo map, automation items)
tufb is offline   Reply With Quote
Old 12-24-2020, 07:42 AM   #347
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

Quote:
Originally Posted by tufb View Post
Feature Request:

reaper.GetProjectLength(ReaProject proj)

current behavior:
returns length of project (maximum of end of media item, markers, end of regions, tempo map

proposed behavior
returns length of project (maximum of end of media item, markers, end of regions, tempo map, automation items)
If you use my Ultraschall-Api, you can try
https://mespotin.uber.space/Ultrasch...tProjectLength
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 12-28-2020, 01:53 AM   #348
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 117
Default

I suppose, it's a philosophical question. I haven't checked functionality yet, but envelope points are not mentioned either. In that sense, envelopes are not relevant for project length, at this time?
tufb is offline   Reply With Quote
Old 12-28-2020, 02:23 AM   #349
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

I think I could add it. Iirc it's already on my todo list, so would be a good reason to do so.

Including automation items would be possible too.

I have no idea bout tempo map, as I never use it. Is the tempo map a regular envelope or something else?
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 12-28-2020, 06:10 AM   #350
tufb
Human being with feelings
 
Join Date: Dec 2017
Posts: 117
Default

My post is a feature request for, and discussion of Reaper's API.
tufb is offline   Reply With Quote
Old 01-05-2021, 09:36 PM   #351
adcingeo
Human being with feelings
 
Join Date: Jan 2011
Location: Tasmania, Australia
Posts: 32
Default

Quote:
Originally Posted by todoublez View Post
it would be great to have a API that can manipulate track groups name.
Like we can set the group name based on VCA's name in one go.
just to make the groups easier to manage.
I would love to see this as an API function. Something like
SetGroupName(ReaProject project, int group_number, String name)

Does anyone know if there's already a way to set the group name via the API in the same way we can in the Grouping for n Selected Tracks dialog?
adcingeo is offline   Reply With Quote
Old 02-05-2021, 03:57 AM   #352
ply
Human being with feelings
 
ply's Avatar
 
Join Date: Aug 2014
Location: Kraków, PL
Posts: 20
Default

Is there any way to access global recording pass counter? I haven't found any API and would like to request for it
__________________
my ReaPack repo with Source-Destination editing scripts and other utils
ply is offline   Reply With Quote
Old 03-20-2021, 02:16 AM   #353
Rodilab
Human being with feelings
 
Rodilab's Avatar
 
Join Date: Jan 2021
Location: Paris
Posts: 158
Default SetMediaFileMetadata

Wa have the nice GetMediaFileMetadata().
It would be great to have a SetMediaFileMetadata().

Write metadata would be useful, for example to preserve some iXML metadata after glue. Or to copy and paste some metadatas from one source take to another.


Please

Last edited by Rodilab; 03-20-2021 at 02:25 AM.
Rodilab is offline   Reply With Quote
Old 03-20-2021, 03:29 AM   #354
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 7,496
Default

Quote:
Or to copy and paste some metadatas from one source take to another.

I technically have this on some of my premium script (and not just BWF, all the chunks, iXML etc...) but this is really advanced stuff I don't even think it is on a public pack, cause adding filtering would need lot of custom code.



So yes having a Set metadata function would surely need less coding cause it could target specific metadata field / chunk more easily).
X-Raym is offline   Reply With Quote
Old 03-21-2021, 02:39 PM   #355
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

The devs once said, that they are very vary of functions, that change media files. Probably out of fear, messing things up.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 03-30-2021, 11:46 PM   #356
Rodilab
Human being with feelings
 
Rodilab's Avatar
 
Join Date: Jan 2021
Location: Paris
Posts: 158
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
The devs once said, that they are very vary of functions, that change media files. Probably out of fear, messing things up.
I understand.
But technically, it is possible to manually edit metadatas via the Media Explorer (including BWF). Shouldn't it be more dangerous to do it via a script, right?
Rodilab is offline   Reply With Quote
Old 04-07-2021, 05:27 AM   #357
rstockm
Human being with feelings
 
rstockm's Avatar
 
Join Date: May 2012
Location: Berlin, Germany
Posts: 166
Default API Feature Request: custom modal dialog buttons

As of now, the MB() offers these button-choices for modal dialogs:

0, OK
1, OK CANCEL
2, ABORT RETRY IGNORE
3, YES NO CANCEL
4, YES NO
5, RETRY CANCEL

which is not so bad after all.
Nevertheless, best practice is to have the actual task/verb printed on the button instead of "OK" or "Yes".
Apple addressed this ages ago, this is from 1992 I guess:




To boost up the UX my suggestion would be to offer an "extended" MB() command, where I as the author of a script can define the text on the buttons to my liking. Bonus karma for giving us 3 or even 4 options if we wish.

Before:

"Do you want to save this file?"
[no] [yes]

after:
"Do you want to save this file?"
[cancel] [save as...] [save]
rstockm is offline   Reply With Quote
Old 04-07-2021, 10:59 AM   #358
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,528
Default

Quote:
Originally Posted by rstockm View Post
As of now, the MB() offers these button-choices for modal dialogs:

0, OK
1, OK CANCEL
2, ABORT RETRY IGNORE
3, YES NO CANCEL
4, YES NO
5, RETRY CANCEL

which is not so bad after all.
Nevertheless, best practice is to have the actual task/verb printed on the button instead of "OK" or "Yes".
Apple addressed this ages ago, this is from 1992 I guess:


To boost up the UX my suggestion would be to offer an "extended" MB() command, where I as the author of a script can define the text on the buttons to my liking. Bonus karma for giving us 3 or even 4 options if we wish.

Before:

"Do you want to save this file?"
[no] [yes]

after:
"Do you want to save this file?"
[cancel] [save as...] [save]

And an optional checkbox for stuff like "remember my choice for the future"
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1400 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 04-14-2021, 11:23 AM   #359
JRTaylorMusic
Human being with feelings
 
Join Date: Feb 2019
Location: Austin, TX
Posts: 133
Default GetSetNudge

number reaper.GetSetNudge(ReaProject project, integer nudgeflag, integer nudgewhat, integer nudgeunits, number value, integer copies)
  • nudgeflag: &1=set to value (otherwise nudge by value), &2=snap
  • nudgewhat: 0=position, 1=left trim, 2=left edge, 3=end position, 4=right trim, 5=contents, 6=duplicate, 7=edit cursor
  • nudgeunit: 0=ms, 1=seconds, 2=grid, 3=256th notes, ..., 15=whole notes, 16=measures.beats (1.15 = 1 measure + 1.5 beats), 17=samples, 18=frames, 19=pixels, 20=item lengths, 21=item selections
  • value: amount to nudge by, or value to set to
  • copies: in nudge duplicate mode, number of copies (otherwise ignored)
JRTaylorMusic is offline   Reply With Quote
Old 04-17-2021, 04:00 PM   #360
iluvcapra
Human being with feelings
 
Join Date: Nov 2011
Posts: 6
Default ProjectBay Access options

reaper.CountProjectBay(proj)
reaper.GetProjectBay(proj, idx)
reaper.GetProjectBayMediaItem(proj, bay, idx)

Also it'd be great if the folders in the bays could be accessed and enumerated?
iluvcapra 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 04:59 PM.


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