Old 07-25-2019, 09:56 AM   #1
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default Alkamist Zoom Tool

Long ago, I made a thread asking for someone to try to make a zoom tool that is similar to the one used in Melodyne. Now I am capable of doing it myself, so I gave it a shot! Special thanks to juliansader for making this possible with his js_ReaScriptAPI extension.

Basically, you bind Zoom Tool.lua to a hotkey in both Main View and the MIDI Editor. When you hold that hotkey, mouse movement to the right and left will zoom in and out horizontally respectively, and mouse movement down and up will zoom in and out vertically respectively.





Requirements

- Up-to-date Reaper
- js_ReaScriptAPI extension
- Possibly SWS Extension

Installation

If you have ReaPack, then you can import my repository with this URL:

Code:
https://raw.githubusercontent.com/Alkamist/Alkamist-Scripts/master/index.xml
You may need to go "Extensions > ReaPack > Manage Repositories..." and right click my repository and hit "Refresh" for this to show up if you have some of my other scripts. Not sure why this is, maybe I'm doing something wrong with ReaPack-index.

If you just want the raw script, it is located here:

Zoom Tool.lua

You must also install the default settings file to "Scripts\Alkamist Scripts\Zoom Tool\Zoom Tool Default Settings.lua":

Zoom Tool Default Settings.lua

You can copy and rename this file in the same directory to "Scripts\Alkamist Scripts\Zoom Tool\Zoom Tool User Settings.lua" and change the settings there so they don't get overwritten when updating.

Issues

- This script apparently doesn't work on OSX. No users with OSX have confirmed that it works for them. I'm going to try to test this and troubleshoot on an OSX setup when I can.

- I don't account for screen resolution or mouse DPI anywhere, so you'll probably have to adjust the xSensitivity and ySensitivity variables in the "Zoom Tool User Settings.lua" file described above to suit your preference and setup to get the feel right.

- This will mess up your relative track heights if you use it in vertical action-based zoom mode.

- Using this in the MIDI editor will move your edit cursor and mess with playback. In the MIDI editor, the vertical zoom functions seem to be centered around the pitch cursor. So in order to get the zoom to center around your mouse cursor, I needed to simulate a quick left click to set the pitch cursor. This has the unfortunate effect of moving the editor cursor, but is necessary for the script to feel right.

- There may be other cross-platform issues I am not aware of as I can only test on Windows. Let me know if something isn't working.

- This script uses keyboard intercepts, so if the script crashes during use for some reason, it may not properly release those intercepts. If that happens, you will need to restart Reaper to use the keyboard properly again.

Possible Improvements

If the API exposed some way to set the pitch cursor in the MIDI Editor, I could avoid having to simulate a left click, which would fix moving the edit cursor and messing with playback.

Last edited by Alkamist; 08-03-2019 at 07:21 AM.
Alkamist is offline   Reply With Quote
Old 07-25-2019, 12:32 PM   #2
zookthespook
Human being with feelings
 
Join Date: Mar 2015
Location: India Mumbai
Posts: 686
Default

Wow !!! Looks super smooth .
Can't wait to install this tomorrow first thing and test drive it !
Amazing work man .
Zook
zookthespook is offline   Reply With Quote
Old 07-25-2019, 10:18 PM   #3
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,423
Default

thanks pretty kewl.... especially in the MIDI Ed.
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 07-26-2019, 05:04 AM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,725
Default

Oh this looks nice indeed.
Thanks for sharing.
nofish is offline   Reply With Quote
Old 07-26-2019, 07:43 AM   #5
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Thanks for the nice feedback guys!

I'm currently attempting to get a version working that does vertical zoom in the main window by setting track height directly. It has the benefit of preserving relative track height, and it feels much smoother.

It's a nightmare to account for everything though and more is bound to go wrong. If I can get it working, I'll probably put an option at the top of the script to switch between the two modes if you don't like it.
Alkamist is offline   Reply With Quote
Old 07-26-2019, 07:46 AM   #6
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Spankland
Posts: 562
Default

