Skip to content

MP4: the tape fills the screen, in eight styles - #484

Draft
tarikbc wants to merge 7 commits into
mainfrom
mp4-tapes
Draft

tarikbc wants to merge 7 commits into
mainfrom
mp4-tapes

Conversation

@tarikbc

@tarikbc tarikbc commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

MP4's Cassette look is now a tape that fills the screen, in eight styles, as I picked in the two Tape Styles labs:

What changes

  • The tape fills the screen. 960 x 608 under one row of keys, 864 x 544 over two (six of the eight languages), from a related step under the header to the keys' box, every edge on the 16-unit grid, in the canvas's middle. The 25 bars and the frame's time bar go: the reels are the motion and the time is on the label (look-tape-h replaces look-cassette-w).
  • Eight styles. Smoke (the smooth smoke-grey shell it always had, the default), and Pinstripe, Cover Band, Ferric, Metal, Clear, Red and Worn in pixel art. Kept as mp4.tape. Defaults change nothing for someone who never touches it: Cover is still the default look, Smoke the default style.
  • Where it is chosen. A Tape Style row in MP4's MENU under Player Look (live only on Cassette; A opens the list with the tape playing in its picture), and Up and Down on Now Playing, which step round the kept styles (all eight, mp4t_step) and say the style's name in a pill for hold-short.
  • The label. A small cover first at the song's row, the side's letter, the song, its place and the mode's mark; under the window the artist and album between the time played and the time left; "Paused" where the time left was. The song and the line under the window are handwritten (Caveat SemiBold, 1.3 times title and meta). Nothing is cut: the line under the window slides now, as the song always did.
  • The tape's number is the album's length: 46, 60 or 90 (120 past 90). The daemon sums the folder's track lengths from their headers (new LENGTH request, tags_folder_length); checked against ffprobe on res/bgm (1767.7 s both). No number shows until it answers, so it never changes in front of you.
  • Side A or B by the half of the album, as before (mp4t_side).
  • A click. A and a track change play a short tape click (tape-key, tape-wind, the same in every voice, made by tools/gensounds.py from designdef's tones) with the voice's own sound. No hiss. UI Sounds Off is silent.

The pixel art (src/pixtape.c)

Drawn by code from cassette.h's millimetres on a grid of cells, with the placeholders' rules: an outline cell, a light top-left row and a dark bottom-right row, flat tones, an ordered dither. A cell is 8 units (5 pixels on the Pixel 2, 8 on the Brick) or 16 on the Smart Pro (15 pixels, where 8 would be 7.5): mp4t_cell picks it from the profile's panel.

  • Still parts: two textures a cell a texel (back, front), made again only when the style, the grid or the album changes.
  • What turns: sprite sheets made once, a pack for every half cell of radius (35 at 8 units) and a hub for every 7.5 degrees (48 frames). Each frame picks the sprite nearest the existing model's radius and angle (mp4t_pack_half, mp4t_hub_frame over mp4look's mp4l_tape, not a copy of it).
  • A frame is six copies with nearest sampling: back, two packs, two hubs, front (plus the small cover). Nothing is drawn on the CPU in a frame and no texture is uploaded. On Clear each pack sprite carries its reel's tape to its roller, so it is still six.
  • Worn (Medium) is baked once an album, seeded by the album's name: yellowed edges in a dither, faded ink, a coffee ring, a peeled corner, cells gone, scuffs, scratches and dust.
  • Cover Band prints its number white on a dark cover color and in the ink on a light one.

Clear's label

The lab's Clear had its label as a strip of paper on the glass, with both lines crammed into it over the reels. It is now a card along the top: an outline cell round it, its paper's dark rows at its foot and right, a one-cell shadow on the shell and reels under it, wall to wall inside the shell, taller so the song's row and the line under it each have room, its foot at the hubs' tops. The words are in the same order and sizes as on the other styles.

The handwriting and its fallback

res/fonts/hand.ttf is Caveat SemiBold: tools/handfont.py makes the static wght 600 instance of Google Fonts' variable Caveat (google/fonts 82823f5) and names it; no glyph is changed. Its SIL OFL 1.1 is LICENSES/OFL-Caveat.txt, listed in THIRD-PARTY-LICENSES.md and copied to the card's Licenses/; mk/payload.sh puts the font beside menu.ttf.

Caveat has Latin and Cyrillic. ui_hand_face draws a line run by run: what Caveat lacks goes in Lexend at the size whose x-height meets Caveat's, or for Chinese and Japanese in Noto, one cut for the whole line's ideographs (the set that is on, then Japanese's for kana, Chinese's otherwise, as face_for chooses). Every run sits on Caveat's baseline. It does not depend on #467: the hand face is opened outside ui_face_open's records, so if #467 lands the line is still never handed to one face whole.

