|
|
|
04-16-2019, 11:33 AM
|
#121
|
Human being with feelings
Join Date: Jan 2013
Posts: 650
|
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?
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
|
|
|
04-16-2019, 11:35 AM
|
#122
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
Ok, please report back so we can narrow the issue. You on windows ? BTW you have two version of reaper installed(normal and portable)?
|
|
|
04-16-2019, 11:51 AM
|
#123
|
Human being with feelings
Join Date: Jan 2013
Posts: 650
|
Quote:
Originally Posted by Sexan
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.
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
|
|
|
04-16-2019, 12:02 PM
|
#124
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
There should not be any problems with portable
|
|
|
04-16-2019, 09:47 PM
|
#125
|
Human being with feelings
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
|
Sexan... go man go.... you are on to a beautiful thing.
waiting to see where it goes next!
|
|
|
04-17-2019, 08:05 AM
|
#126
|
Human being with feelings
Join Date: Dec 2017
Posts: 302
|
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)
|
|
|
04-17-2019, 08:32 AM
|
#127
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
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.
|
|
|
04-17-2019, 08:44 AM
|
#128
|
Human being with feelings
Join Date: Jul 2011
Location: Brooklyn
Posts: 2,636
|
Quote:
Originally Posted by EvilDragon
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
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.
|
|
|
04-17-2019, 09:13 AM
|
#129
|
Human being with feelings
Join Date: Dec 2017
Posts: 302
|
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")
|
|
|
04-17-2019, 09:49 AM
|
#130
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
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
|
|
|
04-17-2019, 10:48 AM
|
#131
|
Human being with feelings
Join Date: Dec 2017
Posts: 302
|
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
|
|
|
04-17-2019, 12:35 PM
|
#132
|
Human being with feelings
Join Date: Jan 2013
Posts: 650
|
Quote:
Originally Posted by Sexan
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:
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
|
|
|
04-17-2019, 12:52 PM
|
#133
|
Human being with feelings
Join Date: Jan 2014
Posts: 923
|
Try to install js_ReaScriptAPI version 0.981 or 0.980. Latest version doesn't work on my system too..
|
|
|
04-17-2019, 01:27 PM
|
#134
|
Human being with feelings
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,827
|
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.
|
|
|
04-17-2019, 02:06 PM
|
#135
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
Quote:
Originally Posted by strachupl
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
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.
|
|
|
04-17-2019, 03:56 PM
|
#136
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
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.
|
|
|
04-17-2019, 05:03 PM
|
#137
|
Human being with feelings
Join Date: Jan 2013
Posts: 650
|
Thanks guys, it is working now.
__________________
Love is patient and kind; love does not envy or boast; it is not arrogant or rude.
It does not insist on its own way; it is not irritable or resentful;
it does not rejoice at wrongdoing, but rejoices with the truth. Corinthians 13:4-6
|
|
|
04-17-2019, 06:39 PM
|
#138
|
Human being with feelings
Join Date: Jan 2014
Posts: 923
|
-- 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
|
|
|
04-17-2019, 11:19 PM
|
#139
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
that is how I get them atm
|
|
|
04-17-2019, 11:46 PM
|
#140
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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.
|
|
|
04-18-2019, 12:03 AM
|
#141
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
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.
|
|
|
04-18-2019, 04:02 AM
|
#142
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Quote:
Originally Posted by Sexan
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.)
|
|
|
04-18-2019, 05:17 AM
|
#143
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
yeah, but I do not understand what that value is and its not updating
|
|
|
04-18-2019, 08:56 AM
|
#144
|
Human being with feelings
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
|
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
|
|
|
04-18-2019, 09:33 AM
|
#145
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
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.
|
|
|
04-18-2019, 09:47 AM
|
#146
|
Human being with feelings
Join Date: Oct 2008
Location: France
Posts: 3,700
|
Quote:
Originally Posted by Reno.thestraws
@ 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.
|
|
|
04-18-2019, 10:38 AM
|
#147
|
Human being with feelings
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
|
Quote:
Originally Posted by Sexan
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
Last edited by hopi; 04-18-2019 at 10:44 AM.
|
|
|
04-18-2019, 10:55 AM
|
#148
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
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.
|
|
|
04-18-2019, 01:23 PM
|
#149
|
Human being with feelings
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
|
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
|
|
|
04-18-2019, 04:46 PM
|
#150
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
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.
|
|
|
04-22-2019, 05:02 AM
|
#151
|
Human being with feelings
Join Date: Dec 2017
Posts: 302
|
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
|
|
|
04-22-2019, 01:19 PM
|
#152
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Thank you for contributing to this !
|
|
|
04-22-2019, 10:16 PM
|
#153
|
Human being with feelings
Join Date: Jan 2014
Posts: 5,220
|
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.
|
|
|
04-25-2019, 01:10 PM
|
#154
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
Quote:
Originally Posted by nappies
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
|
|
|
04-25-2019, 04:20 PM
|
#155
|
Human being with feelings
Join Date: Dec 2017
Posts: 302
|
Quote:
Originally Posted by Sexan
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.
|
|
|
04-28-2019, 02:42 PM
|
#156
|
Human being with feelings
Join Date: Jun 2018
Posts: 375
|
Is the selection box flickering a lot for anyone else or is it just me?
|
|
|
04-28-2019, 02:46 PM
|
#157
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Flickering here as well
|
|
|
04-29-2019, 09:35 AM
|
#158
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
which script? core or demo?
|
|
|
04-29-2019, 10:44 AM
|
#159
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Both, Core a bit less than Demo.
|
|
|
04-29-2019, 10:54 AM
|
#160
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
demo is obsolete (totally different code), core script is updating all AS-s the when drawing which is fixed for next version (it updates only the one that is drawing). I assume you see it flicker when you draw multiple AS?
Also there is some flicker when mouse over envelopes, not sure if its because of tooltips or something else
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 12:40 AM.
|