Old 04-16-2019, 09:41 AM   #121
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

Quote:
Originally Posted by strachupl View Post
Win7
I installed new Reaper portable x32, installed sws, installed reapack and all repositories, copied your 2 versions of script and this time I cant even launch it.




Code:
Areasel.lua:2: attempt to call a nil value (field 'JS_LICE_CreateBitmap')

Code:
areasel2.lua:4: attempt to call a nil value (field 'JS_Window_Find')

I will wait till beta or something because I can't make it work.
Did you managed to start it? Did you downloaded the JS_API from link I've posted on the first page in REQUIREMENTS?
Sexan is offline   Reply With Quote
Old 04-16-2019, 11:33 AM   #122
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 394
Default

No, I will check when I will be on laptop. Last time I had strange situation. Script was working on Reaper main install but buggy as on gif. On fresh portable was throwing errors on script startup. When I updated and install all avaiable scripts in Reapack as on fresh install then on main install throwing same errors.

ps.
I have all repositories, these julian's api are avaiable on reapack I think so I installed it, or is this version you posted diffrent?
__________________
The truth is not in the middle but exactly where it is.
strachupl is offline   Reply With Quote
Old 04-16-2019, 11:35 AM   #123
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

Ok, please report back so we can narrow the issue. You on windows ? BTW you have two version of reaper installed(normal and portable)?
Sexan is offline   Reply With Quote
Old 04-16-2019, 11:51 AM   #124
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 394
Default

Quote:
Originally Posted by Sexan View Post
Ok, please report back so we can narrow the issue. You on windows ? BTW you have two version of reaper installed(normal and portable)?
All portable as I prefer it. but I will install normal and see.
__________________
The truth is not in the middle but exactly where it is.
strachupl is offline   Reply With Quote
Old 04-16-2019, 12:02 PM   #125
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

There should not be any problems with portable
Sexan is offline   Reply With Quote
Old 04-16-2019, 09:47 PM   #126
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,078
Default

Sexan... go man go.... you are on to a beautiful thing.

waiting to see where it goes next!
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain
hopi is offline   Reply With Quote
Old 04-17-2019, 08:05 AM   #127
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 129
Default

Hey Sexan!
Investigating your script found that the function

Code:
  local window, segment, details = reaper.BR_GetMouseCursorContext()
  local tr = reaper.BR_GetMouseCursorContext_Track()
a bit cpu hungry in defer loop.

Instead, you can use new, native APIs that are already available in dev versions.And soon I think they will be in the update.

Code:
   local tr_x, tr_y = reaper.GetMousePosition()
  local tr = reaper.GetTrackFromPoint(tr_x,tr_y)
nappies is offline   Reply With Quote
Old 04-17-2019, 08:32 AM   #128
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

cool, thank you. ATM I'm rewritting drawing class code, and need to update UPDATING code since now its always in loop

Last edited by Sexan; 04-17-2019 at 09:50 AM.
Sexan is offline   Reply With Quote
Old 04-17-2019, 08:44 AM   #129
vdubreeze
Human being with feelings
 
vdubreeze's Avatar
 
Join Date: Jul 2011
Location: Brooklyn
Posts: 1,762
Default

Quote:
Originally Posted by EvilDragon View Post
Stellar stuff, guys!


Pardon me for saying though, if a few scripters can do it like this, what in the Earth prevents Justin and Schwa to just do it natively...?
Quote:
Originally Posted by doppelganger View Post
Maybe devs don't think, it's needed? because there's enough of tools, which can do area selection to some extent.

