{"_id":"@allen-heath-sq-tools/api","_rev":"2-e218e7e5eb030db13fcd2ee0ba0c10d9","name":"@allen-heath-sq-tools/api","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@allen-heath-sq-tools/api","version":"0.1.0","license":"MIT","_id":"@allen-heath-sq-tools/api@0.1.0","maintainers":[{"name":"hrueger","email":"hannesrueger@gmx.de"}],"dist":{"shasum":"0645ada5cbf22dd22f676a2c7cbd152b3be4754c","tarball":"https://registry.npmjs.org/@allen-heath-sq-tools/api/-/api-0.1.0.tgz","fileCount":5,"integrity":"sha512-9iiORyQK2+8S8IGNAx2hHbZz8IKffRQk4zow7pHNvf4us8lK7hS4SEFcYOSiGYfiDHBBQq4HcOZKDY021GH3cg==","signatures":[{"sig":"MEUCIQDYylZ518d5zmmSWaFZY4FBhWI3h+L/pfpAFnw+B3QFpgIgVrw5RrT4w/3TfBWV/YWt/zWK+Gos77LX1kKtNfIsbEw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":209317},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d81af02397acb6f6644c550e6e2ee7cd32691c2b","scripts":{"build":"tsup","typecheck":"tsc --noEmit","build:watch":"tsup --watch"},"_npmUser":{"name":"hrueger","email":"hannesrueger@gmx.de"},"_npmVersion":"11.6.2","description":"Allen & Heath SQ console API for Node.js","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^22.19.20"},"_npmOperationalInternal":{"tmp":"tmp/api_0.1.0_1781097380247_0.5917490779319725","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@allen-heath-sq-tools/api","version":"0.1.1","description":"Allen & Heath SQ console API for Node.js","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsup","build:watch":"tsup --watch","typecheck":"tsc --noEmit"},"devDependencies":{"@types/node":"^22.19.20","tsup":"^8.0.0","typescript":"^5.5.0"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/hrueger/allen-heath-sq-tools.git"},"publishConfig":{"access":"public","provenance":true},"gitHead":"fa4571d095aa6d5cd6bb338c99422ab00ad557ba","_id":"@allen-heath-sq-tools/api@0.1.1","bugs":{"url":"https://github.com/hrueger/allen-heath-sq-tools/issues"},"homepage":"https://github.com/hrueger/allen-heath-sq-tools#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-/pHiW7Cl06AZF0X9RHJoXIK++ooBjgdHZ11npHihypF8wJGmCa/DvewhrxvayM63QIpNNBSk2lHMpMUjLUMZLg==","shasum":"e84645c6b85526be2919e04c45f873ad85e66a21","tarball":"https://registry.npmjs.org/@allen-heath-sq-tools/api/-/api-0.1.1.tgz","fileCount":5,"unpackedSize":210295,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@allen-heath-sq-tools%2fapi@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDLsZACUk8IyszTBCe1S5GADcr7+PRwhD4cwLqyBbbliAiEA519STzbM7FZ6yxmZ8xYjA2RBtBgSlC3ANxevBHZIibE="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5947b16e-1a6f-40c9-bc33-883e51a49c5e"}},"directories":{},"maintainers":[{"name":"hrueger","email":"hannesrueger@gmx.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/api_0.1.1_1781101601021_0.9392099144460231"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T13:16:19.996Z","modified":"2026-06-10T14:26:41.485Z","0.1.0":"2026-06-10T13:16:20.375Z","0.1.1":"2026-06-10T14:26:41.154Z"},"license":"MIT","description":"Allen & Heath SQ console API for Node.js","maintainers":[{"name":"hrueger","email":"hannesrueger@gmx.de"}],"readme":"# @allen-heath-sq-tools/api\n\n[![npm](https://img.shields.io/npm/v/@allen-heath-sq-tools/api)](https://www.npmjs.com/package/@allen-heath-sq-tools/api)\n[![CI](https://github.com/hrueger/allen-heath-sq-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/hrueger/allen-heath-sq-tools/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](../../LICENSE)\n\nTypeScript/Node.js API for Allen & Heath SQ digital mixing consoles. Controls the mixer over the network using the same binary protocol as MixPad.\n\n## Install\n\n```sh\nnpm install @allen-heath-sq-tools/api\n```\n\n## Quick start\n\n```ts\nimport { SQMixer } from \"@allen-heath-sq-tools/api\";\n\nconst sq = new SQMixer({ host: \"10.22.1.11\" });\nawait sq.connect();\n\nsq.inputs[0].setLevel(0.8);   // fader to 0 dB\nsq.inputs[0].setMute(false);\nsq.buses[0].setLevel(0.6);\nsq.mainLR.setMute(false);\n\nsq.disconnect();\n```\n\n## Connecting\n\n```ts\nconst sq = new SQMixer({ host: \"10.22.1.11\" });\n\n// connect() resolves with firmware version info\nconst { fwA, fwB, model } = await sq.connect();\n\n// Auto-discover the mixer on the local network instead of specifying host\nconst sq = new SQMixer({ host: \"auto\" });\nawait sq.connect(); // broadcasts and connects to the first SQ found\n```\n\n## Channel access\n\n| Property | Type | Contents |\n|---|---|---|\n| `sq.inputs` | `InputChannel[48]` | Input channels 1–48 |\n| `sq.stereoInputs` | `StereoInput[3]` | Stereo inputs 1–3 |\n| `sq.fxReturns` | `FxReturn[4]` | FX returns 1–4 |\n| `sq.buses` | `MixBus[12]` | Mix buses 1–12 |\n| `sq.dcas` | `DcaGroup[8]` | DCA groups 1–8 |\n| `sq.mainLR` | `MainLR` | Main LR |\n\nAll channels are zero-indexed: `sq.inputs[0]` = Input 1, `sq.buses[0]` = Bus 1.\n\n## Channel methods\n\nAll setters take human-readable values and handle the wire encoding internally.\n\n**Fader & routing**\n```ts\nch.setLevel(value)          // fader position 0.0–1.0  (use dbToFader/faderToDb to convert)\nch.setMute(on)\nch.setPan(value)            // -1.0 full left … 0 centre … +1.0 full right\nch.setSend(busNumber, value)   // send level to mix bus 1–12, value 0.0–1.0\nch.setSendFx(fxNumber, value)  // send level to FX bus 1–4\nch.setPaflOn(on)            // solo / PAFL\nch.setDirectOut(outNumber | null)  // assign to direct out, or null to clear\nch.setInsertEnabled(on)\n```\n\n**Preamp** *(InputChannel only)*\n```ts\nch.setGain(dB)              // preamp gain\nch.setTrim(dB)              // trim -24 dB … +24 dB\nch.setPadOn(on)\nch.setPhantomOn(on)         // 48V phantom power\nch.setPolarityOn(on)        // polarity flip\nch.setDelayOn(on)\nch.setDelayDuration(ms)\n```\n\n**Name & colour** *(InputChannel only)*\n```ts\nch.setName(name)            // max 6 characters\nch.setColor(r, g, b)        // RGB 0–255\nch.setColorTransparent()\n// or use the ChannelColor enum:\nimport { ChannelColor } from \"@allen-heath-sq-tools/api\";\nch.setColor(...ChannelColor.Red);\n```\n\n**HPF** *(InputChannel only)*\n```ts\nch.setHpfOn(on)\nch.setHpfFreq(hz)           // 20 Hz – 2 kHz\nch.setHpfSlope(dbPerOctave) // 12 | 18 | 24\n```\n\n**Gate** *(InputChannel only)*\n```ts\nch.setGateOn(on)\nch.setGateThreshold(dB)\nch.setGateDepth(dB)\nch.setGateAttack(ms)\nch.setGateRelease(ms)\nch.setGateHold(ms)\n```\n\n**Compressor** *(InputChannel only)*\n```ts\nch.setCompOn(on)\nch.setCompThreshold(dB)\nch.setCompRatio(ratio)      // e.g. 4 for 4:1\nch.setCompGain(dB)\n```\n\n**PEQ** *(InputChannel only)*\n```ts\nch.setPeqOn(on)\n// Four bands: Lf, Lm, Hm, Hf\nch.setPeqLfGain(dB)   ch.setPeqLfFreq(hz)   ch.setPeqLfQ(q)   ch.setPeqLfShape(n)\nch.setPeqLmGain(dB)   ch.setPeqLmFreq(hz)   ch.setPeqLmQ(q)\nch.setPeqHmGain(dB)   ch.setPeqHmFreq(hz)   ch.setPeqHmQ(q)\nch.setPeqHfGain(dB)   ch.setPeqHfFreq(hz)   ch.setPeqHfQ(q)   ch.setPeqHfShape(n)\n```\n\n## Reading state\n\nParameter values are cached after the first update from the mixer:\n\n```ts\nconsole.log(ch.level);       // number | null\nconsole.log(ch.muted);       // boolean | null\nconsole.log(ch.gain);        // dB | null\n```\n\nValues are `null` until the mixer sends the first change for that parameter.\n\n## Events\n\nChannels and the mixer are `EventEmitter`s. Subscribe to be notified of changes — whether triggered by your code, MixPad, or the physical console.\n\n```ts\n// Channel events\nch.on(\"level\",          (value: number) => {})\nch.on(\"mute\",           (on: boolean) => {})\nch.on(\"pan\",            (value: number) => {})\nch.on(\"gain\",           (dB: number) => {})\nch.on(\"send\",           (busNumber: number, value: number) => {})\nch.on(\"gate-on\",        (on: boolean) => {})\nch.on(\"comp-threshold\", (dB: number) => {})\n// ... all setter names have a matching event\n\n// Mixer events\nsq.on(\"connect\",      (info: VersionInfo) => {})\nsq.on(\"disconnect\",   () => {})\nsq.on(\"error\",        (e: Error) => {})\nsq.on(\"mute-group\",   (groupNumber: number, on: boolean) => {})\nsq.on(\"scene-recall\", (sceneNumber: number) => {})\nsq.on(\"scene-delete\", (sceneNumber: number) => {})\nsq.on(\"scene-name\",   (sceneNumber: number, name: string) => {})\nsq.on(\"initialState\", () => {})  // fires once on connect when full state is loaded\n```\n\n## Scenes & mute groups\n\n```ts\nsq.recallScene(sceneNumber)              // 1-based\nsq.storeScene(sceneNumber)\nsq.deleteScene(sceneNumber)\nsq.renameScene(sceneNumber, name)        // max 16 characters\nsq.setSceneCrossfadeMs(sceneNumber, ms)  // 0 = off\n\nsq.sceneNames[0]                         // name of scene 1, or null if empty\n\nsq.setMuteGroupOn(groupNumber, on)       // groupNumber 1–8\n```\n\n## Discovery\n\n```ts\nimport { discover } from \"@allen-heath-sq-tools/api\";\n\nconst mixer = await discover(\"SQ\", 2000); // timeout ms\nconsole.log(mixer.name, mixer.address);\n```\n\n## dB ↔ fader conversion\n\n```ts\nimport { dbToFader, faderToDb } from \"@allen-heath-sq-tools/api\";\n\nch.setLevel(dbToFader(0));    // 0 dB\nconsole.log(faderToDb(ch.level ?? 0));\n```\n\n## Examples\n\nSee the [`examples/`](examples/) folder:\n\n| File | What it shows |\n|---|---|\n| `api-demo.ts` | Basic connect, fader, mute, direct out |\n| `comprehensive-demo.ts` | Full channel strip walkthrough |\n| `sine-wave-demo.ts` | Animated fader sweep |\n| `events.ts` | Subscribing to live parameter changes |\n| `scenes.ts` | Scene recall, store, delete |\n| `rainbow-lcd.ts` | Animated channel colours across 16 inputs |\n| `watch.ts` | Low-level frame monitor (move anything on the console to see it) |\n\nRun any example directly:\n\n```sh\nnpx ts-node examples/api-demo.ts\n```\n\n## Low-level access\n\nThe `Connection` class gives direct access to the raw frame stream for protocol exploration:\n\n```ts\nimport { Connection } from \"@allen-heath-sq-tools/api\";\n\nconst conn = new Connection({ host: \"10.22.1.11\" });\nconn.on(\"dsp\", (frame) => console.log(frame));\nconn.on(\"frame\", (frame) => console.log(frame));\nawait conn.connect();\n```\n","readmeFilename":"README.md","homepage":"https://github.com/hrueger/allen-heath-sq-tools#readme","repository":{"type":"git","url":"git+https://github.com/hrueger/allen-heath-sq-tools.git"},"bugs":{"url":"https://github.com/hrueger/allen-heath-sq-tools/issues"}}