This looks cool. I think I'm gonna give it a whirl.
__________________
My Master Thread
My ReaPack repo
Dafarkias is offline   Reply With Quote
Old 07-26-2019, 06:40 PM   #7
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

I just pushed an update (v1.1) to this script.

I went through and did a ton of work trying to get vertical zoom via setting track height directly working. It essentially works, but unfortunately it lags horribly in larger projects.

Scripts just seem to have a low processing priority or something so I'm not sure it's viable. You can barely even be using CPU and it will lag.

If you want to try it you can set the "useActionBasedVerticalZoom" bool at the top of the script to false.
Alkamist is offline   Reply With Quote
Old 07-27-2019, 05:55 AM   #8
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,130
Default

Oh, didn't know, that you managed to do that yourself in the meantime. Great work!
__________________
Use she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1111 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 07-27-2019, 11:57 AM   #9
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

I just pushed version 1.2 out.

With the help of the kind programmers from this thread, I was able to vastly improve my handling of zooming by setting track height directly in the presence of envelopes.

Also, as it turns out, it wasn't the script lagging that was screwing zooming up in larger projects, it was a bug in my code.

Long story short, you should be able to use setting track height directly without it lagging now. I now have that option enabled by default because it feels really nice.

Keep in mind though, if you are zooming in vertically near the end of the tracklist, you will probably see some ugly graphical glitches. This is because when zooming in near the end, I have to push through a UI update to update how far you can scroll. That means you see a couple frames of the arrange scrolled in the wrong place before it can correct it. I'm not sure if there is a way around this. I would have to be able to update the scrollbar maximum size without pushing a UI update, and I don't know how to do that.

EDIT: Actually, just pushed v1.3, fixing a major UI refresh bug. I had no idea you had to take care when using reaper.PreventUIRefresh(). I was taking away more than I was adding.

EDIT2: Just pushed v1.4: Added perfect horizontal zoom tracking (at the expense of some tiny graphical glitches), exponential track scaling (feels way better) and maximum track height (set so when maximized, an auto-scaled envelope will take up the entire screen). Sorry for the spam of updates, just want to push out good changes as I make them.

EDIT3: Pushed v1.5: I had forgotten to take the master track into account if it was visible in the TCP. That should be corrected now.

Last edited by Alkamist; 07-27-2019 at 06:55 PM.
Alkamist is offline   Reply With Quote
Old 07-28-2019, 10:07 AM   #10
timothys_monster
Human being with feelings
 
timothys_monster's Avatar
 
Join Date: Jan 2012
Location: Germany
Posts: 914
Default

I really like it, man! The only problem are the glitches. Unfortunately, I don't think I would use it with those flickering elements, because it really distracts you long term...

EDIT:

I just realized that they only appear when an item is filling out the screen completely (horizontally). Maybe this info can help?
timothys_monster is offline   Reply With Quote
Old 07-28-2019, 10:42 AM   #11
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by timothys_monster View Post
I really like it, man! The only problem are the glitches. Unfortunately, I don't think I would use it with those flickering elements, because it really distracts you long term...

EDIT:

I just realized that they only appear when an item is filling out the screen completely (horizontally). Maybe this info can help?
Hmmm, so you're getting really bad flickering when zooming horizontally? It is hardly noticeable on my setup, but that might be because of CPU and other factors.

I just pushed an update (v1.5.1) that adds a bool to the top of the file that you can change (usePreciseMainViewHorizontalPositionTracking). If you set that to false, the script won't try to scroll horizontally to your exact mouse position in the main view. That should get rid of any graphical glitches caused by that.

If you are getting flickering when zooming in vertically near the end of the tracklist, that is something I can't fix currently. Basically, when you are zooming in, the amount of pixels the script needs to scroll down to compensate increases. The problem is, I am suppressing UI updates so it looks smooth, so the maximum scroll position doesn't update as you are zooming in. That means that specifically when you are near the end of the tracklist, the script needs to scroll down more than is currently possible without updating the UI. To fix this, I unfortunately have to push a UI update, which means that you see some frames of the arrange scrolled in the wrong place.