Yep. We all have different priorities, and many not 100% aligned with the devs. There are numerous functions that would be better (for whatever that's worth) to be native and they have different opinion about it, or it's very low priority due to what it would take to put it in. It's all good, though. When threads like this come up and folks like Sexan put so much work into something that clicks with my needs, that is a cleaner way to do it than the alternative, I get more excited about Reaper. And I'm happy that there are others who agree and also disagree so that I can learn a thing or two about stuff I didn't know how to do before.

Sometimes I have to admit that a naysayer is right, that it can already be done, but you have to learn how to do it. OTOH, there are many things in Reaper, native and not, where there are more than one way of doing something, pick your preferred, so I never got along well with the argument that it shouldn't be pursued because somewhere in the bowels of the program it can already be done, especially when it's a more straightforward way.

IMO this looks like a great addition and my hat is off to Sexan as well for figuring this out.
__________________
The reason rain dances work is because they don't stop dancing until it rains.
vdubreeze is offline   Reply With Quote
Old 04-17-2019, 09:13 AM   #130
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 129
Default

Great!))

Now try to figure out how to help you with this guys))
Thanks to devs for we having this data:
Code:
reaper.GetMediaItemInfo_Value( item, "I_LASTY")
reaper.GetMediaItemInfo_Value( item, "I_LASTH")
nappies is offline   Reply With Quote
Old 04-17-2019, 09:49 AM   #131
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

is there similar native API for envelopes (get from mouse cursor, cannot find anything) ? if not I still have to use it but for envelopes
Sexan is offline   Reply With Quote
Old 04-17-2019, 10:48 AM   #132
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 129
Default

It seems there is no native API frompoint function for envelopes, but you can use JS, they are very lightweight.But only if envelopes in separate lanes.
Like example you can use code by Embass here.

https://forum.cockos.com/showpost.ph...5&postcount=93
nappies is offline   Reply With Quote
Old 04-17-2019, 12:35 PM   #133
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 394
Default

Quote:
Originally Posted by Sexan View Post
Ok, please report back so we can narrow the issue. You on windows ? BTW you have two version of reaper installed(normal and portable)?
I use win7 x64 and Reaper x32. It seem these reaper_js_ReaScriptAPI32 and reaper_js_ReaScriptAPI64 doesn't work for me. Strange thing is that it worked with your script but script was't work proper and when I updated Reapack repositories it stopped work and throw errors right on script start. I have no idea why is that, maybe some files paths or something like that.









I tried also Embass scipt:



__________________
The truth is not in the middle but exactly where it is.
strachupl is offline   Reply With Quote
Old 04-17-2019, 12:52 PM   #134
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 347
Default

Try to install js_ReaScriptAPI version 0.981 or 0.980. Latest version doesn't work on my system too..
Embass is offline   Reply With Quote
Old 04-17-2019, 01:27 PM   #135
Vagelis
Human being with feelings
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 310
Default

Wow, i was waiting for this long time now!

Big thanks Sexan, once again a very useful script!

Edit: I just tested it and it's a bit buggy when i zoom in-out, the size of the rectangular doesn't follow the zoom size. I 'll wait for the next updates.

Last edited by Vagelis; 04-17-2019 at 01:43 PM.
Vagelis is offline   Reply With Quote
Old 04-17-2019, 02:06 PM   #136
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,752
Default

Quote:
Originally Posted by strachupl View Post
I use win7 x64 and Reaper x32. It seem these reaper_js_ReaScriptAPI32 and reaper_js_ReaScriptAPI64 doesn't work for me.
Quote:
Originally Posted by Embass View Post
Try to install js_ReaScriptAPI version 0.981 or 0.980. Latest version doesn't work on my system too..
Sorry, my fault! I uploaded the correct file a minute ago, so please try to re-install v0.984 of js_ReaScriptAPI32.
juliansader is offline   Reply With Quote
Old 04-17-2019, 03:56 PM   #137
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

fixed lots of stuff,updating so its not in loop all the time (only when project view changed),adding removing tracks/envelopes and many other stuff. Just need to finish drawing class and will upload latest core version (probably tomorrow)

BTW current solution to finding envelope heights is pretty cpu hungry (via JS_API), so unless we find another way to get them or devs give API like track height we will have to live with it

