Example 28 · Take it out of the browser範例 28 · 輸出與留存

DMX lightsDMX 燈光

One world draws a stage and drives a lighting rig from the same params; a monitor shows what the lights get, no hardware needed.同一個世界畫出舞台,也用同一組參數推一套燈。監看器顯示燈收到什麼,不需要任何硬體。

Try these three things試試這三件事

  1. Tick “keyboard” and play chords on A to L: consonant ones turn the pars warm, dissonant ones cold, and more notes bring in the rainbow.
  2. Start the drum machine and the kick lifts the pars; press Space and the four cues play by themselves: Warm, Sweep, Rainbow, Walk.
  3. Point at a cell of the monitor to read its address and value, then press Blackout: every dimmer goes to 0 and the heads stay where they point.
  1. 勾選 keyboard,用 A 到 L 彈和弦:和諧的讓 par 變暖,不和諧的變冷,音越多彩虹越明顯。
  2. 打開鼓機,大鼓會把 par 推亮。按空白鍵,四個 cue 自己播:Warm、Sweep、Rainbow、Walk。
  3. 滑鼠指著監看器的一格,讀它的位址和數值,再按 Blackout:每個 dimmer 歸零,搖頭燈停在原本指的方向。

No hardware needed. On-screen piano · QWERTY keys · Drum machine · On-screen controller.不需要硬體。螢幕鋼琴、電腦鍵盤、鼓機、螢幕上的控制器。

Read these lines讀這幾行

  • main.js:26–29 The rig: eight RGBW pars and two moving heads, patched on universe 1.燈:八台 RGBW par 和兩台搖頭燈,patch 在 universe 1。
  • main.js:41–45 The engine's control points become params, so anything that drives a param drives the lights.引擎的控制點變成參數,所以任何能推參數的東西都能推燈。
  • main.js:71–75 Each frame: params in, every light rendered, through the flash guard (no light flashes more than 3 times a second), only the changed channels out, the monitor updated with what left.每一格:參數進來,算出每台燈,經過頻閃保護(每台燈每秒最多閃 3 次),只送出有變的通道,再用實際送出的內容更新監看器。
  • main.js:128–145 Sound, chords and any MIDI controller reach the lights through the mapping layer.聲音、和弦和任何 MIDI 控制器,都經過映射層推到燈。

Next step下一步

In the docs: DMX lighting · Watch it without hardware文件裡:DMX 燈光、沒有硬體時怎麼看

Next on this route: 29 Projector output →這條路線的下一個:29 投影輸出 → All examples所有範例