Last edited by Alkamist; 07-28-2019 at 10:47 AM.
Alkamist is offline   Reply With Quote
Old 07-29-2019, 06:31 PM   #12
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,423
Default

thanks again... latest update is nice for me both for hori and vert zoom

but I wonder if I can have it NOT include the Master track in the TCP at least for vertical zoom?

I also wonder if there is a user edit to have it respond less to my mouse movement...

for me just a tiny bit of mouse movement zooms a whole lot so it gets a bit wild to control...
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 07-29-2019, 06:50 PM   #13
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by hopi View Post
thanks again... latest update is nice for me both for hori and vert zoom

but I wonder if I can have it NOT include the Master track in the TCP at least for vertical zoom?

I also wonder if there is a user edit to have it respond less to my mouse movement...

for me just a tiny bit of mouse movement zooms a whole lot so it gets a bit wild to control...
In my most recent update (v1.5.10), you can create a settings file "Scripts\Alkamist Scripts\Zoom Tool\Zoom Tool User Settings.lua" and change the X and Y sensitivity there.

As far as the master track not zooming, I'll see if tomorrow I can get a user configurable setting that you can change to stop it from zooming.
Alkamist is offline   Reply With Quote
Old 07-30-2019, 07:25 AM   #14
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,423
Default

Thanks much for that info...

I changed both sensitivities to 0.5 fro 1.0 and now it behaves in a much more friendly manner for my screens....
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 07-30-2019, 09:34 AM   #15
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by hopi View Post
thanks again... latest update is nice for me both for hori and vert zoom

but I wonder if I can have it NOT include the Master track in the TCP at least for vertical zoom?

I also wonder if there is a user edit to have it respond less to my mouse movement...

for me just a tiny bit of mouse movement zooms a whole lot so it gets a bit wild to control...
I just pushed an update (v1.6) that allows you to choose whether or not you want the master to zoom with the other tracks. Set the "zoomMasterWithOtherTracks" bool to false in your user settings file, it is set to true by default.

There are also some crash fixes in the new version.
Alkamist is offline   Reply With Quote
Old 07-31-2019, 01:21 AM   #16
Sumalc
Human being with feelings
 
Join Date: Oct 2009
Location: France
Posts: 600
Default

Hello, nice idea thank you but Reaper always instantly exits by clicking the shortcut (here z) assigned to the script, same with last version 1.6.
(mac osx el capitan reaper v 5.980/64)
------------------------------------
System Integrity Protection: enabled

Crashed Thread: 0 reaper Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000059
Exception Note: EXC_CORPSE_NOTIFY

VM Regions Near 0x59:
-->
__TEXT 00000001084fe000-0000000108ffb000 [ 11.0M] r-x/rwx SM=COW /Applications/Reaper 5/REAPER64.app/Contents/MacOS/REAPER

