@m4l-jweb/bridge 0.9.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +52 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # @m4l-jweb/bridge
2
+
3
+ The browser half of a device. Your React UI runs inside `[jweb~]`, Max's embedded Chromium; this is how it talks to the Max patcher around it - messages out, messages in, MIDI, clip I/O, and files.
4
+
5
+ Part of **[m4l-jweb](https://github.com/alienmind/m4l-jweb)** - build Ableton Live devices (`.amxd`) from a TypeScript repo: React UI, LiveAPI glue, CI builds, no Max editor.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add @m4l-jweb/bridge
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { bindInlet, outlet, onNote, onNoteOff, sendNote, uiReady } from "@m4l-jweb/bridge";
17
+
18
+ // Tell the wrapper the page is up, and ask for current state.
19
+ uiReady();
20
+
21
+ // Incoming MIDI (needs the `midiin` chain). Both binders share one subscription.
22
+ onNote((pitch, velocity) => voiceOn(pitch, velocity));
23
+ onNoteOff((pitch) => voiceOff(pitch));
24
+
25
+ // Outgoing MIDI (needs the `midiout` chain). Max applies the delay, not the browser,
26
+ // so note timing does not depend on a Chromium timer.
27
+ sendNote({ pitch: 60, velocity: 100, durationMs: 250, delayMs: 80 });
28
+
29
+ // Anything else you route yourself.
30
+ bindInlet("tick", (playing, beats) => setTransport(Boolean(playing), Number(beats)));
31
+ outlet("my_selector", 1, "two");
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ - **Audio does not go through here.** Under `[jweb~]` the page's Web Audio output is carried on the object's signal outlets, straight into the track. The bridge is a control plane; sound never crosses it as messages.
37
+ - `fetchToFile()` and `saveToFile()` move bytes between the page and disk via Max's `[maxurl]`, so large files never travel through the message bridge either.
38
+ - `tapMessages()` observes every message in both directions - the whole contract of a device, live.
39
+
40
+ ## Requirements
41
+
42
+ Ableton Live 12 with Max 9. Devices are built on `[jweb~]`, the browser view with signal outlets; older hosts are unverified.
43
+
44
+ ## Links
45
+
46
+ - [Repository and full README](https://github.com/alienmind/m4l-jweb)
47
+ - [Architecture](https://github.com/alienmind/m4l-jweb/blob/main/doc/ARCHITECTURE.md)
48
+ - [What Max actually does: the measured facts](https://github.com/alienmind/m4l-jweb/blob/main/doc/MAX-FACTS.md)
49
+
50
+ ## License
51
+
52
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l-jweb/bridge",
3
- "version": "0.9.9",
3
+ "version": "1.0.0",
4
4
  "description": "m4l-jweb: the browser-side bridge connecting a device's web UI to Max for Live.",
5
5
  "type": "module",
6
6
  "license": "MIT",