Skip to content

About

Hong Kong Cantonese-English bilingual stroke dynamics via zero-asset OS Canvas2D, WebGL2 1+JFA 2D SDF, O(K N log N) 1D Sliced Optimal Transport & 3-formant WebAudio

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

POLYGLOT DRIFT // 語流・字陣

Hong Kong Cantonese–English Bilingual Stroke Dynamics via Zero-Asset OS Canvas2D, WebGL2 1+JFA 2D SDF, $O(KN\log N)$ 1D Sliced Optimal Transport & 3-Formant WebAudio Synthesis

Live Typographic Field Archival Xuan Scroll Pure Code License: MIT

Solo Self-Initiated Work · Part III of the Perceptual Computation pure-code media series
Zero font binaries · Zero image textures · Zero audio samples — every glyph field, stroke ribbon, and vowel resonance is synthesized procedurally in real time.

POLYGLOT DRIFT — Live Kinetic Curl-Noise Drift and [P] Five-Stage Xuan Metamorphosis Scroll


Concept & Computational Architecture

Polyglot Drift investigates everyday Hong Kong bilingual code-switching—where Traditional Chinese calligraphic stroke topology and Swiss International Typographic Grid geometry coexist across street signage, cinema subtitles, and spoken prosody:

  1. Zero-Asset OS Native Canvas2D Bilingual Rasterization (1024 × 512):
    • Rasterizes 5 curated Hong Kong Cantonese idioms (見步行步, 獅子山下, 霓虹殘影, 山海之間, 聲氣相通) with full Cantonese Jyutping romanization (tones 1–6), morpheme breakdowns, and English curatorial glosses into symmetric Nine-Palace (九宮格) cells and a 2-line Asymmetric Dual-Anchor Swiss Grid.
  2. WebGL2 1+JFA Dual-Field Jump Flooding Signed Distance Field:
    • Sub-pixel zero-contour localization followed by step = 1 pre-pass + 10 halving passes (512..1), outputting signed Euclidean distance $d(\mathbf{x})$ and medial-axis skeleton ridges (RGBA16F with automatic 16-bit packU16 RGBA8 gl.NEAREST fallback).
  3. 12,000 Medial-Axis Stroke Particles & < 5 ms $O(KN\log N)$ 1D Sliced Optimal Transport:
    • Samples $N = 12,000$ interior stroke particles weighted by $1 + 2|d(\mathbf{x})|/4$ via collima-compatible Rng64 (Xorshift64* with 0n XOR guard), partitioned into semantic character-to-word groups via Hamilton apportionment, solved over $K = 20$ golden-angle 1D projections $\theta_m \in [0, \pi)$ + 32-bit unsigned Morton Z-order bijection (0.00 px exact endpoint residual at $x = 0.0$ and $x = 1.0$, zero $O(N^2)$ dense matrix).
  4. Divergence-Free Curl-Noise Ink Ribbons & 3-Formant (F1/F2/F3) Whisper Synthesis:
    • Continuous phase field $\mathbf{X}i(x, t) = (1 - s(x))\mathbf{p}i + s(x)\mathbf{q}{\pi(i)} + A{\text{curl}}\sin^2(\pi x)\nabla^\perp\psi(\bar{\mathbf{x}}_i, t)$ drives 12,000 instanced horsehair brush ribbons and a gesture-gated AudioWorklet (Paul Kellet pink noise + zero-DC Rosenberg glottal pulse with 6-tone Chao contours) through 3 parallel bandpass BiquadFilterNodes interpolating [320, 2150, 2900] → [520, 1350, 2450] → [680, 1120, 2550] Hz.

Curated Hong Kong Bilingual Idioms

# Traditional Chinese Cantonese Jyutping English Rendering Semantic Gloss
1 見步行步 gin3 bou6 hang4 bou6 NAVIGATE BY WALKING Improvisational HK agency: charting terrain in motion.
2 獅子山下 si1 zi2 saan1 haa6 BENEATH LION ROCK Collective resilience under Kowloon's granite ridge.
3 霓虹殘影 ngai4 hung4 caan4 jeng2 NEON AFTERIMAGE Vanishing calligraphic street signage in retinal memory.
4 山海之間 saan1 hoi2 zi1 gaan1 BETWEEN PEAK & TIDE Vertical urbanism compressed between peak and harbour.
5 聲氣相通 seng1 hei3 soeng1 tung1 SHARED BREATH & TONE Code-switching prosody linking Cantonese tones & rhythm.

Interactive Controls & URL Contract

  • Horizontal Cursor Scrub / Slider: Sweep continuous phase $x \in [0, 1]$ (0.00 Cantonese Calligraphy ↔ 0.50 Curl-Noise Ribbons ↔ 1.00 Swiss English Grid).
  • Keys 1–5: Switch between the 5 Hong Kong Cantonese-English idioms.
  • Key P / ?print=1: Toggle [P] Archival Xuan Paper Print Mode (#F7F4EC ground, 100% HUD chrome hidden; Escape exits).
  • Key M / Audio Pill: Unlock or mute/resume procedural 3-formant whisper synthesis.
  • Key Space: Toggle autonomous breathing phase drift.
  • Query Parameters: ?lang=en|zh-HK (default en), ?seed=<u64> (default 1468), ?preset=1..5, ?phase=0..1, ?print=1, ?fbo=rgba8.

Local Build & Verification

npm ci
npm run test:unit  # 11 Node 24 unit tests (HK idioms, 3-formant, Curl-Noise, Rng64, 1D Sliced OT)
npm run build      # Strict TypeScript check + relative-base Vite production bundle -> dist/
npm run preview    # Serve production dist/ locally

Perceptual Computation Series

Work Title Medium & Algorithms Live Interactive Work
01 MORPHOS // 菌脈・聲場 WebGL2 Gray-Scott PDE · 262k GPU Physarum · Async PBO AudioWorklet · [V] 3D Gallery Launch ↗
02 CAUSTIC COLLIMATION // 光軸與焦散 WebGL2 3D Implicit SDF Optical Bench · Snell/TIR · 7-Band Cauchy · Beating Overtone Prism Launch ↗
03 POLYGLOT DRIFT // 語流・字陣 (this repo) Zero-Asset HK CJK Canvas2D · WebGL2 1+JFA SDF · O(KN log N) Sliced OT · 3-Formant Audio Launch ↗
04 COLLIMA // Seeing Before the ISP Rust 2024 + WebAssembly · 14-Bit Synthetic .DNG · Pre-Demosaic WLS Tilt & HCG Noise Lab Launch ↗

About

Hong Kong Cantonese-English bilingual stroke dynamics via zero-asset OS Canvas2D, WebGL2 1+JFA 2D SDF, O(K N log N) 1D Sliced Optimal Transport & 3-formant WebAudio

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages