๐ฆ Yee Piano ๐น
By yee
3 viewsยท3h ago
Yee Piano ๐น
A single-file playable piano in the same picture-book style as Jumping Yee, Watermelon Game, and Snake (warm brown outlines, pastel fills, rounded panels, Fredoka + Jua type). A big round Yee โ the singing green-dinosaur meme โ sits in the middle, and a keyboard runs along the bottom. Tap a key and Yee sings that note: the face replays and a pitch-shifted "Yee" sounds at the key's pitch.
It reuses the embedded WebM clip from Jumping Yee โ the same base64 data:video/webm (VP9 video + Opus audio) โ for both the animated face and the instrument's voice.
How to Play
- Tap any key โ Yee's face replays and sings that note.
- White and black keys span one octave (C โ C). Each key is "Yee" pitched to that note.
- โ / โถ shift the whole keyboard down/up an octave (Oct 2โ6).
- Drag across the keys for a glissando; press several keys for chords (polyphonic).
- On a computer, play with A W S E D F T G Y H U J K and shift octaves with โ / โ.
How the sound works
- The clip's Opus audio is decoded once into a Web Audio buffer (~0.42 s, stereo, 48 kHz).
- Every key press spawns a fresh
AudioBufferSourceNodewhoseplaybackRatetransposes the sample: rate = 2^((midi โ E4)/12), so E4 plays at the clip's natural pitch and other keys bend up or down. Higher notes are shorter and chirpier; lower notes are longer and deeper โ classic sample-piano behavior. - Because each note is its own voice, the piano is polyphonic โ chords and overlapping notes ring together.
- A short attack ramp keeps fast retriggers from clicking.
The face
A live WebM clip clipped to a circle, with a brown outline like the bird body in the sibling games:
- The face is muted โ all sound comes from the pitched buffer โ and replays from the start on every key press.
- The video's own playback rate follows the note's pitch (clamped 0.5โ2.2ร), so Yee visibly sings faster on high notes, slower on low ones.
- Each press pops the face (a squash-and-stretch bounce) and flashes the note's rainbow color as a glow + tint (hue mapped across the 12 semitones).
Design
- Portrait (9:16) โ fits a phone with no scrolling.
- Sky-blue stage panel, dark-brown outlines on every shape, fully rounded corners.
- Yellow + orange pressable octave buttons; flat ๐ / ๐ mute and ๐ home controls.
- ๐ฆ Yee Piano ๐น title; Fredoka + Jua fonts.
Tech
- Single HTML file โ no build, no external assets (one Google Fonts link).
- The clip is embedded inline as a base64
data:video/webmURI, shared by the<video>face and the audio decode. - Web Audio API for pitch-shifted, polyphonic playback; the AudioContext is created on the first gesture, with the clip bytes pre-fetched at load to minimize first-note latency.
- DOM keyboard with Pointer Events (touch + mouse, glissando via
elementFromPoint) plus a computer-keyboard mapping. No canvas needed.
Loading comments...
Other Codes
No other codes yet