Last edited by Sexan; 04-17-2019 at 04:08 PM.
Sexan is offline   Reply With Quote
Old 04-17-2019, 05:03 PM   #138
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 394
Default

Thanks guys, it is working now.
__________________
The truth is not in the middle but exactly where it is.
strachupl is offline   Reply With Quote
Old 04-17-2019, 06:39 PM   #139
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 347
Default

-- I can get envelope h this way:
local address_offset = 11 -- this number works on my system
local selected_envelope = reaper.GetSelectedEnvelope(0)
if not selected_envelope then reaper.ShowConsoleMsg("Select envelope..\n"); return end -- exit

local env_window_address = reaper.JS_Int(selected_envelope, address_offset)
local env_window_handle = reaper.JS_Window_HandleFromAddress(env_window_addr ess)
local ok, env_right, env_top, env_right, env_bottom = reaper.JS_Window_GetRect(env_window_handle)

if ok then
local envelope_h = env_bottom - env_top
reaper.ShowConsoleMsg("Envelope h:\n")
reaper.ShowConsoleMsg(tostring(envelope_h).."\n")
end

---------------------------------------------------------------------------------
You can get address offset this way:
https://drive.google.com/file/d/1cQW...ew?usp=sharing
Embass is offline   Reply With Quote
Old 04-17-2019, 11:19 PM   #140
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

that is how I get them atm
Sexan is offline   Reply With Quote
Old 04-17-2019, 11:46 PM   #141
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,752
Default

I haven't tested this on all platforms, but another fast way to get the corresponding track or envelope control panel without iterating through all of them, may be to use JS_Window_FromPoint to get the panel at the same y coordinate as the mouse, but inside the TCP window.

Last edited by juliansader; 04-17-2019 at 11:58 PM.
juliansader is offline   Reply With Quote
Old 04-18-2019, 12:03 AM   #142
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

The problem is that it needs to find env that is stored in table. It checks what is the position from there. Also needs to check height of the whole envelope lane of the track so it is excluded from it (so we have independant drawing for tracks and envelopes).
The only problem with other API (BR_) is that it returns 0 when the lane is default height (non modified)

Last edited by Sexan; 04-18-2019 at 12:11 AM.
Sexan is offline   Reply With Quote
Old 04-18-2019, 04:02 AM   #143
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,046
Default

Quote:
Originally Posted by Sexan View Post
The only problem with other API (BR_) is that it returns 0 when the lane is default height (non modified)
Sexan, have you seen https://forum.cockos.com/showthread.php?t=208882?

(Not sure if it also helps with envelope height.)
nofish is offline   Reply With Quote
Old 04-18-2019, 05:17 AM   #144
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

yeah, but I do not understand what that value is and its not updating
Sexan is offline   Reply With Quote
Old 04-18-2019, 08:56 AM   #145
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,078
Default

wonder what I'm doing wrong... when I select an area that is part of an item but not all of the item[s] and hit delete, the whole item gets deleted, ... not like the gif in first post shows, where only the selection gets deleted...

I understand this is still a WIP...

thanks for any info
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain
hopi is offline   Reply With Quote
Old 04-18-2019, 09:33 AM   #146
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

can you gif it? even thats the first "REAL" try of the script I cannot reproduce.

do you have DEL in shortcuts assigned to something? I did not yet implemented blocking messages so if you have something on DEL it will trigger that also

Last edited by Sexan; 04-18-2019 at 09:41 AM.
Sexan is offline   Reply With Quote
Old 04-18-2019, 09:47 AM   #147
benf
Human being with feelings
 
benf's Avatar
 
Join Date: Oct 2008
Location: France
Posts: 2,620
Default

Quote:
Originally Posted by Reno.thestraws View Post
@ Reno

