1# Clover Control
2
3This is a set of tools to let additional hardware devices integrate with
4creative applications on a Mac device. Additionally, this repo contains a lot of
5my own tools and scripts I use in the Music/Video creative processes.
6
7In addition to the primary keybinding system and personal software
8configurations, this project can be used as a library to use the control
9primitives directly (either to build your own hardware integrations, or to
10control the software). This can be done by installing this repo as a `pnpm` git
11dependency in your project.
12
13**NOTE**: These tools only work on macOS. I don't have interest in maintaining
14other configurations.
15
16## Hardware
17
18### DaVinci Resolve Speed Editor
19
20A $200 dual-hardware system.
21
22### DaVinci Resolve Speed Editor
23
24A $300 bundle containing Fusion Studio and the control surface, it's a great
25deal. There is a large, high resolution knob, as well as many keys with some
26having lights. This repo includes an SDK to reprogram it to be useful in any
27program. **Note**: It is unused as of 2026-06-24.
28
29![DaVinci Resolve Speed Editor](./docs/speed-editor.jpg)
30
31## Software
32
33TODO:
34
35- Fusion
36- Blender?
37- Krita?
38- The Finder
39- QuickTime player
40
41### macOS (`Mac.ts`)
42
43Bind to the Mac desktop interface.
44
45```ts
46const mac = await Mac.open();
47
48mac.on("app-change", (bundle) => {
49 console.info("Current App: " + bundle);
50});
51```
52
53### REAPER
54
55With the help of an OSC extension, REAPER can be controlled with TypeScript.
56
57```ts
58import { Reaper } from "@clo/clover-control/Reaper";
59
60const reaper = new Reaper();
61reaper.on("transport", (transport) => {
62 console.info(
63 transport.recording
64 ? "You are recording"
65 : transport.playing
66 ? "Playing"
67 : "Stopped",
68 );
69});
70```
71
72Setup:
73
74- Start up Clover Control / `new Reaper()`
75- Navigate to REAPER Settings (`Cmd+,`)
76- Click `Control/OSC/web` on the left side panel
77- Press `Add`
78 - Control surface mode: `OSC (Open Sound Control)`
79 - Device name: `Clover Automation`
80 - Pattern config: `CloverAutomation`
81 - Mode: `Configure device IP+local port`
82 - Device port: `58001`
83 - Device IP: `127.0.0.1`
84 - Local listen port: `58000`
85 - Local IP: (default)
86 - Allow binding messages to REAPER actions and FX learn
87
88## Config Format
89
90The main entrypoint loads config files from `./config`, which each apply to one
91application. In this example, it configures Reaper to integrate with the Speed
92Editor. The provided instance of hardware devices are wrapper objects that apply
93the binds only when the program is active. This way, there aren't situations
94with multiple readers conflicting.
95
96```ts
97import * as config from "#config";
98import { Reaper } from "@clo/clover-control/Reaper";
99
100export default config.forApp("com.cockos.reaper", ({ speededitor, mac }) => {
101 const reaper = new Reaper();
102
103 // Sync state to LEDs
104 reaper.on("transport", (transport) => {
105 speededitor.leds.audioOnly = transport.recording;
106 });
107
108 // Keyboard Actions
109 speededitor.onPress("stopPlay", () => {
110 reaper.runAction("transport-play-stop");
111 });
112 speededitor.onPress("audioOnly", () => {
113 reaper.runAction("transport-record");
114 });
115});
116```