Old 05-06-2020, 12:33 PM   #601
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Quote:
Originally Posted by Held View Post
@Meo-Ada Mespotine That's really cool. Thank you. I've bookmarked it for future reference.

Any chance you could add a search function like X-Raym has here: https://www.extremraym.com/cloud/reascript-doc/

That would be the best of both worlds
Working on that, but it's difficult. But yeah, it's definitely needed. Especially the option of putting the functioncall into the clipboard by clicking makes stuff so much easier.

And it looks so much better...
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-07-2020, 05:47 AM   #602
Held
Human being with feelings
 
Join Date: Nov 2019
Posts: 103
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Working on that, but it's difficult. But yeah, it's definitely needed. Especially the option of putting the functioncall into the clipboard by clicking makes stuff so much easier.

And it looks so much better...
Of course, no pressure. Your page is already a great help the way it is! Thanks again
Held is offline   Reply With Quote
Old 05-07-2020, 11:40 PM   #603
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Düsseldorf, Germany
Posts: 89
Default

Is there a callback when switching between tabbed projects?
Burtan is offline   Reply With Quote
Old 05-08-2020, 01:08 AM   #604
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Quote:
Originally Posted by Burtan View Post
Is there a callback when switching between tabbed projects?
What do you mean by callback?
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-08-2020, 06:03 AM   #605
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,729
Default