Édit : le terme que tu cherches pour me qualifier la maintenant est :"connard". Je sais, et j'assume
Dans le contexte, je pensais plutôt à "intégriste", mais c'est tellement connoté en ce moment...
Je comprends bien tes arguments. N'évoluant pas dans les milieux professionnels et n'ayant qu'une utilisation parcellaire et sans doute assez inefficace de Reaper, j'avoue ne pas me poser tous ces problèmes de rentabilité sur lesquels tu te positionne. Je ne me pose ces problèmes-là que dans ma vie professionnelle. A court terme, on trouve toujours que je coûte cher. A long terme, je fais faire des bénéfices substantiels en prenant le temps de réfléchir à des solutions pérennes et qui me demanderont un minium d'efforts dans l'avenir (mon côté fainéant).
Grosso-modo, on semble être sur la même façon de penser sauf que je n'ai pas ton côté Don Quichotte. Je suis plutôt sur vivre et laisser mourir.
__________________
Listen and download my music on https://benest.bandcamp.com/
benf is offline   Reply With Quote
Old 04-18-2019, 10:38 AM   #148
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,078
Default

Quote:
Originally Posted by Sexan View Post
can you gif it? even thats the first "REAL" try of the script I cannot reproduce.

do you have DEL in shortcuts assigned to something? I did not yet implemented blocking messages so if you have something on DEL it will trigger that also

I have Delete assigned to:
Remove items/tracks/envelope points (depending on focus) - no prompting

gif in a moment

https://stash.reaper.fm/36118/sexan.gif

plz dl from stash as above
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain

Last edited by hopi; 04-18-2019 at 10:44 AM.
hopi is offline   Reply With Quote
Old 04-18-2019, 10:55 AM   #149
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

you need to remove that action from del in order to AS to work,I will be implementing keyboard blocking so it will not matter what actions you have on your key. ATM my script deletes that part of AS and your key action deletes all because its selected with marquee tool

for this script that is posted you del key needs to be empty

To make things clear on how it will work:
1. Finish the core behavior of AS (how its created,updated,modified)
2. Make input code keys/mouse etc that will block messages to reaper while AS is active (for example if AS is active and you press CRTL+C - CRTL + V etc it will not be send to reaper,only to script)
3. Make functions for copy,paste,delete,split,create,move etc and more complex stuff

ATM it is WIP so there is no point of making 2 and 3 while 1 is not yet ready

Last edited by Sexan; 04-18-2019 at 12:08 PM.
Sexan is offline   Reply With Quote
Old 04-18-2019, 01:23 PM   #150
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,078
Default

ah I see OK well I'll just be like the pygmy at the doctor's office:

WTF????


[A little patient].... hahahaha

since I use the delete often I'll just keep it for now
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva/angel-rain
hopi is offline   Reply With Quote
Old 04-18-2019, 04:46 PM   #151
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

Ok, new core uploaded, improvements to drawing, adding to table etc. Adding still needs some fixing (when envelopes are shown)
https://raw.githubusercontent.com/Go...ea_51_Core.lua

I wont be able to work on it in next 7 days but will try when I get some free time... major RL work hell next 7 days.

If anyone wants to jump in to fix/improve something please do.

To draw you must be in upper half of the track, ESC removes all AS, SHIFT + DRAG creates new AS

get_range_info() need some fixing with adding/removing when envelopes are visible (dragging up/down from envelopes to track and from track to envelope)

Last edited by Sexan; 04-18-2019 at 04:57 PM.
Sexan is offline   Reply With Quote
Old 04-22-2019, 05:02 AM   #152
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 129
Default

Done some more cpu optimization. Cut several functions.Rewrote
get_track_y_range(cur_tr) cut some arguments. Fix bug with last track:If the mouse pointer is below the last track, the selection horizontally also stops.
Also fix small bug witn tYs=nil.

BTW I have a slightly different item select method.And change it too)It needs to be returned back)

Hope it will help you Sexan!

https://stash.reaper.fm/36149/Area_51_CPU.lua
nappies is offline   Reply With Quote
Old 04-22-2019, 01:19 PM   #153
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,772
Default

