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: 279
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 - 1111 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper
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: 98
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 online now   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: 279
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 - 1111 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper
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,635
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,405
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
Posts: 158
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 offline   Reply With Quote
Old 05-25-2020, 04:56 AM   #610
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Posts: 158
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 offline   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,635
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
Posts: 158
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 offline   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,635
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
Posts: 158
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 offline   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: 279
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 - 1111 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper
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,145
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: 279
Default

Thanks
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1111 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper
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: 279
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 - 1111 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper
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,635
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
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 07:06 AM.


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