Thread 0 Crashed:: reaper Dispatch queue: com.apple.main-thread
0 reaper_js_ReaScriptAPI64.dylib 0x000000010fefda33 JS_WindowMessage_ReleaseAll() + 755
1 reaper_js_ReaScriptAPI64.dylib 0x000000010fefdb14 __vararg_JS_WindowMessage_ReleaseAll(void**, int) + 20
2 com.cockos.reaper 0x0000000108bdb83e lua_addedfunc(lua_State*) + 2846
3 com.cockos.reaper 0x000000010884d8e4 luaD_precall + 2132
4 com.cockos.reaper 0x000000010896225e luaV_execute + 1982
5 com.cockos.reaper 0x000000010884e2e6 luaD_callnoyield + 70
6 com.cockos.reaper 0x00000001088500db luaD_rawrunprotected + 107
7 com.cockos.reaper 0x000000010884fe30 luaD_pcall + 64
8 com.cockos.reaper 0x0000000108c0f508 lua_pcallk + 152
9 com.cockos.reaper 0x0000000108bdf417 LuaAPI::OnAtExit() + 343
10 com.cockos.reaper 0x0000000108c54bb8 ReaScript_RunDeferred() + 392
11 com.cockos.reaper 0x00000001085c51b3 runMiscTimers() + 1539
12 com.cockos.reaper 0x00000001085c3f33 Main_OnTimer(HWND__*, unsigned long) + 163
13 com.cockos.reaper 0x0000000108b692c1 MainProc(HWND__*, unsigned int, unsigned long, long) + 2481
14 com.cockos.reaper 0x0000000108a12396 SwellDialogDefaultWindowProc(HWND__*, unsigned int, unsigned long, long) + 438
15 com.apple.Foundation 0x00007fff9b8d7dec __NSFireTimer + 95
16 com.apple.CoreFoundation 0x00007fff9bf05ae4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUN CTION__ + 20
17 com.apple.CoreFoundation 0x00007fff9bf05773 __CFRunLoopDoTimer + 1075
18 com.apple.CoreFoundation 0x00007fff9bf052ca __CFRunLoopDoTimers + 298
19 com.apple.CoreFoundation 0x00007fff9befc7c1 __CFRunLoopRun + 1841
20 com.apple.CoreFoundation 0x00007fff9befbe28 CFRunLoopRunSpecific + 296
21 com.apple.HIToolbox 0x00007fff8b2a6935 RunCurrentEventLoopInMode + 235
22 com.apple.HIToolbox 0x00007fff8b2a676f ReceiveNextEventCommon + 432
23 com.apple.HIToolbox 0x00007fff8b2a65af _BlockUntilNextEventMatchingListInModeWithFilter + 71
24 com.apple.AppKit 0x00007fff8cb4adf6 _DPSNextEvent + 1067
25 com.apple.AppKit 0x00007fff8cb4a226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:deque ue:] + 454
26 com.apple.AppKit 0x00007fff8cb3ed80 -[NSApplication run] + 682
27 com.apple.AppKit 0x00007fff8cb08368 NSApplicationMain + 1176
28 com.cockos.reaper 0x00000001084ffbf4 start + 52
Sumalc is offline   Reply With Quote
Old 07-31-2019, 06:45 AM   #17
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by Sumalc View Post
Hello, nice idea thank you but Reaper always instantly exits by clicking the shortcut (here z) assigned to the script, same with last version 1.6.
Do you have all of the requirement libraries installed? You need js_ReaScriptAPI extension and SWS Extension.

Assuming you do, unfortunately I have no idea what that error means. Unfortunately I don't have an OSX setup to test on.

Has the script always done this or was there a version where it stopped working?
Alkamist is offline   Reply With Quote
Old 07-31-2019, 10:04 AM   #18
Sumalc
Human being with feelings
 
Join Date: Oct 2009
Location: France
Posts: 600
Default

Yes i have last : reaper_js_ReaScriptAPI64 and SWS in UserPlugin folder.
The script has always do that.
Sumalc is offline   Reply With Quote
Old 07-31-2019, 12:24 PM   #19
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by Sumalc View Post
Yes i have last : reaper_js_ReaScriptAPI64 and SWS in UserPlugin folder.
The script has always do that.
I see, well I'm not sure what the problem is unfortunately. I'll have to figure out a way to test on OSX at some point. I'll update back if I get the chance.

No users so far who use OSX have confirmed that this script works for them.
Alkamist is offline   Reply With Quote
Old 07-31-2019, 04:17 PM   #20
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,725
Default

Looking at the crash log, it seems to point to JS_WindowMessage_ReleaseAll() as the cause for the crash. Maybe something to ask juliansader?

Last edited by nofish; 07-31-2019 at 04:26 PM.
nofish is offline   Reply With Quote
Old 07-31-2019, 05:15 PM   #21
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by nofish View Post
Looking at the crash log, it seems to point to JS_WindowMessage_ReleaseAll() as the cause for the crash. Maybe something to ask juliansader?
Yeah I see that in the log. I use that at one point to allow the window to change the cursor back to normal, since I temporarily change it to the zoom cursor.