Choices I made

  • Smoke's textures are at unit size, not the panel's pixels. The lab suggested panel-size textures for memory and sharpness, but the Pixel 2 draws the screen at 1024 x 768 and scales it to 640 x 480 whole (src/device/pixel2.c), so a 600 x 380 texture would be scaled up and then down again: blurrier. It costs 3.4 MB of textures (2.3 MB of it the shell) against about 1.3 MB before. The size cas_ready is given changes it if memory matters more.
  • The tape is 960 x 608 (the pixel lab's size on the 16-unit grid) for Smoke too, not round 1's 944 x 600, so a style change never moves or resizes the tape.
  • Two-row languages get 864 x 544, sized from the keys' box, so nothing meets.
  • The line under the window keeps room for the widest of "-00:00", Paused and Stopped at each end, so pausing never makes it start or stop sliding.
  • Metal's print "METAL" stays in every language, as 46 and 90 do: it is a mark on the thing, not a word of the interface.
  • The click plays on presses (A, L1, R1), not when a song ends by itself.

Checks

  • make check-mp4look: the styles' words both ways, Smoke the default and for an unknown word, Up and Down round the kept ones and back, Smoke smooth and the rest pixel; the tape's number (38 min 46, 52 min 60, 71 min 90, past 90 120, none unknown) and side; the hub frame nearest the angle, all 48 met in a turn, stepping down while playing, a rewind's fastest step under 30 degrees; the packs' half cells; a cell whole pixels on the Pixel 2 (8 = 5), Brick (8 = 8) and Smart Pro (16 = 15) from their profiles. The new tests do not build without the change.
  • New make check-handface: the runs of Latin, Cyrillic, mixed Chinese, kana, a simplified-only line and Greek; a mixed line measures as its runs; a kanji has ink, not an empty box; in English and in 日本語. It fails 14 times with the fallback taken out.
  • make check-menus updated for the row: Tape Style under Player Look, Smoke by default, dead off Cassette, live and saying the style on it, absent on books, videos and All with no songs.
  • i18n shots: np-tape-clear, np-tape-worn-paused, np-tape-said and the Tape Style list on all eight styles, in every language, Pixel 2 and Brick: everything fits.
  • make native, check-design, check-sounds, and the full make check (CHECK_JOBS=4): every check passes. In the first run check-diatom and check-building-doc failed until Diatom's copy of design.h and the checks' table were brought up to date, and check-i18n-shots found MP4's Repeat on One under the fold below the new row (its shot now puts the cursor on Repeat); all three pass now, the i18n run whole (1005 screens). check-portal failed once under load and passes alone.

Looked at

Host shots of every style, light and dark, Pixel 2 and Brick; the Smart Pro canvas with #398 merged in a scratch tree (16-unit cells, the tape at x 208); a long title and a long artist and album line sliding; a Chinese and Japanese album, a mixed Latin and kanji title and a Cyrillic one; Worn; Clear before and after; French and German with two rows of keys; paused; the style pill; MENU's row and the list.

Cost, measured on the host

Made once: 3 to 14 ms a pixel style, 530 KB of textures at 8-unit cells (back and front 36 KB each, the pack sheet, 48 hub frames), 1.1 MB on Clear (two pack sheets); 130 to 200 KB at 16-unit cells. Smoke: 3.4 MB, drawn once a theme. Each one says so in the log: mp4: the worn tape drawn in 4 ms, 532 KB of textures. A frame: the same six copies as before, the pixel ones nearest-sampled.

On the Pixel 2 (not done here)

  1. Put this build on the card, play an album of more than 46 minutes, open Now Playing, MENU > Player Look > Cassette.
  2. Over SSH, grep "tape drawn\|cassette drawn" the launcher's log: each style's one-off time and size.
  3. For each style (Up and Down on Now Playing), wait 5 s, then px2-perf 30: the panel's frame-time median and 95th percentile, the launcher's CPU, the GPU's clock. Then the same on Cover and on 1.1.0's Cassette for a baseline.
  4. Press R1 a few times on Worn and Clear: the rewind should show no frame-time spike (no texture made in a frame).
  5. Check the tape's number on a short (46) and a long (90) album, and that A and R1 click.

Cassette is now a tape that fills the screen (960 x 608, or 880 x 560 over
two rows of keys), in the style MENU's new Tape Style row picks, or Up and
Down on Now Playing: Smoke, the smooth shell it always had and the default,
and Pinstripe, Cover Band, Ferric, Metal, Clear, Red and Worn in pixel art,
drawn by code on a grid of 8-unit cells (16 on the Smart Pro). The pixel
tape is two still textures and two sprite sheets made once (a pack for
every half cell of radius, a hub for every 7.5 degrees), copied with
nearest sampling six times a frame; the reels follow mp4look's model as
before.

The label is handwritten in Caveat SemiBold, with the characters it lacks
drawn run by run in Lexend or Noto. The time is on the label, a small
cover is on it, the line under the window slides when long, and the tape's
number comes from the album's length, which the daemon now sums (LENGTH).
A and a track change click on the tape (two new sounds).

Labs: https://claude.ai/artifact/R9NmVeShdu9DwH9Cg74cge and
https://claude.ai/artifact/5G6HnCFCJdYdtLhBiVdf7Q
DESIGN.md says the tape and its styles, the handwriting and its fallback;
look-tape-h replaces look-cassette-w. The style's pill sits over the clock
and clear of the tape, Cover Band prints its number in the ink on a light
cover's color, both reels share one pack sheet but on Clear, and each tape
says its textures' size in the log. The i18n run shoots the Clear card,
Worn paused, the pill and the Tape Style list on every style.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant