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

MIDI controllersMIDI 控制器

On-screen controllers that move with the real ones you plug in.螢幕上的控制器,會跟著你接上的實體控制器一起動。

Try these three things試試這三件事

  1. Play the on-screen MiniLab 3 with the mouse: knobs, pads, keys and strips all move the work.
  2. Pick another device (LPD8, Launchpad, nanoKONTROL2): the same params follow, because every device has its own routes table into them.
  3. Plug in a real controller in Chrome or Edge: the one on screen moves with your hands.
  1. 用滑鼠彈螢幕上的 MiniLab 3:旋鈕、打擊墊、琴鍵和觸控條都會帶動作品。
  2. 換成另一台(LPD8、Launchpad、nanoKONTROL2):同樣的參數照樣跟著動,因為每台都有自己的路由表接到它們。
  3. 在 Chrome 或 Edge 接上實體控制器:螢幕上那台會跟著你的手一起動。

Needs: MIDI controller.需要:MIDI 控制器。 No hardware? Use On-screen controller.沒有硬體?用螢幕上的控制器。

Read these lines讀這幾行

  • main.js:93–98 One routes table per device, all into the same params.每台一張路由表,全都接到同一組參數。
  • main.js:100–107 modules.midi.controllers puts the controller on screen; modules.remote makes the phone one too.modules.midi.controllers 把控制器放上螢幕;modules.remote 讓手機也能當控制器。

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文件裡: MIDI controllers & embeddingMIDI 控制器與嵌入

Next: 02 Chord garden →下一個:02 和弦花園 → All examples所有範例