Quote:
Originally Posted by Sumalc View Post
Yes i have last : reaper_js_ReaScriptAPI64 and SWS in UserPlugin folder.
The script has always do that.
I am using JS_WindowMessage_ReleaseWindow() now instead of JS_WindowMessage_ReleaseAll() in version 1.6.4, hopefully that fixes the issue. If you get the chance to try, let me know if you are still getting the crash. If you are, I can try disabling that line on OSX to see if it fixes it.
Alkamist is offline   Reply With Quote
Old 08-01-2019, 04:05 AM   #22
Sumalc
Human being with feelings
 
Join Date: Oct 2009
Location: France
Posts: 600
Default

Quote:
Originally Posted by Alkamist View Post
Yeah I see that in the log. I use that at one point to allow the window to change the cursor back to normal, since I temporarily change it to the zoom cursor.



I am using JS_WindowMessage_ReleaseWindow() now instead of JS_WindowMessage_ReleaseAll() in version 1.6.4, hopefully that fixes the issue. If you get the chance to try, let me know if you are still getting the crash. If you are, I can try disabling that line on OSX to see if it fixes it.

Thank you, no crash with 1.6.4 but :

mcp tracks are reduced to the minimum height, and remain so.
The pointer transformed into a magnifying glass, does not move when i move the mouse.
Sumalc is offline   Reply With Quote
Old 08-01-2019, 07:23 AM   #23
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by Sumalc View Post
Thank you, no crash with 1.6.4 but :

mcp tracks are reduced to the minimum height, and remain so.
The pointer transformed into a magnifying glass, does not move when i move the mouse.
Sounds like I need to account for some differences in OSX. OSX has the mouse y direction reversed in polarity.

The mouse is supposed the be stuck stationary while running the script though.

I'll fiddle around with it when I get the chance and see what I can do.
Alkamist is offline   Reply With Quote
Old 08-01-2019, 09:32 AM   #24
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,423
Default

Quote:
Originally Posted by Alkamist View Post
I just pushed an update (v1.6) that allows you to choose whether or not you want the master to zoom with the other tracks. Set the "zoomMasterWithOtherTracks" bool to false in your user settings file, it is set to true by default.

There are also some crash fixes in the new version.
I thank you kindly %^)

that setting along with the sensitivity for me set to 0.5 makes it work nicely

using it a bit makes me wonder if the might also be a way in this lua to scroll the view...
of course if I let go of the hot key and use the normal scrolling methods that works fine, but just imagining
how nice it would be if scrolling the view was somehow built in... right?

also I notice a problem in the MIDI Editor.... I have the hot key as a pass through to the MIDI Ed. actions, I use the Z key
when I am in the MIDI Ed. and hit the Z key it inserts a note, which I don't want it to do...

I wonder if the lua was made so a pass through was not needed for the MIDI Ed., in other words if there was a separate version that only ran in the MIDI Ed. if that would solve this little problem
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva

Last edited by hopi; 08-01-2019 at 10:02 AM.
hopi is offline   Reply With Quote
Old 08-01-2019, 11:14 AM   #25
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by Sumalc View Post
Thank you, no crash with 1.6.4 but :

mcp tracks are reduced to the minimum height, and remain so.
The pointer transformed into a magnifying glass, does not move when i move the mouse.
I just pushed version 1.6.5, in which I switch to using completely window-based mouse coordinates for processing. Hopefully that should fix any problems experienced on OSX. Let me know if this change fixes it for you.

Quote:
Originally Posted by hopi View Post
I thank you kindly %^)

that setting along with the sensitivity for me set to 0.5 makes it work nicely

using it a bit makes me wonder if the might also be a way in this lua to scroll the view...
of course if I let go of the hot key and use the normal scrolling methods that works fine, but just imagining
how nice it would be if scrolling the view was somehow built in... right?

also I notice a problem in the MIDI Editor.... I have the hot key as a pass through to the MIDI Ed. actions, I use the Z key
when I am in the MIDI Ed. and hit the Z key it inserts a note, which I don't want it to do...

