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

Reply
 
Thread Tools Display Modes
Old 07-23-2021, 09:10 AM   #1
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 1,018
Default Script: Keep only one floating fx open and centered in screen

Hi guys, I just added two new scripts to my ReaPack repository:

1. Keep only one floating fx open and centered in screen
2. Keep only one floating fx open at the same position (top left corner)

I rewrote them today to make them really light on CPU, let me know if there's any issues.

Warning: Don't run both scripts at the same time!



You can find the scripts on my github or download them using ReaPack:
Copy and paste this link into: Extensions > ReaPack > Import a repository
Code:
https://raw.githubusercontent.com/iliaspoulakis/Reaper-Tools/master/index.xml
Donation Link
FeedTheCat is online now   Reply With Quote
Old 07-23-2021, 10:12 AM   #2
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

Bravo!
I'll give these a try
Thank you!
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 07-23-2021, 10:17 AM   #3
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,582
Default

FTC FTC FTC FTC! thanks!
__________________
My ReaScripts:
MIDI Transfer | Item Sampler | Track Snapshot
daniellumertz is online now   Reply With Quote
Old 07-23-2021, 11:36 AM   #4
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 502
Default

Thank you very much!
__________________
Arrangement/mixing
Skorobagatko is online now   Reply With Quote
Old 07-23-2021, 11:40 AM   #5
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 588
Default

But is it really so difficult to add this feature natively? It should be easy. It seems there were a lot of requests. What's the catch? Need to detect a monitor when connecting multiple monitors? Basically, the user will open one plugin, then close and then open another. There may, of course, be another catch in the windowing policy in other operating systems besides OS windows, unfortunately I do not use these operating systems... And it is unlikely that there will be something scary if plugins overlap each other.

Last edited by Yanick; 07-23-2021 at 11:46 AM.
Yanick is offline   Reply With Quote
Old 07-23-2021, 12:12 PM   #6
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

FTC the "Keep only one floating fx open at the same position" script is really great on the eyes here when floating a new FX.

The only thing that doesn't work so far is if you open a new project and then open a new FX. (I guess the variables are from the old project and don't match up) Instead of a new plug opening I get the error: 81: bad argument #1 to 'TakeFX_GetCount' (MediaItem_Take expected)
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 07-23-2021, 12:31 PM   #7
Teddy
Human being with feelings
 
Join Date: Sep 2011
Posts: 185
Default

This is great, but it would be nice to be able to pin some windows if you want to. Is that doable?
Teddy is offline   Reply With Quote
Old 07-24-2021, 01:54 AM   #8
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 1,018
Default

Quote:
Originally Posted by Triode View Post
FTC the "Keep only one floating fx open at the same position" script is really great on the eyes here when floating a new FX.

The only thing that doesn't work so far is if you open a new project and then open a new FX. (I guess the variables are from the old project and don't match up) Instead of a new plug opening I get the error: 81: bad argument #1 to 'TakeFX_GetCount' (MediaItem_Take expected)
Glad you like it I think it crashed because I didn't consider empty takes (the script also works with floating take/item fx). Let me know if it's still a problem with the updated version.

Quote:
Originally Posted by Yanick View Post
But is it really so difficult to add this feature natively? It should be easy. It seems there were a lot of requests. What's the catch?
Really not sure. Hopefully it gets added soon.

Quote:
Originally Posted by Teddy View Post
This is great, but it would be nice to be able to pin some windows if you want to. Is that doable?
Definitely doable, I could think of another action/script for the toolbar that toggles the pin status of the currently focused window. Could be quite a bit of work though, so I don't really want to add it atm. Let's see what the devs come up with in the next pre-release builds first.
FeedTheCat is online now   Reply With Quote
Old 07-26-2021, 01:42 PM   #9
Teddy
Human being with feelings
 
Join Date: Sep 2011
Posts: 185
Default

Quote:
Originally Posted by FeedTheCat View Post
Definitely doable, I could think of another action/script for the toolbar that toggles the pin status of the currently focused window. Could be quite a bit of work though, so I don't really want to add it atm. Let's see what the devs come up with in the next pre-release builds first.
Great. Good to hear.
Would love to see it included native without scripts, so fingers crossed. But great work by you, anyhow. Thanks again.
Teddy is offline   Reply With Quote
Old 07-26-2021, 02:33 PM   #10
javiramallo
Human being with feelings
 