Quote:
Originally Posted by Burtan View Post
Is there a callback when switching between tabbed projects?
IReaperControlSurface::SetTrackListChange() gets called when switching project tabs (not exclusively in this case though, but afaik it's the only callback when switching project tabs, someone may correct me.)

Example usage in SWS:
https://github.com/reaper-oss/sws/bl....cpp#L467-L505
nofish is offline   Reply With Quote
Old 05-08-2020, 06:45 AM   #606
Burtan
Human being with feelings
 
Join Date: Jan 2013
Location: Düsseldorf, Germany
Posts: 89
Default

Quote:
Originally Posted by nofish View Post
IReaperControlSurface::SetTrackListChange() gets called when switching project tabs (not exclusively in this case though, but afaik it's the only callback when switching project tabs, someone may correct me.)

Example usage in SWS:
https://github.com/reaper-oss/sws/bl....cpp#L467-L505
Thanks, I'll give it a try.
Burtan is offline   Reply With Quote
Old 05-12-2020, 04:09 PM   #607
mrelwood
Human being with feelings
 
mrelwood's Avatar
 
Join Date: Nov 2006
Location: Finland
Posts: 1,425
Default

Blitted text is dim and incoherent.

I'm having trouble getting text strings to display with original brightness and contrast when the text is first written in an alternate gfx buffer and then blitted to view in a JSFX.

If the blit destination size has any scaling, the text will understandably be much worse, but even when the text was written in r,g,b,a = 1,1,1,1 , and blitted with floor(gfx_x), floor(gfx_y), a=1 and no scaling, the text doesn't look very good.

If I fill the gfx buffer with any color before entering the text, the text blits correctly, but that is not possible at this time because I need to retain the opacity and blit only the text.

Are there any known work arounds for this issue? Other than not blit any text in the first place that is.

__________________
______Announcing__mrelwood plugins______
.. MacBook Pro 15" Late '13 .. Scarlett 6i6, Saffire Pro 24 DSP (+ADA8000) .. FCA610 .. EVE: SC207 .. Focal: Alpha 65, CMS 40, Listen Pro ..

Last edited by mrelwood; 05-14-2020 at 10:58 PM.
mrelwood is offline   Reply With Quote
Old 05-14-2020, 09:26 AM   #608
outpatient
Human being with feelings
 
outpatient's Avatar
 
Join Date: Dec 2019
Posts: 19
Default

Is there any way to set the next inserted note length to a particular value?

I'm trying to use MIDIEditor_SetSetting_int but it doesn't seem to let you touch the same parameters as MIDIEditor_GetSetting_int.

GetSetting works just fine, but SetSetting always returns false.

Here's a simple example in LUA:

Code:
reaper.ClearConsole()
editor = reaper.MIDIEditor_GetActive()
defaultLen =  reaper.MIDIEditor_GetSetting_int(editor, "default_note_len")
worksOK = reaper.MIDIEditor_SetSetting_int(editor, "default_note_len", defaultLen*2)
reaper.ShowConsoleMsg(tostring(worksOK))
outpatient is offline   Reply With Quote
Old 05-24-2020, 10:18 PM   #609
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by mespotine View Post
If you use SWS, you can do the following:

First, call this function:
https://mespotin.uber.space/Ultrasch...eCursorContext

Then call this function, which returns the envelope underneath the mouse:
https://mespotin.uber.space/Ultrasch...ntext_Envelope

The order of these two functions is important here. Otherwise, you'll get anything, but not the envelope currently under the mouse, only either nothing or some old one.
Sorry the big gap between message. As I tried out I was only receiving the message of what envelope lane is under mouse if my pointer was around the first line, and it was very difficult also to align, at least I think it was what happen. 98% of time I would get a nil. Is there an way to get the info about the envelope under mouse with my mouse being anywhere inside the envelope?
IMG showing what I tried "yellow area where I recived some not nil info"

Code:
function Msg(param)
  reaper.ShowConsoleMsg(tostring(param).."\n")
end

a, b, c = reaper.BR_GetMouseCursorContext()
d, e = reaper.BR_GetMouseCursorContext_Envelope()
 reaper.ShowConsoleMsg("")
Msg(a)
Msg(b)
Msg(c)
Msg(d)
Msg(e)
daniellumertz is online now   Reply With Quote
Old 05-25-2020, 04:56 AM   #610
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

reaper.GetTrackEnvelopeByName

How can I get an specific sends envelope by the name of them? reaper seems to call them all send Volume, Send Mute, Send Pan...
Tried reaper.GetTrackEnvelopeByName But it just pick the firstone with the name....
Trying to get an send for an named track....
daniellumertz is online now   Reply With Quote
Old 05-25-2020, 07:51 AM   #611
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,729
Default

Quote:
Originally Posted by daniellumertz View Post
Is there an way to get the info about the envelope under mouse with my mouse being anywhere inside the envelope?
You need the latest SWS beta intsalled for it to work properly.
https://www.sws-extension.org/download/pre-release/

test script:

Code:
function msg(m)
  return reaper.ShowConsoleMsg(tostring(m) .. "\n")
end

lastSegmentOut = ""

function GetEnvUnderMouse()
  windowOut, segmentOut, detailsOut = reaper.BR_GetMouseCursorContext()
 
  if lastSegmentOut ~= segmentOut then
    if segmentOut == "envelope" then
      env, isTakeEnv = reaper.BR_GetMouseCursorContext_Envelope() 
      msg("envelope under mouse: ")
      msg(env)
     else
      msg("no envelope under mouse")
    end
  end
  
  lastSegmentOut = segmentOut
  reaper.defer(GetEnvUnderMouse)
end

GetEnvUnderMouse()
nofish is offline   Reply With Quote
Old 05-26-2020, 07:55 AM   #612
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by nofish View Post
You need the latest SWS beta intsalled for it to work properly.
https://www.sws-extension.org/download/pre-release/

test script:

Code:
function msg(m)
  return reaper.ShowConsoleMsg(tostring(m) .. "\n")
end

lastSegmentOut = ""

function GetEnvUnderMouse()
  windowOut, segmentOut, detailsOut = reaper.BR_GetMouseCursorContext()
 
  if lastSegmentOut ~= segmentOut then
    if segmentOut == "envelope" then
      env, isTakeEnv = reaper.BR_GetMouseCursorContext_Envelope() 
      msg("envelope under mouse: ")
      msg(env)
     else
      msg("no envelope under mouse")
    end
  end
  
  lastSegmentOut = segmentOut
  reaper.defer(GetEnvUnderMouse)
end

GetEnvUnderMouse()
Thank you nofish! now it is working here!!
daniellumertz is online now   Reply With Quote
Old 05-26-2020, 08:47 AM   #613
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,729
Default

Quote:
Originally Posted by daniellumertz View Post
Thank you nofish! now it is working here!!
Nice, you're welcome.

For the other one:
Quote:
Trying to get an send for an named track....
Basically (if I understand the goal correctly) you have to
- loop through all existing tracks in the project:
https://github.com/ReaTeam/ReaScript...plate.lua#L228

- in the loop get the track name of each track using GetSetMediaTrackInfo_String, and if it matches the desired name get the send of it..
nofish is offline   Reply With Quote
Old 05-26-2020, 09:11 PM   #614
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by nofish View Post
Nice, you're welcome.

For the other one:


Basically (if I understand the goal correctly) you have to
- loop through all existing tracks in the project:
https://github.com/ReaTeam/ReaScript...plate.lua#L228

- in the loop get the track name of each track using GetSetMediaTrackInfo_String, and if it matches the desired name get the send of it..
I will try tomorrow and update how it goes thx! but to clarify what I wanted was to open the envelope sends volume and pan in one track ( that has not being opened yet ) the way I did it was putting it on write mode and using
reaper.SetTrackSendUIVol and reaper.SetTrackSendUIPan to write an value and then them again to get them back to 0.

"a = selected track"
Code:
local ini_mode = reaper.GetTrackAutomationMode( a ) --record original modee to recall later
 reaper.SetTrackAutomationMode( a, 3 )--put track in write mode

     reaper.SetTrackSendUIVol( a, 0, 3, 0 ) -- send and return volume to appear in 
     reaper.SetTrackSendUIVol( a, 0, 1, 0 )
     
     reaper.SetTrackSendUIPan( a, 0, 3, 0 ) -- send and return pan
     reaper.SetTrackSendUIPan( a, 0, 0, 0 )

 reaper.SetTrackAutomationMode( a, ini_mode )--track in write mode NEED TO SUBS a to bus
I tested the code and it worked(if the sends that I want to appear were the last created) like I wanted but I was thinking this may encounter problems if the tracks have more sends ( although I tested and it went ok ). So was thinking in get the envelope by it's name but using

buf = reaper.Envelope_FormatValue( env, value )

all sends value/pan seems to have the same name that was why I asked about how to get them by the name. Thxx!! I will see tomorrow better what you suggested!

Last edited by daniellumertz; 05-26-2020 at 09:19 PM.
daniellumertz is online now   Reply With Quote
Old 05-30-2020, 03:44 PM   #615
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

I'm currently documenting the SWS 2.11.0 functions and stumbled over the altered CF_GetClipboard-function.

My question is now: how do I set the last parameter buf_sz to always get the whole content of the clipboard?
Currently I use CF_GetClipboardBig, but as it's deprecated, I would like to switch over to CF_GetClipboard.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-30-2020, 03:49 PM   #616
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,194
Default

SWS 2.11 automatically resizes the buffer to fit the clipboard's contents.

As of SWS v2.12, this function no longer requires the buf/buf_sz parameters.
Code:
local everything = reaper.CF_GetClipboard()
cfillion is offline   Reply With Quote
Old 05-30-2020, 03:56 PM   #617
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Thanks
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-01-2020, 01:06 PM   #618
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Is there a way to get, if the system, who runs Reaper, is multimonitored?
I would like to be able to put certain gfx-windows on a second monitor, if one is attached to it, otherwise on the first monitor.
But I would need to know, if it's multimonitor and where to put it actually to be on monitor two.

Could my_getViewport help with that?
https://mespotin.uber.space/Ultrasch...my_getViewport
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-01-2020, 01:57 PM   #619
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,729
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Is there a way to get, if the system, who runs Reaper, is multimonitored?
I would like to be able to put certain gfx-windows on a second monitor, if one is attached to it, otherwise on the first monitor.
But I would need to know, if it's multimonitor and where to put it actually to be on monitor two.

Could my_getViewport help with that?
https://mespotin.uber.space/Ultrasch...my_getViewport
For getting the number of connected monitors, NF_Win32_GetSystemMetrics (added in SWS 2.12.0 beta) should help.
Code:
cntMonitors = reaper.NF_Win32_GetSystemMetrics(80) -- SM_CMONITORS = 80
(this is the equivalent to the WIN32 API function GetSystemMetrics.)

edit:
I don't know about my_getViewport, as I've never used it myself.

Last edited by nofish; 06-01-2020 at 02:23 PM.
nofish is offline   Reply With Quote
Old 06-19-2020, 05:38 PM   #620
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

So, if I have the trackenvelope "name" ( ex: userdata: 000000000AA0C0D8 or something like that) but it is not visible in the arrange view, how I make it appear?


I need to add an envelope point ???
daniellumertz is online now   Reply With Quote
Old 06-19-2020, 07:32 PM   #621
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

If you use my Ultraschall-API, you can use this function:

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

To get, if the envelope is visible or not, you can use this function:
https://mespotin.uber.space/Ultrasch...elopeState_Vis
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-19-2020, 09:19 PM   #622
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
If you use my Ultraschall-API, you can use this function:

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

To get, if the envelope is visible or not, you can use this function:
https://mespotin.uber.space/Ultrasch...elopeState_Vis
Hi mesopotine! I installed here and trying it, very cool.

I tested the functions with something simple and it worked nicely!

But using in the send envelopes I am having some trouble.
It is strange "GetEnvelopeState_Vis" says that it is visible but it is not.
I even putted

ultraschall.GetEnvelopeState_Vis -- to print if the envelope is visible and got 0
ultraschall.SetEnvelopeState_Vis -- to make envelope visible
ultraschall.GetEnvelopeState_Vis -- to print if the envelope is visible and got 1

I havent got nill or any error, it just didn't appears

the code:
Make a project with two tracks and select the first
Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua") 



 --- last update 2020/06/19
 function Msg(param)
   reaper.ShowConsoleMsg(tostring(param).."\n")
 end
 
  
  reaper.ShowConsoleMsg("")
 
 

 a = reaper.GetSelectedTrack( 0, 0 )


 b = reaper.GetTrack (0,1)
 reaper.CreateTrackSend( a , b )
 reaper.SetTrackSendInfo_Value( a, 0, 0, "I_SENDMODE" , 3 )
 sends_count = reaper.GetTrackNumSends( a, 0 )
 
 
 
 
 send_env_vol = reaper.BR_GetMediaTrackSendInfo_Envelope( a , 0, sends_count -1 , 0 ) --volume of last add send
 send_env_pan = reaper.BR_GetMediaTrackSendInfo_Envelope( a , 0, sends_count -1 , 1 ) --pa of last add send
 send_env_mute = reaper.BR_GetMediaTrackSendInfo_Envelope( a , 0, sends_count -1 , 2 ) --mute of last add send
 
 Msg(send_env_vol)
 visible,  lane,  unknown = ultraschall.GetEnvelopeState_Vis(send_env_vol)
 Msg(visible)
 retval,  EnvelopeStateChunk = ultraschall.SetEnvelopeState_Vis(send_env_vol, 1 , 1, 1)
 visible,  lane,  unknown = ultraschall.GetEnvelopeState_Vis(send_env_vol)
 Msg(visible)
daniellumertz is online now   Reply With Quote
Old 06-19-2020, 11:50 PM   #623
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

This is because the envelope hasn't been made active yet. I think it is a bug in Reaper as I should be able to activate it via API.

So for the time being, you need to show the envelope first once. After that, you can toggle it programmatically.

I will need to report this Reaper bug first so the devs can fix it.

:/
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-20-2020, 06:30 AM   #624
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
This is because the envelope hasn't been made active yet. I think it is a bug in Reaper as I should be able to activate it via API.

So for the time being, you need to show the envelope first once. After that, you can toggle it programmatically.

I will need to report this Reaper bug first so the devs can fix it.

:/
ohh okk, but glad it made me test your api, very cool! Probably will see us3 it from now on.

with only reaper api it is not possible?

my workaround is to pu track in write mode modfy something fhem back to original state, works but should be an easiest way....
daniellumertz is online now   Reply With Quote
Old 06-20-2020, 01:49 PM   #625
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

As soon as I find a way, I'll add that right away to the Ultraschall-Api, even if it's difficult to achieve.
The point of Ultraschall-Api is to make difficult and advanced things easier to use for casual scripters.
My rendering-functions are such a case. Possible with Reaper's own Api(well almost) but really advanced. So I went through that difficulty to provide functions, who do that stuff for you so you don't need to bother with the difficulties.

I made a feature request for a function to activate envelopes, so chime in there.
Maybe the devs hear our wishes

Until then, only muteenvelopes can be activated yet. I hope I can add pan, volume, volume-pre-FX as well.

But the ones for send are currently out of reach...
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-20-2020, 01:57 PM   #626
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Sexan posted an idea in the feature request post. This could work for sendenvelopes.
Wish me luck
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-20-2020, 07:49 PM   #627
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Code:
function ultraschall.ActivateEnvelope(Envelope, visible, bypass)
  -- Meo-Ada Mespotine
  -- activates an envelope
  -- thanks to Sexan for giving the hint to make this work
  --
  -- parameters:
  --    TrackEnvelope Envelope - the envelope, which you want to activate
  --    optional boolean visible - true or nil, show envelope; false, don't show envelope
  --    optional boolean bypass  - true or nil, don't bypass envelope; false, bypass envelope
  
  local _, EnvelopeStateChunk = reaper.GetEnvelopeStateChunk(send_env_vol, "", false)
  if EnvelopeStateChunk:match("PT ")==nil then
   EnvelopeStateChunk = EnvelopeStateChunk:match("(.*)>").."PT 0 1 0\n>"
  end
  if bypass~=false then
    EnvelopeStateChunk = string.gsub(EnvelopeStateChunk, "ACT . ", "ACT 1 ")
  end
  if visible~=false then
    EnvelopeStateChunk = string.gsub(EnvelopeStateChunk, "VIS . ", "VIS 1 ")
  end
  return reaper.SetEnvelopeStateChunk(Envelope, EnvelopeStateChunk, false)
end
Could you try this function? Just run this function with a newly added send-envelope and it should make it running perfectly. Thanks to Sexan
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-22-2020, 07:35 AM   #628
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Code:
function ultraschall.ActivateEnvelope(Envelope, visible, bypass)
  -- Meo-Ada Mespotine
  -- activates an envelope
  -- thanks to Sexan for giving the hint to make this work
  --
  -- parameters:
  --    TrackEnvelope Envelope - the envelope, which you want to activate
  --    optional boolean visible - true or nil, show envelope; false, don't show envelope
  --    optional boolean bypass  - true or nil, don't bypass envelope; false, bypass envelope
  
  local _, EnvelopeStateChunk = reaper.GetEnvelopeStateChunk(send_env_vol, "", false)
  if EnvelopeStateChunk:match("PT ")==nil then
   EnvelopeStateChunk = EnvelopeStateChunk:match("(.*)>").."PT 0 1 0\n>"
  end
  if bypass~=false then
    EnvelopeStateChunk = string.gsub(EnvelopeStateChunk, "ACT . ", "ACT 1 ")
  end
  if visible~=false then
    EnvelopeStateChunk = string.gsub(EnvelopeStateChunk, "VIS . ", "VIS 1 ")
  end
  return reaper.SetEnvelopeStateChunk(Envelope, EnvelopeStateChunk, false)
end
Could you try this function? Just run this function with a newly added send-envelope and it should make it running perfectly. Thanks to Sexan
Hi mespotine ! Sorry for the delay.... Thanks for all the replies and the the post, I have read it and I am slowly trying to parse all info there . Tonight when I get home I will try your suggestions and let you know, thanks very much!
daniellumertz is online now   Reply With Quote
Old 06-22-2020, 12:13 PM   #629
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Out of curiosity and because someone mentioned that in another thread: is there a way to enhance the capabilities of the SWS ReaConsole programmatically or by editing ini-files?
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-22-2020, 12:20 PM   #630
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,194
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Out of curiosity and because someone mentioned that in another thread: is there a way to enhance the capabilities of the SWS ReaConsole programmatically
Not at runtime. ReaConsole is implemented in Console/Console.cpp, patches to enhance it are welcome.

(There was reaconsole_customcommands.txt but it's long been deprecated in favor of Cycle Actions)
cfillion is offline   Reply With Quote
Old 06-22-2020, 12:25 PM   #631
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Quote:
Originally Posted by cfillion View Post
Not at runtime. ReaConsole is implemented in Console/Console.cpp, patches to enhance it are welcome.
Unfortunately my CPP-knowledge is non-existant at best. Would it be possible to have something like an ini-file, into which I can add shortcuts and an action associated with it? As a basic enhancement-possibility?
And a function for outputting stuff into the ReaConsole, so I can give feedback to ReaConsole-users from my script.

I think, this would allow a lot without having to fiddle around with the code directly time and again.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-26-2020, 07:48 PM   #632
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Code:
function ultraschall.ActivateEnvelope(Envelope, visible, bypass)
  -- Meo-Ada Mespotine
  -- activates an envelope
  -- thanks to Sexan for giving the hint to make this work
  --
  -- parameters:
  --    TrackEnvelope Envelope - the envelope, which you want to activate
  --    optional boolean visible - true or nil, show envelope; false, don't show envelope
  --    optional boolean bypass  - true or nil, don't bypass envelope; false, bypass envelope
  
  local _, EnvelopeStateChunk = reaper.GetEnvelopeStateChunk(send_env_vol, "", false)
  if EnvelopeStateChunk:match("PT ")==nil then
   EnvelopeStateChunk = EnvelopeStateChunk:match("(.*)>").."PT 0 1 0\n>"
  end
  if bypass~=false then
    EnvelopeStateChunk = string.gsub(EnvelopeStateChunk, "ACT . ", "ACT 1 ")
  end
  if visible~=false then
    EnvelopeStateChunk = string.gsub(EnvelopeStateChunk, "VIS . ", "VIS 1 ")
  end
  return reaper.SetEnvelopeStateChunk(Envelope, EnvelopeStateChunk, false)
end
Could you try this function? Just run this function with a newly added send-envelope and it should make it running perfectly. Thanks to Sexan
Hi Mespotine so I studied the code for some time now haha, but I still naive in many things specially this chunk things....

It worked, but I got a question why in the line
Code:
    local _, EnvelopeStateChunk = reaper.GetEnvelopeStateChunk(send_env_vol, "", false)
is not the --Envelope-- variable that is needed in the function? I tried to switch and didn't work can't find why since I'm calling the function like that:

Code:
 ultraschall.ActivateEnvelope(send_env_vol, true, true)
Also is there a way to apply this to other things like to activate the volume/pan envelopes ? I'm trying to understand what is going on on the code and modify to make but it is a little too much for me right now :x
daniellumertz is online now   Reply With Quote
Old 06-27-2020, 02:59 AM   #633
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Reaper handles different envelopes differently. Some can be activated by the approach above, some not.

The approach above works for existing envelopes who aren't activated right now. So if a function returns a valid Envelope-object, it works.

But, if it doesn't, it doesn't work.

For instance, parameter-envelopes do not exist unless specifically created. So they can't be gotten as envelope object before creating it first via UI.
Same for mute, volume, pan, etc.

I'm working on an approach for that to have envelopeactivation for all existing envelopes.

The next Ultraschall-Api update will feature a good portion of them, so you will be able to activate pan, volume, mute, including prefxones.
Send already works with the function above. The rest will come later but I have ideas how to do it.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-27-2020, 09:15 AM   #634
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Reaper handles different envelopes differently. Some can be activated by the approach above, some not.

The approach above works for existing envelopes who aren't activated right now. So if a function returns a valid Envelope-object, it works.

But, if it doesn't, it doesn't work.

For instance, parameter-envelopes do not exist unless specifically created. So they can't be gotten as envelope object before creating it first via UI.
Same for mute, volume, pan, etc.

I'm working on an approach for that to have envelopeactivation for all existing envelopes.

The next Ultraschall-Api update will feature a good portion of them, so you will be able to activate pan, volume, mute, including prefxones.
Send already works with the function above. The rest will come later but I have ideas how to do it.
thanks for your help mespotine, looking foward for your next update. Making envelopes active is demmanding most of my time when trying to scrip right now hahaha.
daniellumertz is online now   Reply With Quote
Old 06-28-2020, 11:37 AM   #635
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

I need when running a script to show a dialog box to the user enter an number of some variable in my script ( it will determine the fade duration in a part of script( the script is ok already) ) how can that be done?

I have tried Lokasenna GUI, it crashed for some reason, is there other way? I just need an box to put numbers...I might try Lokasenna again I may have missed something....
daniellumertz is online now   Reply With Quote
Old 06-28-2020, 11:41 AM   #636
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

Quote:
Originally Posted by daniellumertz View Post
I need when running a script to show a dialog box to the user enter an number of some variable in my script ( it will determine the fade duration in a part of script( the script is ok already) ) how can that be done?

I have tried Lokasenna GUI, it crashed for some reason, is there other way? I just need an box to put numbers...I might try Lokasenna again I may have missed something....
Try reaper.GetUserInputs for that. It should work for some basic inputs.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-28-2020, 07:30 PM   #637
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Try reaper.GetUserInputs for that. It should work for some basic inputs.
Thanks again Almost Finishing My script *\o/*
daniellumertz is online now   Reply With Quote
Old 07-01-2020, 10:14 AM   #638
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

@daniellumertz

Ok, I've uploaded the most recent update of Ultraschall-API. So now you have access to these functions:

ActivateTrackPanEnv
ActivateTrackPanEnv_TrackObject
ActivateTrackPreFXPanEnv
ActivateTrackPreFXPanEnv_TrackObject
ActivateTrackPreFXVolumeEnv
ActivateTrackPreFXVolumeEnv_TrackObject
ActivateTrackTrimVolumeEnv
ActivateTrackTrimVolumeEnv_TrackObject
ActivateTrackVolumeEnv
ActivateTrackVolumeEnv_TrackObject
ActivateMute
ActivateMute_TrackObject
DeactivateMute
DeactivateMute_TrackObject

Just update Ultraschall-API to the most recent and look through the docs for how to use them:
https://mespotin.uber.space/Ultrasch...Functions.html


Some envelopes are still missing, as they aren't that easy to activate without affecting too much other stuff, but I'm working on that.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 07-01-2020, 05:45 PM   #639
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 280
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
@daniellumertz

Ok, I've uploaded the most recent update of Ultraschall-API. So now you have access to these functions:

ActivateTrackPanEnv
ActivateTrackPanEnv_TrackObject
ActivateTrackPreFXPanEnv
ActivateTrackPreFXPanEnv_TrackObject
ActivateTrackPreFXVolumeEnv
ActivateTrackPreFXVolumeEnv_TrackObject
ActivateTrackTrimVolumeEnv
ActivateTrackTrimVolumeEnv_TrackObject
ActivateTrackVolumeEnv
ActivateTrackVolumeEnv_TrackObject
ActivateMute
ActivateMute_TrackObject
DeactivateMute
DeactivateMute_TrackObject

Just update Ultraschall-API to the most recent and look through the docs for how to use them:
https://mespotin.uber.space/Ultrasch...Functions.html


Some envelopes are still missing, as they aren't that easy to activate without affecting too much other stuff, but I'm working on that.
wow thanks Mespotine! that is very nice ! Tested here and worked will be using your api in future projects, and looking forward to actions to activate the others envelopes .

I think that native only fx envelopes can be actived via script using reaper.GetFXEnvelope. vol/pan/mute have options to actions to show them, but that would need to change the selection and call back later ( if you don't wanna apply it to the user selection ). Sends envelopes are tricky hahah.

Thanks for your work

I was thinking next to make something like spk77 track tags for envelopes, but it can be tricky, will see hahah....
daniellumertz is online now   Reply With Quote
Old 07-01-2020, 05:56 PM   #640
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

You're welcome. If something's not working or you need another function, head over to the Ultraschall-Api thread and I'll try to help.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine 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 11:14 PM.


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