Thank you for contributing to this !
vanhaze is offline   Reply With Quote
Old 04-22-2019, 10:16 PM   #154
Fergler
Human being with feelings
 
Fergler's Avatar
 
Join Date: Jan 2014
Posts: 3,917
Default

You can't make the type of selections possible with area selection atm in Reaper, Reno.

If item [1] starts at measure 1 and another item [2] starts at measure 2, and you want to copy both but only a later part of item [2], you'd have to copy each separately or copy then remove the portion from the pasted ones.

That's an easy example but obviously explode this out to multiple drum tracks for example and it becomes far more useful.
__________________
Check out my hip-hop, funk-rock band Theatre Crisp
Fergler is online now   Reply With Quote
Old 04-25-2019, 01:10 PM   #155
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

Quote:
Originally Posted by nappies View Post
Done some more cpu optimization. Cut several functions.Rewrote
get_track_y_range(cur_tr) cut some arguments. Fix bug with last track:If the mouse pointer is below the last track, the selection horizontally also stops.
Also fix small bug witn tYs=nil.

BTW I have a slightly different item select method.And change it too)It needs to be returned back)

Hope it will help you Sexan!

https://stash.reaper.fm/36149/Area_51_CPU.lua
Got a little free time, checked your code, some stuff will help. But there is something weird... on some random tracks the rectangle is drawing over the whole project?? Try making 10 track and draw over them one by one it will break on one random.
Code:
get_track_y_range(cur_tr)
This function for some reason spits out wrong values for the problem above.

Also something we will need to live with:
Code:
 for adr in found:gmatch("%w+") do
      local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr))
Calling this takes a lot of CPU, I know its a silly scenario but having over 40 AS starts to eat a lot when drawing needs to be recalculated, but no one will ever do that .

Where it IS a problem is on envelopes, even if there is only 1 track in the project.
Having few envelope lanes visible per track and drawed over hits really REALLY hard to the point reaper becomes really sluggish

Still very busy for new few days and after that I'm all over this script
Sexan is offline   Reply With Quote
Old 04-25-2019, 04:20 PM   #156
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 129
Default

Quote:
Originally Posted by Sexan View Post
Got a little free time, checked your code, some stuff will help. But there is something weird... on some random tracks the rectangle is drawing over the whole project?? Try making 10 track and draw over them one by one it will break on one random.
Code:
get_track_y_range(cur_tr)
https://stash.reaper.fm/36149/Area_51_CPU.lua
Fix it now. Fuction get the tracks from the MCP mixer. Now everything is safe.
Why I redid this function? On some non-standard themes, if master track was visible- everything AS slid lower than necessary.
Quote:
Also something we will need to live with:
Code:
 for adr in found:gmatch("%w+") do
      local handl = reaper.JS_Window_HandleFromAddress(tonumber(adr))
Calling this takes a lot of CPU, I know its a silly scenario but having over 40 AS starts to eat a lot when drawing needs to be recalculated, but no one will ever do that .

Where it IS a problem is on envelopes, even if there is only 1 track in the project.
Having few envelope lanes visible per track and drawed over hits really REALLY hard to the point reaper becomes really sluggish
Maybe just make a reasonable amount limit? I'll think about how it can be made more lightweight.
nappies is offline   Reply With Quote
Old 04-28-2019, 02:42 PM   #157
puddi
Human being with feelings
 
puddi's Avatar
 
Join Date: Jun 2018
Posts: 247
Default

Is the selection box flickering a lot for anyone else or is it just me?
puddi is offline   Reply With Quote
Old 04-28-2019, 02:46 PM   #158
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 2,751
Default

Flickering here as well
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 04-29-2019, 09:35 AM   #159
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,450
Default

which script? core or demo?
Sexan is offline   Reply With Quote
Old 04-29-2019, 10:44 AM   #160
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 2,751
Default

Both, Core a bit less than Demo.
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ 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 09:19 PM.


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