javiramallo's Avatar
 
Join Date: Oct 2012
Location: Merida, Spain
Posts: 345
Default

Great! Thank you FTC.
javiramallo is offline   Reply With Quote
Old 08-13-2021, 02:01 AM   #11
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

Hey FTC

I've been enjoying your script but I think there's a serious bug:
It resets the settings of a specific plugin that I have (vst version).
The plugin is Lindell 80 Channel. It happens with the vst version and not the vst 3 version. Are you able to confirm this?

I'm not sure if it happens with any other specific plugins yet.

Here's a licecap. It also happens when the script is already running when the project is open. The demo of this plugin is available from plugin alliance.

__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 08-13-2021, 06:05 AM   #12
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 1,018
Default

Hey Triode,

I managed to replicate this, seems like it's not specific to this script though, it's a byproduct of using track chunks.

The following code will cause the same issue.

Code:
local track = reaper.GetSelectedTrack(0, 0)
local _, chunk = reaper.GetTrackStateChunk(track, '', false)
reaper.SetTrackStateChunk(track, chunk, false)
I just posted a bug report
FeedTheCat is online now   Reply With Quote
Old 08-14-2021, 07:13 AM   #13
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

Thanks for chasing that up FTC

I've edited a script together that turns your script off if a project is opened that has that vst plug in the session and says how many instances there are.

If anyone needs it shout and I'll post it. (probably a bit specific for mass consumption! )

Looks like the process of getting the settings from the vst2 to vst3 version is gonna have to be manual though.
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 08-15-2021, 05:22 AM   #14
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 1,885
Default

Useful, thanks FTC!
Vagelis is online now   Reply With Quote
Old 08-15-2021, 08:03 AM   #15
ramses
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,111
Default

I love this. So useful, and I love that it will let me decide what screen it operates on. Love it! ❤
ramses is online now   Reply With Quote
Old 03-04-2022, 02:12 AM   #16
dna598
Human being with feelings
 
Join Date: Jul 2007
Posts: 238
Default

Thanks for this. Been using it for a while (same position script).

I noticed I get some crackling/gui slow down sometimes, and it goes away when i turn it off.

Anyone else seeing this?

edit: it's likely happening when i move the plug to different position. Probably just the way it goes. Thanks.
dna598 is offline   Reply With Quote
Old 03-04-2022, 04:10 AM   #17
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 1,018
Default

Quote:
Originally Posted by dna598 View Post
edit: it's likely happening when i move the plug to different position. Probably just the way it goes. Thanks.
Yep, it only happens when you move the open fx window (the script updates the position of all other windows via chunk). Unfortunately there isn't really a way to avoid this. In the other script (centered), it only happens when you move the window to a new monitor.
FeedTheCat is online now   Reply With Quote
Old 03-04-2022, 05:06 AM   #18
dna598
Human being with feelings
 
Join Date: Jul 2007
Posts: 238
Default

Quote:
Originally Posted by FeedTheCat View Post
In the other script (centered), it only happens when you move the window to a new monitor.
ah nice one thanks again
dna598 is offline   Reply With Quote
Old 03-09-2022, 10:33 AM   #19
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

Hi FTC

Is it an easy mod to make this script only active when the mixer window is open? In a way that isn't more taxing on processing?
The reason being I use a different script when in the arrange window to open plugins and the two scripts work against each other there.
I'd have a go at making the change it's just deferred scripts do my head in!
Many thanks
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 03-10-2022, 08:03 AM   #20
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 1,018
Default

Quote:
Originally Posted by Triode View Post
Hi FTC

Is it an easy mod to make this script only active when the mixer window is open? In a way that isn't more taxing on processing?
The reason being I use a different script when in the arrange window to open plugins and the two scripts work against each other there.
I'd have a go at making the change it's just deferred scripts do my head in!
Many thanks
Yep, that's fairly easy. Find the Main function in the code and add this right at the start:

Code:
function Main()

    local is_mixer_visible = reaper.GetToggleCommandState(40078) == 1
    if not is_mixer_visible then
        reaper.defer(Main)
        return
    end
FeedTheCat is online now   Reply With Quote
Old 03-10-2022, 02:55 PM   #21
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

