Add a macOS/Linux installer, and manual install steps
install.ps1 could never have worked outside Windows: it reads %APPDATA% for the resource path, guards on Get-Process, and needs PowerShell installed. install.sh mirrors it exactly -- same actions, same key table, same idempotent rewrite and backup -- differing only in resource-path discovery and --real-control, which exists because modifier bit 8 means Ctrl on Windows but Command on macOS. Also document installing by hand from the action list, for anyone who would rather not run either script. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,21 +26,95 @@ Clone or download this repository anywhere you like, then:
|
||||
|
||||
1. **Close REAPER completely.** It rewrites `reaper-kb.ini` when it exits and
|
||||
will throw away anything written while it is running.
|
||||
2. Run:
|
||||
2. Run the installer for your platform:
|
||||
|
||||
**Windows**
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File install.ps1
|
||||
```
|
||||
|
||||
3. Start REAPER, select a MIDI item, press **`Alt+Shift+G`**.
|
||||
**macOS / Linux**
|
||||
|
||||
```bash
|
||||
chmod +x install.sh # first time only
|
||||
./install.sh
|
||||
```
|
||||
|
||||
3. Start REAPER, select a MIDI item, press **`Alt+Shift+G`** (`Option+Shift+G`
|
||||
on a Mac).
|
||||
|
||||
You should hear something like *"Grid mode on, C major, grid 1/16, hold off,
|
||||
C5, 1.1.00"*.
|
||||
|
||||
To remove it again: `powershell -ExecutionPolicy Bypass -File install.ps1 -Uninstall`
|
||||
To remove it again:
|
||||
|
||||
The installer backs up `reaper-kb.ini` to `reaper-kb.ini.midigrid-backup`
|
||||
before its first change, and is safe to re-run.
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File install.ps1 -Uninstall # Windows
|
||||
```
|
||||
```bash
|
||||
./install.sh --uninstall # macOS / Linux
|
||||
```
|
||||
|
||||
Both installers back up `reaper-kb.ini` to `reaper-kb.ini.midigrid-backup`
|
||||
before their first change, and are safe to re-run.
|
||||
|
||||
### macOS notes
|
||||
|
||||
`install.sh` does exactly what `install.ps1` does — same actions, same
|
||||
bindings — but finds the resource folder at
|
||||
`~/Library/Application Support/REAPER` (falling back to `~/.config/REAPER` on
|
||||
Linux). If yours is elsewhere, find it via **Options → Show REAPER resource
|
||||
path** and pass it:
|
||||
|
||||
```bash
|
||||
./install.sh --resource-path "/path/to/REAPER"
|
||||
```
|
||||
|
||||
**Modifiers.** In `reaper-kb.ini` the modifier bit that means Ctrl on Windows
|
||||
means **Command** on macOS; the physical Control key is a different bit. So by
|
||||
default every `Ctrl+…` binding in the [key table](#keys) is `Command+…` on a
|
||||
Mac, which is what Mac users expect. To bind the physical Control key instead:
|
||||
|
||||
```bash
|
||||
./install.sh --real-control
|
||||
```
|
||||
|
||||
`Alt` in the key table is the `Option` key on a Mac either way.
|
||||
|
||||
### Manual installation
|
||||
|
||||
If you would rather not run a script — or you want a different key layout —
|
||||
you can do the whole thing from REAPER's UI. Nothing about MIDI Grid depends
|
||||
on the installer; it only writes action registrations and key bindings.
|
||||
|
||||
1. **Register the scripts.** In REAPER, open **Actions → Show action list**,
|
||||
set the section selector to **Main**, and choose **New action → Load
|
||||
ReaScript…**. Select these two files from wherever you put the repository:
|
||||
|
||||
- `MidiGrid_OpenInGrid.lua`
|
||||
- `MidiGrid_Daemon.lua`
|
||||
|
||||
Then switch the section selector to **MIDI Editor** and load the remaining
|
||||
`MidiGrid_*.lua` files the same way (everything except `midigrid_lib.lua`
|
||||
and `test_lib.lua`, which are not actions). The section matters: an action
|
||||
loaded into the wrong section will not be offered for the keys you want.
|
||||
|
||||
2. **Bind the keys.** Still in the action list, select an action, click
|
||||
**Add…** under Shortcuts, and press the key combination. Use the
|
||||
[key table](#keys) below for the intended layout; you can of course choose
|
||||
your own. Only `Alt+Shift+G` needs to be in the Main section — everything
|
||||
else belongs in MIDI Editor.
|
||||
|
||||
3. **Say yes when REAPER warns about a key that is already bound.** Grid mode
|
||||
deliberately takes over `Left`, `Right`, `Up`, `Down` and `Enter` in the
|
||||
MIDI editor; each of those forwards to its previous behaviour when grid
|
||||
mode is off, so nothing is lost.
|
||||
|
||||
You do not need to bind everything. The minimum useful set is
|
||||
`Alt+Shift+G` (open), `Alt+G` (toggle), the four arrows, and `Enter`.
|
||||
`MidiGrid_Daemon.lua` needs to be **registered** as an action but never needs
|
||||
a key — it auto-starts.
|
||||
|
||||
### Why not "Import key map"?
|
||||
|
||||
@@ -52,10 +126,10 @@ action list but do nothing.
|
||||
|
||||
The cause is that a `KEY` line must reference the *named command* — the `SCR`
|
||||
id with a **leading underscore** (`_RSmidigrid_open`), not the bare id
|
||||
(`RSmidigrid_open`). `install.ps1` writes the underscored form directly.
|
||||
(`RSmidigrid_open`). Both installers write the underscored form directly.
|
||||
|
||||
If you would rather not run a script, you can bind the ten `MIDI Grid:`
|
||||
actions by hand in Actions → Show action list. That always works.
|
||||
If you would rather not run a script, see [Manual installation](#manual-installation)
|
||||
above. Binding by hand in the action list always works.
|
||||
|
||||
## Keys
|
||||
|
||||
|
||||
Reference in New Issue
Block a user