~/talk

Play them off, Keyboard App: building a virtual keyboard in JavaScript

Talkat Wey Wey Web 2022 · 2022-12-15..12-16· [javascript]
slides:none on file

A working virtual keyboard implemented in plain JavaScript uses the Web Audio API to create oscillators and gain nodes (triangle waveform) and the formula A4 = 440Hz × 2^(n/12) to compute exact note frequencies; major scales follow the interval pattern 2‑2‑1‑2‑2‑2‑1 and scales play by changing one oscillator’s frequency with 0.5s timeouts while chords spawn one oscillator per note and stop after 2s. It also hooks a MIDI controller via the Web MIDI API, mapping MIDI note numbers (subtract 48) and handling note‑on 144/note‑off 128; audio context initializes on user gesture and the app demos successfully.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 2:49Musical theory basics
  3. 7:29Web Audio API overview
  4. 13:26Building the piano UI
  5. 17:16Playing scales and chords
  6. 19:23Adding MIDI controller support
  7. 24:25Demo and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.