SPEC / HARDWARE · 하드웨어 컨트롤 키트
딸깍.Controls that click.
Knobs with detents, a rocker, a notched fader, keys with travel, a jog wheel and a step sequencer. Every click you hear is synthesized on the spot, no audio files. One ES module, zero dependencies.
돌리면 걸리고, 누르면 들어가고, 소리가 납니다. 마우스, 휠, 키보드, 터치 모두 됩니다.
SEQ-16
KNOB
POWER
MUTE
FADER
DATE
CONFIRM
Use it 쓰는 법
Copy detent.js and detent.css. No build step.
import { knob, toggle, fader, keys, jogDate, holdButton, sequencer, sound } from './detent.js';
const k = knob(el, { steps: 12, value: 4, label: 'PITCH', ko: '음높이' });
k.on('input', (v) => console.log(v)); // fires once per detent
toggle(el2, { label: 'POWER' }).on('change', (on) => on ? seq.play() : seq.stop());
const seq = sequencer(el3, { bpm: 120 });
button.onclick = () => sound.enable(); // browsers need a click before audio
| knob | drag up/right, wheel, arrow keys, double-click resets. Sticky detents, LED arc. |
|---|---|
| toggle | click or throw it. Springs past the middle, clacks, LED. |
| fader | notched every step, magnetic centre detent. |
| keys | real travel (spring), latch LEDs, press and release sounds. |
| jogDate | tap a field, turn the wheel. Ticks per day / month / year. |
| holdButton | hold to confirm: ratchet clicks speed up, then it crunches. |
| sequencer | 16 steps × 4 voices, paint by dragging, schedules sound ahead of the frame. |
How it works 원리
- Sticky detents. Your drag sets a raw position r. What you see is
n + ½·sign(f)·|f|³with n the nearest detent and f the distance to it, so the cap clings to each step and snaps over to the next. A click plays once each time n changes. - One clock, damped springs. Every moving part is a spring stepped by one shared clock. The page can also drive that clock by hand, which is how the videos are made from the real page.
- Synthesized sound. Each click is a few milliseconds of filtered noise plus a short pitched body: a knob tick, a switch clack, a key thock. The drums are the same idea, longer.
- Same sound in the video. In film mode every sound event is logged on the virtual clock and replayed into an offline audio context, so the soundtrack lines up with the frames.