I wonder if the lua was made so a pass through was not needed for the MIDI Ed., in other words if there was a separate version that only ran in the MIDI Ed. if that would solve this little problem
There is actually a setting in the settings file that you can change (shouldCenterVertically) that will make the view try to scroll the track you are zooming toward the middle of the screen. As far as horizontal scroll, I'm planning on doing a similar option for that at some point.

Currently the script runs based on whatever window your mouse is hovering over. I think the problem might be the fast left click I simulate when you use it in the MIDI editor. Basically, the vertical zooming in the MIDI editor is centered around which note is highlighted. The only way I could figure out to change that highlighted note was to simulate a fast left click, which has the side effect of possibly creating a new note. I thought I had code to clean that up but I guess it might not be working.

If I could figure out how to get "Zoom vertically (MIDI relative/mousewheel)" to run from a script, I wouldn't need to do this.
Alkamist is offline   Reply With Quote
Old 08-01-2019, 01:01 PM   #26
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

I just found out that the newest dev update (reaper5981+dev0801) breaks vertical scrolling in my script in the arrange view. It probably has something to do with (+ Tracks: complete overhaul of track/mixer panels for performance). I'll have to see if I can fix that when they release the next version and there is some documentation for what they changed.
Alkamist is offline   Reply With Quote
Old 08-01-2019, 01:03 PM   #27
Sumalc
Human being with feelings
 
Join Date: Oct 2009
Location: France
Posts: 600
Default

Quote:
Originally Posted by Alkamist View Post
I just pushed version 1.6.5, in which I switch to using completely window-based mouse coordinates for processing. Hopefully that should fix any problems experienced on OSX. Let me know if this change fixes it for you.
Thanks for the update but sorry, no change here. I use only "official" release, here V5.980
Sumalc is offline   Reply With Quote
Old 08-01-2019, 01:30 PM   #28
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by Sumalc View Post
Thanks for the update but sorry, no change here. I use only "official" release, here V5.980
Horizontal zoom is working though right? And also, does it work if you change the value of useActionBasedVerticalZoom to true in the settings file?
Alkamist is offline   Reply With Quote
Old 08-01-2019, 01:50 PM   #29
Sumalc
Human being with feelings
 
Join Date: Oct 2009
Location: France
Posts: 600
Default

horizontal zoom has never work.
with "useActionBasedVerticalZoom" -> true, no change except tracks keep their height and don't reduce to minimum size.
Sorry, I have to stop for tonight.
Sumalc is offline   Reply With Quote
Old 08-01-2019, 02:01 PM   #30
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by Sumalc View Post
horizontal zoom has never work.
with "useActionBasedVerticalZoom" -> true, no change except tracks keep their height and don't reduce to minimum size.
Sorry, I have to stop for tonight.
Hmmm, I'm really not sure what is the problem then. I'll just have to see if I can test on an OSX setup at some point and whittle down the problem. Thanks for the help though, I'll update back if I make any updates that might fix it.
Alkamist is offline   Reply With Quote
Old 08-02-2019, 09:21 AM   #31
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,130
Default

Quote:
Originally Posted by Alkamist View Post
I see, well I'm not sure what the problem is unfortunately. I'll have to figure out a way to test on OSX at some point. I'll update back if I get the chance.

No users so far who use OSX have confirmed that this script works for them.
If it's hwnd-related, you need to check on Mac, whether a used HWND is still a valid one before using it, otherwise Reaper crashes bigtime.

I use this function in my API, maybe this fixes the problem:

Code:
function ultraschall.IsValidHWND(HWND)
  if reaper.ValidatePtr(HWND, "HWND*")==false then return false end
  if pcall(reaper.JS_Window_GetTitle, HWND, "")==false then  return false end
  return true
end
__________________
Use she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1111 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 08-02-2019, 09:32 AM   #32
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by mespotine View Post
If it's hwnd-related, you need to check on Mac, whether a used HWND is still a valid one before using it, otherwise Reaper crashes bigtime.

I use this function in my API, maybe this fixes the problem:

