Topic: TMFX Windows key assignment to open / close mixer

Hi,

I would like to assign a function key of my keyboard, i.e. "F1", to open and close
my 2 TotalMixFX Windows, one for UFX+, one for RayDAT.

How is this possible perhaps with TMFX or an external tool ?

Would be quicker instead of having to move the mouse cursor to the small icon in the info area in the lower right.

I have only one 23" screen so that I cant keep it instantly open.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

Re: TMFX Windows key assignment to open / close mixer

Totally agree, 100%!  A hotkey to toggle open and close of the TMFX window is a must!

3 (edited by Potscrubber 2016-10-10 21:49:34)

Re: TMFX Windows key assignment to open / close mixer

I use Autohotkey to achieve this. I use the Windows Apps key to open TMFX, and Alt-Apps to open the driver panel.  It does require an AHK widget to be running in the background, but I use that for all sorts of other functions too.  If there is any interest I can post the code here.

Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

Re: TMFX Windows key assignment to open / close mixer

That would be great, many thanks.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

5 (edited by Potscrubber 2016-12-27 00:44:48)

Re: TMFX Windows key assignment to open / close mixer

This is a bit long, but gives some flexibility with different drivers, and was stripped out of a much bigger script.  If anyone has AHK script / automation needs pm me.

Updated - see post 17
Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

6 (edited by ramses 2016-10-11 06:48:55)

Re: TMFX Windows key assignment to open / close mixer

Many thanks, i substituted AppsKey with F1 and one TM instance loads.
But not yet the driver page. Needs more time to check whether I overlooked something.

Perfect for me would be, if my 2 TM instances, one for UFX+, one for RayDAT would open and close simultaneously.
Same with the 2 driver windows.

Do you have eventually a solution for this if its not too much work for you ?

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

7 (edited by Potscrubber 2016-10-11 07:23:31)

Re: TMFX Windows key assignment to open / close mixer

ramses wrote:

But not yet the driver page. Needs more time to check whether I overlooked something.

Which drivers are you using?  There are variables for 4 of them in the script, but 3 are commented out and it's currently using the standard usb.  I have no experience with TB driver or Raydat (Raydat is probably driver HDSPe).  I think you probably need two different hotkeys for settings - 1 for UFX+, 1 for Raydat

To find out more,
- bring up your RME settings window
- Right-click on the AHK tray icon, and run Window Spy
- position window spy alongside RME, then click on RME title bar and hit Win-A (this freezes window spy display)
- this will give you the Window title, and the exe.
- Substitute for the ones in the script if different
- do the same for Raydat driver (& report back)

We can setup two hotkeys for different device settings easily enough.

ramses wrote:

Many thanks, i substituted AppsKey with F1 and one TM instance loads.
Perfect for me would be, if my 2 TM instances, one for UFX+, one for RayDAT would open and close simultaneously.
Same with the 2 driver windows.

Can you normally have two TMFX windows open?  I thought you had to switch between devices with the dropdown on the top right?

- do the same as above with Window Spy for each TMFX window
- give me the Window Title, Class and Process for each (copy and paste from Spy)
- remember to unfreeze Spy when switching between TMFX windows

ramses wrote:

Do you have eventually a solution for this if its not too much work for you ?

Let's see... wink

Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

Re: TMFX Windows key assignment to open / close mixer

Yes you can open 2 TM windows at once, one for each interface.
I need the 2 screens only because of my old setup to use UFX (now UFX+) as preamp on RayDAT.

If I rethink its about time to consolidate and move all to the UFX+ as the performance is so close to the RayDAT.
Then its also easier for me in terms of routing and having to use only one driver in my Cubase templates and projects.

So maybe forget about my idea to open 2 windows at once, this saves you surely time.
I will simply keep the RayDAT in my PC, shall the UFX+ be away to have a backup.

I will try out your tips ... many thanks .. to get this setup for one window running now.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

9 (edited by ramses 2016-10-11 12:13:43)

Re: TMFX Windows key assignment to open / close mixer

