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: 2,197
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
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 07-23-2021, 10:12 AM   #2
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,185
Default

Bravo!
I'll give these a try
Thank you!
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is offline   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: 2,008
Default

FTC FTC FTC FTC! thanks!
daniellumertz is offline   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: 546
Default

Thank you very much!
Skorobagatko is offline   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: 612
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: 1,185
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 offline   Reply With Quote
Old 07-23-2021, 12:31 PM   #7
Teddy
Human being with feelings
 
Join Date: Sep 2011
Posts: 198
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: 2,197
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.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 07-26-2021, 01:42 PM   #9
Teddy
Human being with feelings
 
Join Date: Sep 2011
Posts: 198
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: 388
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: 1,185
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 offline   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: 2,197
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
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 08-14-2021, 07:13 AM   #13
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,185
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 offline   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: 3,827
Default

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

I love this. So useful, and I love that it will let me decide what screen it operates on. Love it! ❤
ramses is offline   Reply With Quote
Old 03-04-2022, 02:12 AM   #16
dna598
Human being with feelings
 
Join Date: Jul 2007
Posts: 724
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: 2,197
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.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 03-04-2022, 05:06 AM   #18
dna598
Human being with feelings
 
Join Date: Jul 2007
Posts: 724
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: 1,185
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 offline   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: 2,197
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
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 03-10-2022, 02:55 PM   #21
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,185
Default

Brilliant! That works nicely thankyou
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is offline   Reply With Quote
Old 05-01-2022, 03:07 AM   #22
Ven Adams
Human being with feelings
 
Join Date: Jan 2015
Posts: 53
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: 2,197
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.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 05-01-2022, 04:25 AM   #24
Ven Adams
Human being with feelings
 
Join Date: Jan 2015
Posts: 53
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: 659
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: 1,185
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 offline   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: 2,197
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.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   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: 1,185
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 offline   Reply With Quote
Old 06-18-2022, 11:48 AM   #30
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,185
Default

Update on the last post. Restarting the script works but in large sessions it slows down the window set change considerably.

I'm wondering if the script could write the last plugin window position to ExtState so that if the window set is changed any open plugin windows in the switched window set can use the same position?

It's a corner case I know. If anyone has the time to put this into the "Keep only one floating fx open at the same position" script I will donate - it's too complex for me
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is offline   Reply With Quote
Old 06-19-2022, 12:43 PM   #31
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,197
Default

Quote:
Originally Posted by Triode View Post
Update on the last post. Restarting the script works but in large sessions it slows down the window set change considerably.

I'm wondering if the script could write the last plugin window position to ExtState so that if the window set is changed any open plugin windows in the switched window set can use the same position?

It's a corner case I know. If anyone has the time to put this into the "Keep only one floating fx open at the same position" script I will donate - it's too complex for me
The problem is that there isn't a really a way to detect screenset changes afaik. And if there was, the lag might still not be avoidable (it lags because the script is setting fx positions via chunking, which it would also need to do when changing screenset).

That said, I looked at the code and improved it a bit. If I'm thinking correctly it should now be a lot faster when changing screensets (assuming that you haven't created the screenset for that particular project, in which case... it's complicated...). Let me know if there's a noticeable difference
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 06-19-2022, 01:56 PM   #32
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,185
Default

Hi FTC

Thanks. I'll give it a try and let you know.

The initial problem was that if screenset 1 and 2 had a plugin open then changing between them meant that the plugin on the switched to screenset would get moved to a screen corner. As if the data about where the plugin window should be was lost. I imagined that if the position data was written to ExtState then it could be retained after switching (even if the screenset change itself can't be detected).
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is offline   Reply With Quote
Old 06-20-2022, 12:50 AM   #33
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,197
Default

Quote:
Originally Posted by Triode View Post
Hi FTC

Thanks. I'll give it a try and let you know.

The initial problem was that if screenset 1 and 2 had a plugin open then changing between them meant that the plugin on the switched to screenset would get moved to a screen corner. As if the data about where the plugin window should be was lost. I imagined that if the position data was written to ExtState then it could be retained after switching (even if the screenset change itself can't be detected).
Hmmm, why extstate? You want to save the position when the script ends and reload when it opens? The current position is saved in a variable as long as the script runs.

The primary issue is that I can't differentiate if you move the window manually or the move is causes by a screenset.

I have an idea maybe. Do you use keyboard shortcuts to switch screensets?
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 06-20-2022, 01:02 AM   #34
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,185
Default

Quote:
Originally Posted by FeedTheCat View Post
Hmmm, why extstate? You want to save the position when the script ends and reload when it opens? The current position is saved in a variable as long as the script runs.

The primary issue is that I can't differentiate if you move the window manually or the move is causes by a screenset.

I have an idea maybe. Do you use keyboard shortcuts to switch screensets?
Try making two window sets both with a different plugin window open and you'll find that the position values are lost when you switch window sets. I think when the script is running through a window set change, the values are lost because the plugin window gets moved to the side of the screen as if the values are zeroed out.

I do use a keyboard shortcut to switch screensets and I added in to this a command to turn your script off and on again during the change which cures the problem of plugin windows moving but even with your updated code this slows the window set change down on large sessions.
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is offline   Reply With Quote
Old 02-17-2023, 05:59 PM   #35
Gass n Klang
Human being with feelings
 
Gass n Klang's Avatar
 
Join Date: Nov 2015
Location: Cologne
Posts: 1,640
Default

super useful thanks! would be nice if we could make exceptions. especially: Doesn't affect Master Track Plugins
__________________
https://juliusgass.de
Gass n Klang is offline   Reply With Quote
Old 02-17-2023, 08:07 PM   #36
boolin
Human being with feelings
 
Join Date: Oct 2018
Posts: 262
Default

thank you, feedthecat!
boolin is offline   Reply With Quote
Old 02-18-2023, 03:29 AM   #37
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,197
Default

Quote:
Originally Posted by Gass n Klang View Post
super useful thanks! would be nice if we could make exceptions. especially: Doesn't affect Master Track Plugins
Hmm, exceptions for specific fx by name?

Quote:
Originally Posted by boolin View Post
thank you, feedthecat!
Cheers
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 02-18-2023, 07:53 AM   #38
Gass n Klang
Human being with feelings
 
Gass n Klang's Avatar
 
Join Date: Nov 2015
Location: Cologne
Posts: 1,640
Default

Quote:
Originally Posted by FeedTheCat View Post
Hmm, exceptions for specific fx by name?
exception for all fx that are on the master track would be nice I think. That way, we can leave the limiter and bus compression on a second screen.
__________________
https://juliusgass.de
Gass n Klang is offline   Reply With Quote
Old 02-18-2023, 07:09 PM   #39
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,197
Default

Quote:
Originally Posted by Gass n Klang View Post
exception for all fx that are on the master track would be nice I think. That way, we can leave the limiter and bus compression on a second screen.
Ok cool, just added two new scripts to ReaPack.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 02-18-2023, 09:29 PM   #40
boolin
Human being with feelings
 
Join Date: Oct 2018
Posts: 262
Default

very helpful. thank you, ftc!
boolin 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 10:38 PM.


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