Equation Transfer Architecture — 座標ストリームではなく、数式そのものを転送する。AIが生成した数学関数をMA3のLuaエンジンが自律的に評価し、照明を直接制御する。さらに、照明制御のためのシェーダー言語 .lxs フォーマットを策定。数式を人間可読なテキストで記述し、AST JSONにコンパイルして任意のランタイムで実行する。
Equation Transfer Architecture — Transfer equations, not coordinates. MA3's Lua engine autonomously evaluates AI-generated mathematical functions and directly controls fixtures. Additionally, we created .lxs — a shader-like language for programmable lighting control. Write human-readable expressions, compile to AST JSON, run on any runtime.
v3 · Equation Transfer Architecture · .lxs Format · 6 Plugins · Fully ImplementedSPOTLIGHT AIがJavaScriptで数式を60fps評価し、32台×xyz+RGB=192 floatを毎フレームOSC/PSNで送信。MA3は座標を受信してFollowするだけ。
SPOTLIGHT AI evaluates equations in JavaScript at 60fps, streaming 192 floats per frame via OSC/PSN. MA3 simply follows received coordinates.
常時ストリーム。ネットワーク断 = 照明停止。
Constant stream. Network failure = lighting stops.
SPOTLIGHT AIが数式そのもの(AST JSON, 数KB)を1回だけ送信。MA3のLuaエンジンが内部で数式を評価し、フィクスチャを直接制御。
SPOTLIGHT AI transmits the equation itself (AST JSON, a few KB) just once. MA3's Lua engine evaluates internally and controls fixtures directly.
単発転送。以後MA3が自律動作。
One-shot transfer. MA3 operates autonomously thereafter.
照明制御データには2つの表現がある。「毎フレームの座標値テーブル」と「座標値を生成する関数(数式)」。テーブルは有限だが、関数は無限を記述できる。これが数式転送の本質的な利点。
Lighting control data has two representations: "a table of per-frame coordinate values" and "a function (equation) that generates those coordinates." Tables are finite. Functions describe infinity. This is the essential advantage.
100バイトの数式が、10分間のアニメーション(36,000フレーム × 192 float = 27MB のテーブル)と等価な情報を持つ。 しかも数式は無限の時間軸に対して連続的であり、テーブルは有限の時間範囲でしか意味を持たない。
A 100-byte equation carries the same information as a 10-minute animation table (36,000 frames × 192 floats = 27MB). Moreover, the equation is continuous over infinite time, while the table only has meaning within a finite range.
三角関数、ノイズ関数、剰余演算のわずかな組み合わせで、人間が直感的に「美しい」と感じる動きのほとんどを記述できる。以下は、ごく短い数式がどれほど多彩なパターンを生むかの例。
With just a handful of trigonometric functions, noise, and modular arithmetic, nearly every movement humans intuitively find beautiful can be described. These examples show how short equations produce remarkably diverse patterns.
| 構成要素Building Block | 生成されるパターンGenerated Patterns | 組み合わせCombos |
|---|---|---|
| sin / cos | 円運動、楕円、リサージュ、波、脈動Circular, elliptical, Lissajous, wave, pulsation | ∞ |
| sin + sin | ビート、干渉縞、モアレ、うねりBeats, interference, moiré, undulation | ∞ |
| sin × t | 成長・減衰、爆発、収束、フェードインGrowth/decay, explosion, convergence, fade | ∞ |
| i × offset | ウェーブ、追従、群れ、カスケードWave, chase, flock, cascade | ∞ |
| floor / mod | グリッド、ステップ、デジタル分割Grid, step, digital subdivision | ∞ |
| noise() | 有機的揺らぎ、風、水面、炎Organic fluctuation, wind, water, flame | ∞ |
| atan2 / polar | 渦巻き、回転場、トルネードVortex, rotation field, tornado | ∞ |
| pow / sqrt | 非線形加速、イージング、重力感Non-linear acceleration, easing, gravity | ∞ |
これらの要素は自由に入れ子にできる。sin(noise(t))は「揺らぎのある周期」を、noise(sin(t))は「周期的に変調されるランダム」を生む。8つの構成要素の組み合わせは事実上無限のバリエーションを持つ。そしてそのすべてが数百バイトのJSONに収まる。
These elements nest freely. sin(noise(t)) produces "oscillation with organic variation." noise(sin(t)) creates "periodically modulated randomness." Eight building blocks yield effectively infinite variations — all fitting in a few hundred bytes of JSON.
v2は時間に比例してデータが増大する。v3は時間に依存しない。 数式は「10秒間の動き」も「10時間の動き」も同じバイト数。テーブルは時間が倍になればデータも倍。
v2 data grows linearly with time. v3 is time-independent. An equation describes "10 seconds" and "10 hours" in the same bytes. Tables double when duration doubles.
10種類のパターンをリアルタイムアニメーションで確認。各パラメータをスライダーで操作し、数百バイトの数式がどれほど多彩な動きを生み出すかを体感できます。
Explore 10 patterns with real-time animation. Drag sliders to manipulate parameters and see how a few hundred bytes of math produce infinite variations.
核心の違い: v2ではデータパイプ(太い矢印、60Hz)が中央にあった。v3では「知識の転送」(細い矢印、1回)に変わった。MA3は受信者ではなく、自律的な計算エンジンになる。
The core difference: In v2, a thick 60Hz data pipe sat at the center. In v3, it becomes "knowledge transfer" (thin arrow, once). MA3 shifts from passive receiver to autonomous computation engine.
// JavaScript sin(t * 2.0 + i * 0.196) * 3.0 // AST JSON ["*", ["sin", ["+", ["*", "t", 2.0], ["*", "i", 0.196]]], 3.0]
{
"version": 1, "name": "Spiral Galaxy", "fixtures": 32,
"equations": {
"x": ["*", ["sin", ["+", ["*","t",2.0], ["*","i",0.196]]], 3.0],
"y": ["*", ["cos", ["+", ["*","t",1.5], ["*","i",0.392]]], 2.0],
"z": ["+", ["*", ["sin",["*","t",0.8]], ["cos",["*","i",0.785]]], 1.5],
"red": ["+", ["*", ["sin",["+","t",["*","i",0.1]]], 0.5], 0.5],
"green": ["+", ["*", ["cos",["+",["*","t",0.7],["*","i",0.2]]], 0.5], 0.5],
"blue": ["+", ["*", ["sin",["+",["*","t",1.3],["*","i",0.3]]], 0.5], 0.5]
},
"loop": { "start":0, "end":20, "repeat":-1 },
"defaults": { "speed":1.0, "scale":1.0 }
}
| 型Type | 形式Format | 例Example | |
|---|---|---|---|
| 数値 | Number | number | 3.14 |
| 変数 | Variable | "string" | "t", "i", "n", "pi" |
| 二項演算 | Binary Op | ["op", L, R] | ["+", "t", 1.0] |
| 単項関数 | Unary Fn | ["fn", arg] | ["sin", "t"] |
| 二項関数 | Binary Fn | ["fn", a, b] | ["pow", "t", 2] |
変数: Variables: t (経過秒)(elapsed sec), i (正規化 0-1)(normalized 0-1), n (1-32), pi (π)
sin · cos · tan · asin · acos · atan2 · abs · sqrt · pow · min · max · floor · ceil · fmod · clamp · noise
.lxs — Lighting Expression Shader
AST JSONの上位レイヤーとして、人間が直接読み書きできるシェーダー言語 .lxs を策定した。GPUのフラグメントシェーダーが「各ピクセルに対して実行される関数」であるように、.lxs は「各フィクスチャに対して実行される関数」。GLSLを書いたことがあれば5分で書き始められる構文で、AST JSONにコンパイルされ、MA3 Lua、Node.js、ブラウザなど任意のランタイムで実行される。
.lxs — Lighting Expression Shader
We designed .lxs as a human-readable shader language on top of AST JSON. Just as a GPU fragment shader is "a function executed per pixel," .lxs is "a function executed per fixture." Anyone who has written GLSL can start writing .lxs in 5 minutes. It compiles to AST JSON and runs on any runtime — MA3 Lua, Node.js, or browser.
言語構文、組み込み関数、マルチグループ・パターンルーティング、ライブデモ、設計哲学など .lxs の全仕様を詳細に解説。
Complete specification including language syntax, built-in functions, multi-group pattern routing, live demo, and design philosophy.
local ops = { ["+"]=function(a,b) return a+b end, ["-"]=function(a,b) return a-b end, ["*"]=function(a,b) return a*b end, ["/"]=function(a,b) return b~=0 and a/b or 0 end, } local fns = { sin=math.sin, cos=math.cos, abs=math.abs, sqrt=math.sqrt, pow=math.pow, noise=noise1d, ... } function eval(node) if type(node)=="number" then return node end if type(node)=="string" then return env[node] or 0 end local h = node[1] if ops[h] then return ops[h](eval(node[2]),eval(node[3])) end if fns[h] then local a=eval(node[2]) if node[3] then return fns[h](a,eval(node[3])) end return fns[h](a) end return 0 end
| 項目Metric | 値Value | |
|---|---|---|
| AST平均深度 | Avg AST depth | 5–8 nodes |
| 1フレーム合計 | Per frame total | 32×6×8 = 1,536 calls |
| 20Hz (50ms) | ✓ | |
| 30Hz (33ms) | ✓ (深度 ≤ 12) | ✓ (depth ≤ 12) |
数式エンジンのコア。ASTインタプリタ+Timer評価ループ。GlobalVarsから数式を読み取り、32台×6chを20-30Hzで評価、SetFixtureValues()で直接制御。
Core engine. AST interpreter + Timer loop. Reads equations from GlobalVars, evaluates 32×6ch at 20-30Hz, controls via SetFixtureValues().
SPOTLIGHT AIからのAST JSON受信・パース・ロード。JSONパーサー内蔵。ASTバリデーション(未知関数・深度上限検出)。
Receives AST JSON from SPOTLIGHT AI. Built-in JSON parser. AST validation (unknown functions, depth limits).
Executor 201:Speed, 202:Scale, 203:AuxをGlobalVarsに書き込み。物理フェーダーでAIパターンを直感的に操作。
Maps Executor faders to GlobalVars. Physical faders for intuitive AI pattern control.
60プリセットのAST JSONをGlobalVarsに格納。SPOTLIGHT AI非接続でも全プリセット再生可能。
Stores 60 preset ASTs in GlobalVars. All presets playable without SPOTLIGHT AI.
数式評価結果から補助機材を自動連動。z平均→フォグ、velocity→ストロボ、彩度→環境照明。
Auto-links auxiliaries from equation results. z-avg→fog, velocity→strobe, saturation→ambient.
MA3のCue状態・Master値をSPOTLIGHT AIに送信。AIが文脈に即した数式を生成。
Sends MA3 state to SPOTLIGHT AI. AI generates context-aware equations.
| パスPath | Protocol | 頻度Rate | 内容Content | Size |
|---|---|---|---|---|
| AI → MA3 | OSC | 1× / switch | AST JSON | 2–5 KB |
| AI → MA3 | OSC | on demand | speed, scale | ~20 B |
| MA3 → AI | OSC | 5–10 Hz | Cue, MasterCue, Master | ~200 B |
| MA3 internal | Lua | 20–30 Hz | eval → fixtures | — |
MA3が自律的に数式を評価。ネットワーク障害に堅牢。レイテンシゼロ。ショーファイルに数式が保存。
MA3 autonomously evaluates. Robust to network failure. Zero latency. Saved in show file.
AI →[AST 1×]→ MA3 Lua → Fixtures
超複雑な数式やLuaエンジン負荷問題時。従来のPSN/OSC 60Hzストリーム。
For ultra-complex equations or Lua load issues. Legacy 60Hz stream.
AI →[60Hz]→ MA3 Follow
位置は数式転送、色はArtNetで直接制御。
Position via equation, color via ArtNet direct.
AST(pos) + ArtNet(RGB)
MA3 Lua上でAST数式を20Hzで評価、32台のフィクスチャが数式に従って動作。ASTインタプリタ、Value Noise、JSONパーサー、Timer駆動の全コンポーネントが稼働。
AST equations evaluated at 20Hz in MA3 Lua, 32 fixtures moving per math functions. AST interpreter, value noise, JSON parser, and timer-driven loop all operational.
プリセット切替→数式転送→フェーダー操作→60プリセットMA3保存。完全な自律動作を達成。SPOTLIGHT AI非接続でも全プリセット再生可能。
Preset switch→transfer→fader control→60 presets stored. Full autonomous operation achieved. All presets playable without SPOTLIGHT AI connection.
MA3オペレータがコンソールのみで全機能を操作。SPOTLIGHT AI非接続でも60プリセット再生可能。.lxsフォーマット策定により、照明パターンのポータブルな記述・共有が実現。
Full console-only operation achieved. 60 presets playable without SPOTLIGHT AI. The .lxs format specification enables portable, shareable lighting pattern descriptions.
201: Speed (0.1x~3.0x) 301: Preset ▲
202: Scale (0.1x~5.0x) 302: Preset ▼
203: Aux (0~1.0) 303: Engine Start/Stop
304: Shuffle
照明制御のためのシェーダー言語。言語構文、組み込み関数、マルチグループ対応、ライブデモ、設計哲学、MA3実装提案を収録。
A shader-like language for programmable lighting. Includes syntax, built-in functions, multi-group routing, live demo, design philosophy, and MA3 implementation proposal.
.lxs Spec ↗10種類のパターンをリアルタイムアニメーションで確認。各パラメータをスライダーで操作し、数式の威力を体感。
Explore 10 patterns with real-time animation. Drag sliders to manipulate parameters and experience the power of equations.
Playground ↗