Ok, I changed my setup and am using now only your code. Thanks for the explanation, everything works like a charm now with
F1 to open TotalMixFX and ALT-F1 to open the driver settings dialog.

There is only one thing remaining from my side, maybe you have an idea:

When hitting F1 I want the TM window to be
- on top of other windows and
- shall I have it iconized and push F1, then I want TM to be opened.

At the moment F1 works only when TM was on top of the screen and not iconized.

If you have an idea for that, would be superb ! wink

Thanks for having shown me a new good open source software, its cool, I like it.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

10 (edited by Potscrubber 2016-12-27 00:45:55)

Re: TMFX Windows key assignment to open / close mixer

Hi ramses

For your first question (on top), the easiest thing is to set this in TMFX itself.  Menu > Options / Always on top.
If I've misunderstood you, have a look into the AHK WinSet command
https://autohotkey.com/docs/commands/WinSet.htm

For the second (open when minimised) see below for a new script.  This generally handles everything better also, and I changed the hotkeys to F1.

Happy to help, I learnt a couple of things when re-doing the script, and getting it up when minimised was something I've wanted in the past too.

Updated - see post 17
Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

11 (edited by ramses 2016-10-12 05:21:07)

Re: TMFX Windows key assignment to open / close mixer

You're amazing, TM window works now even if not setting always on top inside of TM.

The UFX+ drivers Settings Dialog Window uses different Windows Title.

With this addition / activation of code it works now ! Very cool wink

; driver UFX+
SettingsWin := "MADIface Series Settings" 
SettingsExe := "madifaceusb.exe

1000 thanks for your great support, very useful.
I compiled now the script by simply a rightclick and moved the .exe file to the autostart folder of my user account.

Pretty easy and straightforward.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

12 (edited by Potscrubber 2016-10-12 22:10:52)

Re: TMFX Windows key assignment to open / close mixer

No problem.  It's surprising what you can do with AHK.  The only real limitations I've found are that some modern programs (like Totalmix and Juce based apps) don't expose their window controls so demonic possession of them with AHK isn't easy or possible sometimes.

But TMFX gives you OSC control so a bit of scripting and a command line OSC exe gives me control for studio convenience functions.  I haven't been able to get AHK to construct OSC messages directly, it's over my head.

Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

13 (edited by ramses 2016-12-27 10:06:56)

Re: TMFX Windows key assignment to open / close mixer

EDIT: See v5 script in post #17 or even later versions in this thread.
This version 3 script didn't run on all machines.

Original Post:

Tabbified, 80col, added comments to script statements

;; ****************************************************************************
;; AHK Script For Showing / Hiding TotalMixFX and RME Driver Settings Dialog
;; RME User Forum - v2 by Potscrubber (author) 12.10.2016
;;                            - v3 by ramses, cosmetics, document vars&statements
;; See: https://www.forum.rme-audio.de/viewtopic.php?id=24322
;; ****************************************************************************

#NoEnv                ; performance and stability
SendMode Input            ; for better speed and reliability
SetWorkingDir %A_ScriptDir%    ; ensures consistent start directory
DetectHiddenWindows, Off    ; default: Off
#SingleInstance force        ; replaces old instance of program automatically
SetTitleMatchMode, 2        ; 2: window title can contain WinTitle anywhere

; set the actual hotkeys here 
TotalMixKey = F1
DriverSettingsKey = !F1    ; Alt-F1

; driver variables - 5 sets for 5 common RME drivers - uncomment yours

; driver USB
; SettingsWin := "Fireface USB Settings"  
; SettingsExe := "firefaceusb.exe"

; driver HDSPe
; SettingsWin := "Hammerfall DSP Settings"
; SettingsExe := "hdsp32.exe"

; driver USB_XT
; SettingsWin := "MADIface USB Settings"  
; SettingsExe := "madifaceusb.exe"

; driver UFX+
SettingsWin := "MADIface Series Settings"  
SettingsExe := "madifaceusb.exe"

