Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 12-28-2020, 01:11 PM   #1
callmeaderp
Human being with feelings
 
Join Date: Sep 2020
Posts: 41
Default Is there a "get" and "set" for the midi editor zoom poistion?

hey,I'm a fairly new to programming and such. I was looking through the api functions and I was trying to find if there is a get and set for the midi editor zoom position? I am trying to make something that goes back to the screen position it was before the script was run as it could change screen position. Anyone know of this or have a workaround? thanks
callmeaderp is offline   Reply With Quote
Old 12-28-2020, 03:13 PM   #2
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Unfortunately not. It is a popular Feature Request that should be very easy to implement, but it has never been done:
ReaScript API: Get MIDI editor on-screen layout via MIDIEditor_GetSetting_Int().

To get the zoom, you need to parse the chunk of the editor's active take.
juliansader is offline   Reply With Quote
Old 12-29-2020, 01:34 PM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,622
Default

Which chunkentry is it?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 12-30-2020, 12:03 PM   #4
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

The MIDI editor scroll and zoom are hidden within the CFGEDITVIEW field

Code:
ME_LeftmostTick, ME_HorzZoom, ME_TopPitch, ME_PixelsPerPitch = activeTakeChunk:match("\nCFGEDITVIEW (%S+) (%S+) (%S+) (%S+)")
ME_LeftmostTick: Scroll position, given by the leftmost tick visible in the editor.
ME_HorzZoom: If the MIDI editor's timebase = project synced or project time, horizontal zoom is given as pixels per second. If timebase is beats, pixels per tick.
ME_PixelsPerPitch: Vertical zoom
juliansader 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:04 AM.


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