Example 08 · Anything can be an instrument範例 08 · 什麼都能當樂器

Remote surface遠端控制面板

The phone is the instrument panel; the surface grows from the world's params.手機就是樂器面板。世界只宣告參數,手機上的控制面板依參數自動長出來。

Try these three things試試這三件事

  1. Run node serve.js on your network, then type the phone URL shown at the top left into a phone on the same wifi.
  2. On the phone's 控制台 tab move a fader: the matching param moves here.
  3. Tilt the phone to change Drift, knock on it for a Burst. Without a phone, the on-screen piano plays notes.
  1. 在你的網路裡跑 node serve.js,把左上角的手機網址輸入同一個 wifi 裡的手機。
  2. 在手機的「控制台」分頁推動推桿:這裡對應的參數會跟著動。
  3. 傾斜手機改變 Drift,敲一下手機放出 Burst。沒有手機時,螢幕鋼琴照樣彈音符。

Needs: Phone or iPad.需要:手機或 iPad。 No hardware? Use On-screen piano.沒有硬體?用螢幕鋼琴。

Read these lines讀這幾行

  • main.js:25–34 The world declares params. That is all the phone needs.世界宣告參數。手機需要的就只有這些。
  • main.js:104–105 Phone sensors reach params through routes written once: phone/any is the latest phone.手機感測器經由寫一次的路由接到參數:phone/any 指最近連上的那支手機。

Take this input into your own p5 sketch: one line.把這個輸入帶進你自己的 p5 草圖:一行。 Example 15 · Docs: p5.js in one line範例 15 · 文件:p5.js 一行接上

In the docs文件裡: autoSurfaceautoSurface

Next: 23 p5 with Strudel →下一個:23 p5 跟 Strudel 一起 → All examples所有範例