; driver HDSPe_XT
; SettingsWin := "HDSPe FX Settings"
; SettingsExe := "hdspe_fx.exe"

; some other variable definitions
SysPath = C:\WINDOWS\System32

TotalMixWin := "RME TotalMix FX ahk_exe TotalMixFX.exe"  
TotalMixExe := "TotalMixFX.exe"

; hotkey definitions
Hotkey, %TotalMixKey%, TotalMixKey        ; launch/hide TotalMixFX
Hotkey, %DriverSettingsKey%, DriverSettingsKey    ; launch/hide driver settings

return  ;; END auto exec 

;; ****************************************************************************
;; RME Devices Hotkeys
;; ****************************************************************************

TotalMixKey: 

IfWinExist, %TotalMixWin%
{
    ; if minimized then restore.
    WinGet, winState, MinMax, %TotalMixWin%
    if (winState = -1)   
    {
        WinRestore, %TotalMixWin%
        return
    }  
    ; else close the window
    WinClose, %TotalMixWin%
    return
}

IfWinNotExist, %TotalMixWin%
{
    Process, Exist, %TotalMixExe%
    if not Errorlevel
    {
        Run, %SysPath%\%TotalMixExe%,, UseErrorLevel
        if ErrorLevel = ERROR 
        {
            MsgBox, 48,, Totalmix exe could not be launched!  
            return
        }
        ; have to run again to create window first time
        Sleep, 1000
        Run, %SysPath%\%TotalMixExe%    
    }
    else
    {
        WinShow, %TotalMixWin%
        WinActivate, %TotalMixWin%
        return
    }
}
return


DriverSettingsKey:  

IfWinExist, %SettingsWin%
{
    WinClose, %SettingsWin%
    return
}

IfWinNotExist, %SettingsWin%
{
    Process, Exist, %SettingsExe%
    if not Errorlevel
    {  
        Run, %SysPath%\%SettingsExe%,, UseErrorLevel
        if ErrorLevel = ERROR
        {
            MsgBox, 48,, Driver settings exe could not be launched!
            return
        }
        ; have to run again to create window first time
        Sleep, 1000
        Run, %SysPath%\%SettingsExe%
        return
    }
    else
    {
        Run, %SysPath%\%SettingsExe%
        return 
    }
}
return
BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

Re: TMFX Windows key assignment to open / close mixer

This is great!

I have a UC, and not having the remote means opening TotalMix constantly to change settings.

Has anyone made a script to control volume, or load different snapshots?

ufx ii / bfp

Re: TMFX Windows key assignment to open / close mixer

wderganc wrote:

This is great!

I have a UC, and not having the remote means opening TotalMix constantly to change settings.

Has anyone made a script to control volume, or load different snapshots?

Because TMFX doesn't use standard Windows controls for the most part, AHK cannot manipulate the GUI.  So the only way to control the items you list above is either through midi messages - which AHK can do directly with some kludges - or with OSC messages, which have to come from another source other than native AHK.  I've written a command-line OSC message sender, and I have my AHK script run that in the background to do things like Mono, mute main outs before I change sample rate, etc etc.

Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

16 (edited by wderganc 2016-10-17 05:39:16)

Re: TMFX Windows key assignment to open / close mixer

Thanks for the quick reply!

