JoepVanlier / Hackey-Trackey

A LUA tracker plugin for REAPER 5.x and up. Designed to mimick the pattern editor in Jeskola Buzz.
MIT License
126 stars 10 forks source link

ENTER, closing hackey trackey, opening hackey patterns #60

Closed michaelsjackson closed 3 years ago

michaelsjackson commented 5 years ago

Can we get an option for this behaviour? And from hackey patterns same. ENTER closing hackey patterns, opening hackey trackey.

ENTER is just an example I would prefer. The method is: Using a hotkey jumping between those windows, but always closing the other first as we want simplicity. One view, not both together, replicating jeskola buzz tracker style of editing.

michaelsjackson commented 5 years ago

Well, there are many workarounds for this, I guess I will use an AutoHotkey workaround for now. The trick is using a python script for triggering an AutoHotkey script which takes care of the window closing, I tried with pure lua, but somehow the window closing I could not get as I wanted, yet. At least I know AutoHotkey is very reliable.

python script looks as follows, you can run any .ahk script, which is perfect:

import subprocess subprocess.Popen(r'C:\ahk\AutoHotkey.exe "C:\ahk\Reaper\TrackerSequencerToggler\TrackerSequencerToggler.ahk"')

And TrackerSequencerToggler.ahk could be something like or some other variant:

; setting general environment variables

NoEnv

SingleInstance force

InstallKeybdHook

SendMode Input SetTitleMatchMode, 2 DetectHiddenWindows, On SetCapsLockState, AlwaysOff

!Enter:: IfWinExist, Hackey Trackey { WinClose, Hackey Trackey ; start patterns here Send ^1 ; requirement: Ctrl+1 is mapped in Reaper to Hackey Patterns }

IfWinExist, Hackey Patterns { WinClose, Hackey Patterns ; start tracker here Send ^2 ; requirement: Ctrl+2 is mapped in Reaper to Hackey Trackey or tracker.lua } return

Ahk script could be a bit more advanced and use OSC directly, then the two requirements would not be necessary, if I try that variant, I can share it here as well. The above toggles using Alt+Enter between hackey trackey and hackey patterns. Using AutoHotkey has another advantage, you could also make sure both windows have same size and appear on same position, if you want this. So, even on a small laptop you could make sure you see the tracker/sequencer and Reaper's arrange/mixer in non-overlapping fashion. Or right half for tracker/patterns, left half arrange/mixer.

michaelsjackson commented 5 years ago

Not it seems to work by itself, however requiring double ENTER rahter than a single ENTER. Could this be converted to a single ENTER? First ENTER opening the new editor, second ENTER closing old editor. New and old editors means trackey or patterns.

The main problem here is we have no expected behaviour. When you go to hackey trackey or hackey patterns and hit ENTER, you never know what will happen, will it close itself? will it open the other editor? This is the frustrating part.

JoepVanlier commented 5 years ago

Alright. For Hackey Trackey I added this as an option now.

If you want this closing behaviour for other custom commands which call scripts, simply add a 1 as a last argument, like so; keys.startPat = { 0, 0, 0, 13, "Hackey Sequencer/Sequencer/HackeyPatterns_exec.lua", 1 }

You can disable this behaviour in the config by unchecking "Allow commands to close HT".