Brilliant! That works nicely thankyou
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 05-01-2022, 03:07 AM   #22
Ven Adams
Human being with feelings
 
Join Date: Jan 2015
Posts: 39
Default

So useful ! Good work FTC !!!
Can I ask you to make a version where there will be no restrictions on the number of open FX's, just center opened floating fx in center?
I was looking for a similar script in Reapack, but I only find
- amagalma_Center in screen the floating FX or FX Chain
- mpl_Move focused Track FX to screen center

In both cases you need to Open FX - Select FX window - Activate Script.
Ven Adams is offline   Reply With Quote
Old 05-01-2022, 04:11 AM   #23
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 1,018
Default

Quote:
Originally Posted by Ven Adams View Post
So useful ! Good work FTC !!!
Can I ask you to make a version where there will be no restrictions on the number of open FX's, just center opened floating fx in center?
I was looking for a similar script in Reapack, but I only find
- amagalma_Center in screen the floating FX or FX Chain
- mpl_Move focused Track FX to screen center

In both cases you need to Open FX - Select FX window - Activate Script.
I think this behavior was added natively not to long ago. Try this:
  • 1. Set Preferences > Plugins > Floating FX positioning > Modal default
  • 2. Set Preferences > General > Advanced UI/system tweaks > Modal window positioning > Center on current screen.
FeedTheCat is online now   Reply With Quote
Old 05-01-2022, 04:25 AM   #24
Ven Adams
Human being with feelings
 
Join Date: Jan 2015
Posts: 39
Default

Quote:
Originally Posted by FeedTheCat View Post
  • 2. Set Preferences > General > Advanced UI/system tweaks > Modal window positioning > Center on current screen.
Thanks a lot for your help! Didn't know about this setting.
Ven Adams is offline   Reply With Quote
Old 05-01-2022, 09:27 AM   #25
vsthem
Human being with feelings
 
Join Date: Nov 2018
Posts: 303
Default

What a fantastic little script! Love what you do. Thanks!
vsthem is offline   Reply With Quote
Old 05-02-2022, 12:14 PM   #26
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

There's a scenario that doesn't work with this script.
Say you have a plugin open in one window set and another plugin open in another window set. When switching window sets with the script running, the plugin in the window set you switch to often moves to a corner (bottom left most of the time). I'm not sure if there's a way around this?

Edit: To be clear, this is the case with the "...at the same position" version of the script
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 05-03-2022, 03:37 PM   #27
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 1,018
Default

Quote:
Originally Posted by Triode View Post
There's a scenario that doesn't work with this script.
Say you have a plugin open in one window set and another plugin open in another window set. When switching window sets with the script running, the plugin in the window set you switch to often moves to a corner (bottom left most of the time). I'm not sure if there's a way around this?

Edit: To be clear, this is the case with the "...at the same position" version of the script
Hmmm, I'll have a look when I find some time. Not sure if there's a good way to detect a window set change.
FeedTheCat is online now   Reply With Quote
Old 05-03-2022, 07:21 PM   #28
UserZero
Human being with feelings
 
UserZero's Avatar
 
Join Date: Jul 2010
Location: New England
Posts: 34
Default

Quote:
Originally Posted by FeedTheCat View Post
2. Set Preferences > General > Advanced UI/system tweaks > Modal window positioning > Center on current screen.
Is there something else that needs to be set in order to get this to work generally on Win 10? It doesn't seem to work at all.

For example, with Reaper on Display 2, when I open the modal MIDI Editor window, it opens on Display 1 (i.e., the place it was last opened, which I believe is the default for this option). Same for the Preferences... window and any FX window I open. Regardless how I set that option, I always get the default setting behavior.

Suggestions greatly appreciated.

TIA,
__________________
U0
AMD 3900X / Win10 Pro / EW/QLSO, N-I Komplete / Reaper

Last edited by UserZero; 05-04-2022 at 10:23 AM.
UserZero is offline   Reply With Quote
Old 05-08-2022, 03:18 AM   #29
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 959
Default

Quote:
Originally Posted by FeedTheCat View Post
Hmmm, I'll have a look when I find some time. Not sure if there's a good way to detect a window set change.
I've sorted this by making my window set change key command toggle your script off, change the window set and then turn your script on on again.
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode 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 03:18 PM.


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