Demo Apps
Harucom ships with a few demo apps for trying out its features. Type the name of an app at the IRB prompt to run it.
irb> p5_demo
Every demo is a Ruby script in /app. You can read the source with cat,
which makes them a good starting point for your own programs.
irb> cat /app/p5_demo.rb
Contents
Graphics
p5_demo
Walks through the P5 drawing library step by step: background, fill, stroke, shapes, text, and coordinate transforms.
Press any key to move to the next step. Esc or Ctrl-C quits.
p5_game_demo
A small game built from P5 graphics and keyboard input. Move with the arrow keys and collect stars to score points.
| Key | Action |
|---|---|
| → / ↑ / ← / ↓ | Move |
| Esc or Ctrl-C | Quit |
text_demo
Displays Japanese text in text mode: hiragana, katakana, kanji, colored text, bold text, and scrolling, one step at a time.
Press any key to move to the next step.
Sound
audio_demo
Turns the USB keyboard into an instrument. The screen mirrors the keyboard layout and lights up the keys you hold. The upper rows are the piano keys and the bottom row is the drum pads.
| Keys | Sound |
|---|---|
| A S D F G H J K L ; | White keys |
| W E T Y U O P | Black keys |
| Z X C V B N M , | Drums (kick, snare, hihat, and so on) |
Up to three note keys sound at once, so you can play chords.
| Key | Action |
|---|---|
| 1 – 4 | Change the waveform (sine, square, triangle, sawtooth) |
| ↑ / ↓ | Octave up / down |
| ← / → | Transpose |
| Esc | Quit |
See Audio for how to make sound from your own programs.
Buttons
pad_demo
Shows the state of the eight buttons on the Harucom Board. A pressed button lights up in red, and the raw ADC value is displayed alongside.
Esc or Ctrl-C quits.
See Board::Pad for reading the buttons from a program.
Lighting
These demos need a DMX fixture connected. See the DMX module for wiring.
dmx_demo
A lighting desk that drives DMX channels through a bank of faders.
Fixture definitions placed in /data/dmx/fixtures give the faders names.
| Key | Action |
|---|---|
| ← / → | Select a fader |
| ↑ / ↓ | Raise / lower the value (hold Shift for steps of 1) |
| PageUp / PageDown | Change the value by 16 |
| Home / End | Maximum / minimum |
| a | Change the base address |
| c | Change the channel of the selected fader |
| r | Change the value range |
| Ctrl-O | Load a fixture definition |
| b | Blackout |
| q / Esc / Ctrl-C | Blackout and quit |
johakyu_demo
A demo of Johakyu, which drives sound and light from one pattern. Five presets are provided, and switching between them lands at the start of the next cycle.
| Key | Action |
|---|---|
| 1 – 5 | Switch presets |
| - / = | Tempo down / up |
| [ / ] | Trim the timing between sound and light |
| q / Esc | Quit |