Code:
function ultraschall.IsValidHWND(HWND)
  if reaper.ValidatePtr(HWND, "HWND*")==false then return false end
  if pcall(reaper.JS_Window_GetTitle, HWND, "")==false then  return false end
  return true
end
Thanks for the tip! Sumalc said that the script isn't crashing anymore since I switched to using JS_WindowMessage_ReleaseWindow() though.

I think there is some type of problem with how I'm calculating mouse movement. Something about it isn't translating over to OSX correctly. I won't be able to troubleshoot it until I can test on an OSX setup, unless some user with OSX is willing to troubleshoot with me.
Alkamist is offline   Reply With Quote
Old 08-03-2019, 05:38 AM   #33
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,423
Default

Thanks Alk for explaining what it going on in the MIDI Ed. with that single mouse clk and why it inserts a note....

I hope you can find a solution for that since inserting a new note every time the hot key is pressed is less than desirable and in fact a problem that really makes a mess of the notes in the current MIDI item.
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 08-03-2019, 07:14 AM   #34
Alkamist
Human being with feelings
 
Join Date: Dec 2011
Posts: 500
Default

Quote:
Originally Posted by hopi View Post
Thanks Alk for explaining what it going on in the MIDI Ed. with that single mouse clk and why it inserts a note....

I hope you can find a solution for that since inserting a new note every time the hot key is pressed is less than desirable and in fact a problem that really makes a mess of the notes in the current MIDI item.
I think that I might have fixed the code that is supposed to clean up any unwanted MIDI notes.

Update to 1.7.3 and let me know if it is still doing it. If it is, I added a bool in the settings called "simulateLeftClickInMIDIEditor" that you can change to stop it from left clicking in the MIDI editor.
Alkamist is offline   Reply With Quote
Old 12-11-2019, 07:22 PM   #35
budda
Human being with feelings
 
budda's Avatar
 
Join Date: May 2019
Location: UA
Posts: 18
Default

that's can be perfect zoom tool i think, if its become photoshop type like. In track(waveforms) or midi - horizontal zoom only, in timeline vertical zoom only, in track panel area just scroll up down.

UP sorry. i missed Zoom Tool Default Settings cfg. Now with xSensitivityArrange = 0.5 ySensitivityArrange = 0.3 works perfect for me, and default was just too fast.

Last edited by budda; 12-12-2019 at 11:29 AM.
budda is offline   Reply With Quote
Old 12-16-2019, 01:51 PM   #36
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 189
Default

Just stopping by to thank you for writing this script, it works really well
BirdBird is offline   Reply With Quote
Old 12-17-2019, 11:00 AM   #37
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,423
Default

Quote:
Originally Posted by Alkamist View Post
I think that I might have fixed the code that is supposed to clean up any unwanted MIDI notes.

Update to 1.7.3 and let me know if it is still doing it. If it is, I added a bool in the settings called "simulateLeftClickInMIDIEditor" that you can change to stop it from left clicking in the MIDI editor.
hummm... thanks and just updated to the newest 1.7.4 and that previous problem when using a passthrough key in the MIDI Editor of inserting a note is still there... which makes it really impossible to use in the ME...
You can understand that if it puts in a new note every time I hit the hot key it messes up the MIDI part... right?

EDIT... OK did the edit of the .lua settings and changed that to 'false'... so now it does not add a note
but now I have to press the hot key again to get out of zoom tool... is that expected?
I would have thought it would only zoom while holding the hot key... ???
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva

Last edited by hopi; 12-17-2019 at 05:54 PM.
hopi is offline   Reply With Quote
Old 04-19-2020, 08:44 AM   #38
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 189
Default

There seems to be a bug where the compacted (tiny) tracks offset the vertical scroll position if the tracks are above the mouse cursor. (Version 1.7.4)
I believe this is because GetMediaTrackInfo_Value() calls about track coordinates do not seem to respect minimized track state.

I have looked at the code to make pieces of it respect minimized tracks, however there still seems to be some offset that I can't figure out.
BirdBird 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 05:34 AM.


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