I just came back to say that the quickloading snapshots function in Totalmix works great. (RME tutorial: https://www.youtube.com/watch?v=bQUQOG72r2A)

A lot of what you just said just went way over my head smile

Does your method involve using a keyboard to change the volume, or MIDI messages from something like a Mackie control?

ufx ii / bfp

17 (edited by Potscrubber 2016-12-27 12:57:32)

Re: TMFX Windows key assignment to open / close mixer

Updated to accomodate recent changes in driver window title, and also to show TMFX window first time after boot when process is pre-existing.  Updated 27/12/16 with error codes.

;; ****************************************************************************
;; AHK Script For Showing / Hiding TotalMixFX and RME Driver Settings Dialog
;; RME User Forum - v2 by Potscrubber (author) 18.11.2016
;;                - v3 by ramses, cosmetics, document vars & statements
;;                - v4 driver updates & bug fix for TMFX after boot
;;                - v5 syspath tweak and error codes added
;; See: https://www.forum.rme-audio.de/viewtopic.php?id=24322
;; ****************************************************************************


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
DetectHiddenWindows, Off    ; default: Off
#SingleInstance force        ; replaces old instance of program automatically
SetTitleMatchMode, 2        ; 2: window title can contain WinTitle anywhere

; set the actual hotkeys here 
TotalMixKey = F1
DriverSettingsKey = !F1    ; Alt-F1

; driver variables - 5 sets for 5 common RME drivers - uncomment or add yours - the default is standard usb 2 driver.

; driver USB 2 including Fireface UFX - UCX - 802 - UC, Babyface, Babyface Pro
SettingsWin := "Fireface USB Settings"  
SettingsExe := "firefaceusb.exe"

; driver HDSPe
;SettingsWin := "Hammerfall DSP Settings"
;SettingsExe := "hdsp32.exe"

; driver USB 3 including Fireface UFX+, MADIface XT (V 0.9554 and later) / Pro / USB
;SettingsWin := "MADIface Series Settings" 
;SettingsExe := "madifaceusb.exe"

; old USB 3 driver MADIface XT for V 0.9540 and earlier
;SettingsWin := "MADIface USB Settings"  
;SettingsExe := "madifaceusb.exe"

; driver HDSPe MADI FX or MADIface XT (E-PCIe)
;SettingsWin := "HDSPe FX Settings"
;SettingsExe := "hdspe_fx.exe"

; some other variable definitions
SysPath := "C:\WINDOWS\System32"

TotalMixWin := "RME TotalMix FX ahk_exe TotalMixFX.exe"  
TotalMixExe := "TotalMixFX.exe"

; hotkey definitions
Hotkey, %TotalMixKey%, TotalMixKey ;Launch / hide TotalMix
Hotkey, %DriverSettingsKey%, DriverSettingsKey ;Launch / hide RME driver Settings

return  ;; END auto exec 

;; *****************************************************************************
;; RME Devices Hotkeys
;; *****************************************************************************

TotalMixKey: 
IfWinExist, %TotalMixWin%
{
  ; if minimized then restore.
  WinGet, winState, MinMax, %TotalMixWin%
  if (winState = -1)   
  {
      WinRestore, %TotalMixWin%
      return
  }  
  ; else close the window
  WinClose, %TotalMixWin%
  return
}

IfWinNotExist, %TotalMixWin%
{
  Process, Exist, %TotalMixExe%
  if not Errorlevel
  {
    Run, %SysPath%\%TotalMixExe%,, UseErrorLevel
    if ErrorLevel = ERROR 
    {
      MsgBox, 48,, The Totalmix exe could not be launched!`nError Code: %A_LastError%
      return
    }
    ; have to run again to create window first time
    Sleep, 1000
    Run, %SysPath%\%TotalMixExe%    
  }
  else
  {
    WinShow, %TotalMixWin%
    WinActivate, %TotalMixWin%
    ; have to run again to create window first time after boot (process exists)
    WinWaitActive, %TotalMixWin%,,1   
    if ErrorLevel
      Run, %SysPath%\%TotalMixExe%     
    return
  }
}
return


DriverSettingsKey:  
IfWinExist, %SettingsWin%
{
  WinClose, %SettingsWin%
  return
}

IfWinNotExist, %SettingsWin%
{
  Process, Exist, %SettingsExe%
  if not Errorlevel
  {  
    Run, %SysPath%\%SettingsExe%,, UseErrorLevel
    if ErrorLevel = ERROR
    {
      MsgBox, 48,, The driver settings exe could not be launched!`nError Code: %A_LastError%
      return
    }
    ; have to run again to create window first time
    Sleep, 1000
    Run, %SysPath%\%SettingsExe%
    return
  }
  else
  {
    Run, %SysPath%\%SettingsExe%
    return 
  }
}
return
Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

18 (edited by fripholm 2016-12-26 20:03:04)

Re: TMFX Windows key assignment to open / close mixer

I'm using Autohotkey for years now for different hotkeys and other stuff and always wanted a way to control Totalmix with it. I was glad to  find the above script but I'm having problems with it.

The Driversettings load fine when their key is pressed regardless of it being loaded or opened before. The TotalMixFX  windows (v1.40) however, only opens when the EXE is running AND the window had been opened before.

When TotalMixFX.exe is not running, this message appears "The Totalmix exe could not be launched!"

When TotalmixFX.exe is running but had not been opened yet, I'm getting a "File not found" error message from Autohotkey.

It seems this happens when the script tries to open TMFX from C:\Windows\System32. After I copied the exe to C: and changed the script accordingly it works fine but it's not the way it's intended to be. So what's causing this?

I'm on Windows 7 Pro x64. Any ideas?

Re: TMFX Windows key assignment to open / close mixer

fripholm wrote:

I'm using Autohotkey for years now for different hotkeys and other stuff and always wanted a way to control Totalmix with it. I was glad to  find the above script but I'm having problems with it.

1. Make sure you are using v4 of the script in post 17.
2. Change the SysPath variable (under the driver variable definitions) to wherever you keep your TotalmixFX.exe.

It's strange it's not in System32 though - has always installed there automatically for me in hundreds of installations.

Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

Re: TMFX Windows key assignment to open / close mixer

Potscrubber wrote:

1. Make sure you are using v4 of the script in post 17.

This is the one I'm using.

It's strange it's not in System32 though - has always installed there automatically for me in hundreds of installations.

No, it definitely is there - AHK just can't access it on my system. Autohotkey might need administrative privileges but I have no idea how to start a script as administrator. BTW I'm the only user on this system which is also the admin.

21 (edited by ramses 2016-12-26 23:53:45)

Re: TMFX Windows key assignment to open / close mixer

Also important is the correct string in the "SettingsWin" and "SettingsExe" variable.

These are the required steps for installation: http://www.tonstudio-forum.de/blog/inde … ndruck-zB/

This way it worked for me.

BTW My user has no admin rights.

If the script finally works I convert it to an executable which I placed  into my users autostart folder

C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

Re: TMFX Windows key assignment to open / close mixer

Potscrubber wrote:

Updated to accomodate recent changes in driver window title, and also to show TMFX window first time after boot when process is pre-existing.  Updated 27/12/16 with error codes.

;;                - v5 syspath tweak and error codes added

; driver USB 3 including Fireface UFX+, MADIface XT (V 0.9554 and later) / Pro / USB
;SettingsWin := "MADIface Series Settings" 
;SettingsExe := "madifaceusb.exe

Works fine for me many thanks.

BTW: Line 33 is missing a close quote.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

23 (edited by fripholm 2016-12-27 11:12:12)

Re: TMFX Windows key assignment to open / close mixer

Finally found the problem: I still had a 32-bit version of Autohotkey installed. I've re-installed the latest version as 64-bit and now it works -

ALMOST... Whenever TMFX is not running when pressing the hotkey, AHK opens two instances of TotalMix...  aaarrrgghhh yikes

24 (edited by ramses 2016-12-27 11:36:31)

Re: TMFX Windows key assignment to open / close mixer

fripholm wrote:

Finally found the problem: I still had a 32-bit version of Autohotkey installed. I've re-installed the latest version as 64-bit and now it works -

ALMOST... Whenever TMFX is not running when pressing the hotkey, AHK opens two instances of TotalMix...  aaarrrgghhh yikes

I can confirm this behaviour, that 2 TM instances will be opened, if TM was not running before.

But this was already in v3 the case.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

Re: TMFX Windows key assignment to open / close mixer

ramses wrote:

BTW: Line 33 is missing a close quote.

fixed

Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

Re: TMFX Windows key assignment to open / close mixer

ramses wrote:
fripholm wrote:

Finally found the problem: I still had a 32-bit version of Autohotkey installed. I've re-installed the latest version as 64-bit and now it works -

ALMOST... Whenever TMFX is not running when pressing the hotkey, AHK opens two instances of TotalMix...  aaarrrgghhh yikes

I can confirm this behaviour, that 2 TM instances will be opened, if TM was not running before.

But this was already in v3 the case.


I can't reproduce this.  Any insights as to possible reasons?  Multiple processes?  Multiple interfaces?

Madiface XT, Madiface, 3x Micstasy, ADI8QS
Sequoia 17, W10 x64
https://bsound.co.nz/tools-nix

Re: TMFX Windows key assignment to open / close mixer

I have 2 interfaces: UFX+ and RayDAT.
Turned off UFX+, only RayDAT remains active.
Quitting TM.
Hit F1
Still 2 instances of TM open.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

28 (edited by fripholm 2017-01-01 12:24:50)

Re: TMFX Windows key assignment to open / close mixer

Have found a workaround for the 2-instances problem. TMFX seems to take longer to start with an UFX+ than with other interfaces, so no one else noticed this. I had to increase the waiting time from 1 to 4 seconds and this helped. In my (slightly modified) version of the script it's in line #87 - see below (the line with the "!!!!!!!!!!!!!!!!!!!").


IfWinNotExist, %TotalMixWin%
{
  Process, Exist, %TotalMixExe%
  if not Errorlevel
  {
    Run, %SysPath%\%TotalMixExe%,, UseErrorLevel
    if ErrorLevel = ERROR 
    {
      MsgBox, 48,, The Totalmix exe could not be launched!`nError Code: %A_LastError%
      return
    }
    ; have to run again to create window first time
    Sleep, 4000 ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Run, %SysPath%\%TotalMixExe%    
  }

Re: TMFX Windows key assignment to open / close mixer

Well done, I can confirm this works wink

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub13

30 (edited by fgimian 2021-07-31 02:29:32)

Re: TMFX Windows key assignment to open / close mixer

Thanks for the work done here.  I've simplified the script significantly and only catered for TotalMixFX (since that's the only one I open frequently).

The following version will bind toggling of the TolaMixFX window to Ctrl+Shift+O.

Here's my version;

#SingleInstance, force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

; Define the TotalMix executable location and window title.
TotalMixExe := "TotalMixFX.exe"
TotalMixWin := "ahk_exe " TotalMixExe

; TotalMixFX shortcuts.
; Based on https://www.forum.rme-audio.de/viewtopic.php?id=24322
^!o::
if WinExist(TotalMixWin)
{
     ; If the TotalMix window is minimised, restore it; otherwise simply close it.
     WinGet, TotalMixWinState, MinMax, %TotalMixWin%
     if TotalMixWinState = -1
     {
          WinRestore, %TotalMixWin%
     }
     else
     {
          WinClose, %TotalMixWin%
     }
}
else
{
     ; Check if the process is running and start it if required.
     Process, Exist, %TotalMixExe%
     if not Errorlevel
     {
          Run, C:\WINDOWS\System32\%TotalMixExe%,, UseErrorLevel
          if ErrorLevel = ERROR
          {
               MsgBox, 48,, %TotalMixExe% could not be launched! (Error Code: %A_LastError%)
               return
          }
          ; Wait a short time for the application to launch.
          Sleep, 1000
     }

     ; Show, activate and wait for the window to be active.
     WinShow, %TotalMixWin%
     WinActivate, %TotalMixWin%
     WinWaitActive, %TotalMixWin%,, 1
}
return

And a little bonus for Cubase users, vertical zoom with Ctrl+Shift+Wheel:

; Cubase shortcuts.
#IfWinActive ahk_class SteinbergWindowClass
    ; Use Ctrl+Shift+scroll for vertical zooming
    ; (I found that using Send would also send the original modifiers in Cubase, while SendEvent
    ; worked as expected)
    ^+WheelUp::SendEvent, H
    ^+WheelDown::SendEvent, G
#IfWinActive