Files
JIANT/tools/video/plate.html
T
Claude 329aff53fa 0.9.12 draft: 12 voices with the second core, sound types + PRESETS by type, MIDI LEARN (MENU > MIDI), FM6 bank sector guard, copyright lines
- voice.c voice_cap: VOICES_2CORE 12 while the second core takes parts (fx.c mc_two: CORES 2, not REC at
  power-on, not given up); one core 8, LOAD ECO 6; a track still NVOICE 8 (no RAM). After Skiff by illuminus5.
  cpu_vg: mix/v12 (both cores 3924 instr/sample), mix/v12.c0 (core 0 1949), mix/v12.one (one core, 8 voices 3241);
  regress.c chk_budget_2core; the dual-core equivalence test at one budget (mc_host_v12).
- Sound types (PT_BASS..PT_FX) on all factory presets in preset_t.mono bits 1..4 (no format change); PRESETS LIST
  ALL / FAV / BASS LEAD PAD KEYS PLUCK BELL VOX DRUM FX across engines, saved in favorites.factory[15][18];
  gen.c keeps PT_BASS sounds off the other roles (was a name match). After Skiff by illuminus5.
- MIDI LEARN ported from Felucca 1.5 (midi_learn.c): 10 CCs, 3 bytes each in DIGITAL's favourites row, reserved
  CCs and the standard map refused, any channel, USB and TRS; MENU > MIDI tab (MIDI OUT, LEARN, LEARN CLEAR);
  state in the pool.
- fm6_vbank.c: 0xE7000 holding foreign data (Skiff's pattern bank) reads as no bank and is never erased at
  power-on; only a bank the user sends replaces it. fm6bank_test foreign_test.
- Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) in JIANT's files ("Portions" in mostly-Felucca ones),
  README / LICENSING.md / MENU > ABOUT credits (Felucca, Skiff).
- Docs: MANUAL.md / MANUAL.es.md, README v0.9.12 draft, EDITOR_PROTOCOL.md (tabs), cheat sheets, nav map.

Flash 576192 -> 577712 B (+1520), .data+.bss unchanged, pool +8 B (spare 10528 B).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-10-18 18:50:07 +00:00

325 lines
25 KiB
HTML

<!doctype html>
<!-- SPDX-License-Identifier: GPL-3.0-only
Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant)
(JIANT 0.6.69) the project film (16:9), a frame at a time (tools/video/film.mjs drives it with "plate"): the landing's anatomical plate, its red terminal, the screen as the specimen; as promo.html: the landing
page's organic cyberspace and protozoa; the FM-1's screen large, floating in a living membrane (cilia, organelles),
drifting and breathing with the kick; what happens on it told as the landing tags its specimens (a caption, data
lines on curved leaders to points of the screen, live readings); the beings swim out of the membrane on their notes;
at the end the list of what is new, a picture of each. All of it moved by the sound. -->
<html><head><meta charset="utf-8"><link rel="stylesheet" href="fonts/fonts.css">
<style>html,body{margin:0;background:#050409}canvas{display:block}</style></head>
<body><canvas id="c" width="1920" height="1080"></canvas>
<script>
const W = 1920, H = 1080, TAU = Math.PI * 2;
const C = {line:'#efe6c8',cyan:'#3fe0e6',blue:'#3b30ff',red:'#ff3b2f',orange:'#ff7a1a',yellow:'#ffe14d',mag:'#ff3ea5',dim:'#9c94b4',void:'#050409'};
const DISPLAY = 'Michroma', MONO = '"IBM Plex Mono"', BODY = '"Instrument Sans"', TERM = 'VT323';
const cv = document.getElementById('c'), x = cv.getContext('2d');
let D = null;
function rng(a){return function(){a|=0;a=a+0x6D2B79F5|0;let t=Math.imul(a^a>>>15,1|a);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296;};}
/* ---------- the landing's protozoa, as it draws them ---------- */
function organism(x,o,t){
const s=o.s;x.save();x.translate(o.x,o.y);x.rotate(o.rot+Math.sin(t*.25+o.ph)*.25);x.globalAlpha=o.a;
if(o.glow){const g=x.createRadialGradient(0,0,0,0,0,s*2.4);g.addColorStop(0,'rgba(90,100,255,.55)');g.addColorStop(.45,'rgba(150,80,255,.22)');g.addColorStop(.72,'rgba(255,110,60,.16)');g.addColorStop(1,'rgba(0,0,0,0)');x.fillStyle=g;x.beginPath();x.arc(0,0,s*2.4,0,TAU);x.fill();}
x.lineWidth=o.lw||1;x.strokeStyle=C.line;
switch(o.type){
case 0:{const rx=s,ry=s*.55;x.beginPath();x.ellipse(0,0,rx,ry,0,0,TAU);x.stroke();
x.globalAlpha=o.a*.45;x.beginPath();x.ellipse(0,0,rx*.88,ry*.8,0,0,TAU);x.stroke();x.globalAlpha=o.a;
for(let i=0;i<44;i++){const a=i/44*TAU,px=Math.cos(a)*rx,py=Math.sin(a)*ry;let nx=Math.cos(a)/rx,ny=Math.sin(a)/ry;const l=Math.hypot(nx,ny);nx/=l;ny/=l;const w=Math.sin(t*5+i*.6+o.ph)*.5,L=s*.14;const ex=nx*Math.cos(w)-ny*Math.sin(w),ey=nx*Math.sin(w)+ny*Math.cos(w);x.beginPath();x.moveTo(px,py);x.lineTo(px+ex*L,py+ey*L);x.stroke();}
x.fillStyle='rgba(255,225,77,.85)';x.beginPath();x.ellipse(-s*.15,0,s*.2,s*.14,0,0,TAU);x.fill();x.strokeStyle=C.orange;x.stroke();
x.strokeStyle=C.mag;for(let k=0;k<3;k++){x.beginPath();x.arc(s*(.25+k*.18),Math.sin(k*2)*s*.12,s*.07,0,TAU);x.stroke();}
x.strokeStyle=C.red;x.lineWidth=1.6;x.beginPath();x.moveTo(-s*.75,-s*.15);x.quadraticCurveTo(-s*.45,s*.25,-s*.1,s*.3);x.stroke();break;}
case 1:{x.beginPath();for(let a=0;a<=TAU+.01;a+=.08){const r=s*(.7+.22*Math.sin(3*a+t*.8+o.ph)+.12*Math.sin(5*a-t*.6));const px=Math.cos(a)*r,py=Math.sin(a)*r;a?x.lineTo(px,py):x.moveTo(px,py);}x.closePath();x.stroke();
x.fillStyle=C.orange;for(const d of o.dots)x.fillRect(d[0]*s,d[1]*s,1.4*(o.lw||1),1.4*(o.lw||1));
x.strokeStyle=C.cyan;x.beginPath();x.arc(s*.1,-s*.1,s*.16,0,TAU);x.stroke();x.fillStyle=C.cyan;x.beginPath();x.arc(s*.1,-s*.1,s*.05,0,TAU);x.fill();break;}
case 2:{x.beginPath();x.arc(0,0,s*.5,0,TAU);x.stroke();x.beginPath();x.arc(0,0,s*.38,0,TAU);x.stroke();
x.fillStyle='rgba(255,59,47,.9)';x.beginPath();x.arc(0,0,s*.2,0,TAU);x.fill();
for(let i=0;i<28;i++){const a=i/28*TAU+t*.05,l=s*(.95+.15*Math.sin(i*3.1));x.beginPath();x.moveTo(Math.cos(a)*s*.5,Math.sin(a)*s*.5);x.lineTo(Math.cos(a)*l,Math.sin(a)*l);x.stroke();x.fillStyle=C.line;x.fillRect(Math.cos(a)*l-1,Math.sin(a)*l-1,2,2);}
x.fillStyle=C.yellow;for(let i=0;i<12;i++){const a=i/12*TAU;x.fillRect(Math.cos(a)*s*.44-1,Math.sin(a)*s*.44-1,2,2);}break;}
case 3:{x.beginPath();x.moveTo(s*.6,0);x.bezierCurveTo(s*.6,-s*.4,-s*.4,-s*.3,-s*.5,0);x.bezierCurveTo(-s*.4,s*.3,s*.6,s*.4,s*.6,0);x.stroke();
x.strokeStyle=C.cyan;x.beginPath();for(let i=0;i<=40;i++){const u=i/40,px=-s*.5-u*s*2.2,py=Math.sin(u*10-t*6+o.ph)*s*.14*u;i?x.lineTo(px,py):x.moveTo(px,py);}x.stroke();
x.fillStyle=C.red;x.beginPath();x.arc(s*.35,-s*.08,s*.06,0,TAU);x.fill();x.strokeStyle=C.orange;x.beginPath();x.arc(0,0,s*.13,0,TAU);x.stroke();break;}
default:{const L=s*.9,Wd=s*.28;x.beginPath();x.ellipse(0,0,L,Wd,0,0,TAU);x.stroke();x.strokeStyle=C.cyan;x.beginPath();x.moveTo(-L*.9,0);x.lineTo(L*.9,0);x.stroke();x.strokeStyle=C.line;
for(let i=-9;i<=9;i++){const px=i/10*L,hh=Wd*Math.sqrt(Math.max(0,1-(px/L)*(px/L)))*.8;x.beginPath();x.moveTo(px,-hh);x.lineTo(px,-hh*.25);x.moveTo(px,hh*.25);x.lineTo(px,hh);x.stroke();}
x.fillStyle=C.mag;x.beginPath();x.arc(0,0,s*.06,0,TAU);x.fill();}
}
x.restore();
}
/* ---------- the landing's background: organic cyberspace ---------- */
const ids=['R078','K729','F802','D732','V763','S209','P398'];
const TYPE_OF = [3, 1, 4, 2, 0, 1]; /* lead a flagellate, bass an amoeba, plucks a diatom, drums the radiolarian,
strings the ciliate, the choir a glowing amoeba */
const TNAME = ['LEAD', 'BASS', 'PLUCK', 'DRUM-X', 'STRINGS', 'CHOIR'];
let orgs = [], stars = [];
(function(){const R=rng(7);
for(let i=0;i<18;i++){const z=.5+R()*.8;const o={x0:R()*W,y0:R()*H,s0:(16+R()*34)*z,z:z,rot:R()*TAU,ph:R()*10,type:i%5,trk:i%6,vx:(R()-.5)*.32*z,vy:(-.1-R()*.24)*z,a0:.3+z*.45,glow:R()<.38,tag:i<ids.length?ids[i]:null,dot:R()<.5,dots:[]};
for(let k=0;k<26;k++){const a=R()*TAU,r=Math.sqrt(R())*.5;o.dots.push([Math.cos(a)*r,Math.sin(a)*r]);}orgs.push(o);}
for(let i=0;i<Math.round(W*H/4500);i++)stars.push([R()*W,R()*H,R()<.2,R()]);})();
function globe(t,cx,cy,R,amp){x.save();x.strokeStyle=`rgba(255,122,26,${.3+.4*amp})`;x.lineWidth=.8+amp;x.beginPath();x.arc(cx,cy,R,0,TAU);x.stroke();
for(let i=0;i<8;i++){const ph=t*.15+i/8*Math.PI;x.beginPath();x.ellipse(cx,cy,Math.abs(Math.cos(ph))*R,R,0,0,TAU);x.stroke();}
for(let k=-3;k<=3;k++){const yy=k/4*R,rr=Math.sqrt(R*R-yy*yy);x.beginPath();x.ellipse(cx,cy+yy,rr,rr*.16,0,0,TAU);x.stroke();}
x.setLineDash([2,4]);x.strokeStyle='rgba(63,224,230,.35)';x.beginPath();x.ellipse(cx,cy,R*1.35,R*.4,-.4+t*.1,0,TAU);x.stroke();x.setLineDash([]);x.restore();}
function chevron(cx,cy,label){x.fillStyle=C.mag;[[0,0],[1,1],[2,2],[3,1],[4,0]].forEach(p=>x.fillRect(cx+p[0]*8,cy+p[1]*8,7,7));x.font='22px VT323,monospace';x.fillText(label,cx,cy-8);}
function background(f,t,A){
x.fillStyle='#050409';x.fillRect(0,0,W,H);
for(const s of stars){const tw=.6+.4*Math.sin(t*2+s[3]*40)+A.high*.8*s[3];x.fillStyle=s[2]?`rgba(63,224,230,${.55*tw})`:`rgba(239,230,200,${.3*tw})`;x.fillRect(s[0],s[1],1+(A.high>.7&&s[3]>.85?1:0),1);}
/* the floor: its lines roll toward us a line a beat, brighter on the kick */
const gy=H*.66, roll=(t/D.beat)%1;
x.strokeStyle=`rgba(59,48,255,${.24+.4*A.low})`;x.lineWidth=1;
for(let i=0;i<=14;i++){const u=(i+roll)/14;const y=gy+Math.pow(u,2)*(H-gy);x.beginPath();x.moveTo(0,y);x.lineTo(W,y);x.stroke();}
for(let i=-16;i<=16;i++){x.beginPath();x.moveTo(W/2+i*18,gy);x.lineTo(W/2+i*W*.12,H);x.stroke();}
globe(t*(1+A.mid),W*.47,H*.86,Math.min(W,H)*.1*(1+.08*A.low),A.low);
const tagged=[];
for(const o of orgs){
const m=o.s0*3, px=((o.x0+o.vx*f*2)%(W+2*m)+(W+2*m))%(W+2*m)-m, py=((o.y0+o.vy*f*2)%(H+2*m)+(H+2*m))%(H+2*m)-m;
const lv=A.trk[o.trk]||0;
const d=Object.assign({},o,{x:px,y:py,s:o.s0*(1+.55*lv),a:Math.min(1,o.a0*(.75+.6*lv)),lw:1+lv*.8});
organism(x,d,t);if(o.tag)tagged.push(d);
if(o.dot){x.fillStyle=C.red;x.beginPath();x.arc(d.x+d.s*.45,d.y-d.s*.3,2.5+2*lv,0,TAU);x.fill();}}
x.strokeStyle=`rgba(255,225,77,${.3+.4*A.mid})`;x.lineWidth=1;
for(let i=0;i<tagged.length-1;i++){const a=tagged[i],b=tagged[i+1];x.beginPath();x.moveTo(a.x,a.y);x.quadraticCurveTo((a.x+b.x)/2,Math.min(a.y,b.y)-90,b.x,b.y);x.stroke();}
for(const o of tagged){const bx=o.x+o.s*.7,by=o.y-o.s*.7;x.fillStyle=C.yellow;x.fillRect(bx,by-10,10,10);
x.fillStyle=C.line;x.font='500 12px "IBM Plex Mono",monospace';x.fillText(o.tag+' · '+TNAME[o.trk],bx+15,by);
x.fillStyle='rgba(239,230,200,.55)';x.font='10px "IBM Plex Mono",monospace';x.fillText('x:'+Math.round(o.x)+' y:'+Math.round(o.y)+' lvl:'+(A.trk[o.trk]||0).toFixed(2),bx,by+14);}
chevron(W*.035,H*.93,String(Math.floor(t/D.beat/4)+1).padStart(3,'0'));
}
/* ---------- HUD corners (the landing's .brk) and its glass ---------- */
function brk(X,Y,w,h,col,k,glass){
if(glass){x.fillStyle=glass;x.fillRect(X,Y,w,h);}
x.fillStyle=col;k=k||14;
x.fillRect(X,Y,k,1);x.fillRect(X,Y,1,k);x.fillRect(X+w-k,Y,k,1);x.fillRect(X+w-1,Y,1,k);
x.fillRect(X,Y+h-1,k,1);x.fillRect(X,Y+h-k,1,k);x.fillRect(X+w-k,Y+h-1,k,1);x.fillRect(X+w-1,Y+h-k,1,k);
}
function veil(cx,cy,rx,ry){x.save();x.translate(cx,cy);x.scale(rx,ry);const g=x.createRadialGradient(0,0,0,0,0,1);
g.addColorStop(0,'rgba(5,4,9,.92)');g.addColorStop(.55,'rgba(5,4,9,.78)');g.addColorStop(1,'rgba(5,4,9,0)');x.fillStyle=g;x.beginPath();x.arc(0,0,1,0,TAU);x.fill();x.restore();}
function heatGrad(x0,x1,lt){const g=x.createLinearGradient(x0,0,x1,0);
const s=lt?['#9d97ff','#d39bff','#ff9fd2','#ff9a8a','#ffc07a','#fff3a8']:['#3b30ff','#a12cff','#ff3ea5','#ff3b2f','#ff7a1a','#ffe14d'];
[0,.25,.45,.62,.8,1].forEach((p,i)=>g.addColorStop(p,s[i]));return g;}
function text(s,X,Y,font,col,ls){x.font=font;x.fillStyle=col;if(ls){x.letterSpacing=ls+'px';}x.fillText(s,X,Y);x.letterSpacing='0px';}
function shadowed(fn){x.save();x.shadowColor='#050409';x.shadowBlur=14;fn();x.shadowBlur=28;fn();x.restore();fn();}
const grain=document.createElement('canvas');grain.width=grain.height=256;{const g=grain.getContext('2d'),im=g.createImageData(256,256),R=rng(3);
for(let i=0;i<65536;i++){const v=R()*255;im.data[i*4]=im.data[i*4+1]=im.data[i*4+2]=v;im.data[i*4+3]=255;}g.putImageData(im,0,0);}
function finish(f){
x.save();x.globalCompositeOperation='overlay';x.globalAlpha=.10;const R=rng(f);
const ox=Math.floor(R()*256),oy=Math.floor(R()*256);
for(let yy=-oy;yy<H;yy+=256)for(let xx=-ox;xx<W;xx+=256)x.drawImage(grain,xx,yy);x.restore();
x.fillStyle='rgba(0,0,0,.14)';for(let yy=0;yy<H;yy+=3)x.fillRect(0,yy,W,1);
}
/* ---------- the plate: the screen as a specimen pinned in the landing's anatomical plate ---------- */
const scr = document.createElement('canvas'); scr.width = scr.height = 240; const sx = scr.getContext('2d');
const simg = sx.createImageData(240,240);
async function rgbFrame(f){
const b = new Uint8Array(await (await fetch('scr/'+f)).arrayBuffer()); const d = simg.data;
for(let i=0,j=0;i<57600;i++,j+=3){d[i*4]=b[j];d[i*4+1]=b[j+1];d[i*4+2]=b[j+2];d[i*4+3]=255;}
sx.putImageData(simg,0,0);
}
function easeIO(u){u=Math.min(1,Math.max(0,u));return u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;}
const PL={x:720,y:118,w:1140,h:880}; /* the plate's frame */
const SPEC={cx:1290,cy:560,sw:660}; /* the specimen inside it */
const STIP=[], TREE=[];
(function(){const R=rng(42);
while(STIP.length<300){const a=R()*TAU,r=.8+R()*.18;STIP.push([a,r,R()*TAU]);}
(function br(x0,y0,a,len,d){if(d>4)return;const x1=x0+Math.cos(a)*len,y1=y0+Math.sin(a)*len;TREE.push([x0,y0,x1,y1,d]);br(x1,y1,a-.5+R()*.2,len*.72,d+1);br(x1,y1,a+.45+R()*.2,len*.68,d+1);})(.62,-.55,-2.4,.22,0);
})();
function specPose(t,A,outK){
const k=easeIO(outK);
return {cx:SPEC.cx+Math.sin(t*.31)*10+k*60, cy:SPEC.cy+Math.cos(t*.27)*8+k*40, sw:SPEC.sw*(1-.25*k), rot:Math.sin(t*.19)*.012, sc:1+.02*A.low+.025*A.kick};
}
function toWorld(P,u,v){const lx=(u-.5)*P.sw*P.sc, ly=(v-.5)*P.sw*P.sc, c=Math.cos(P.rot), s=Math.sin(P.rot);return [P.cx+lx*c-ly*s,P.cy+lx*s+ly*c];}
function plate(f,t,A,P,cut){
x.fillStyle='rgba(3,2,7,.86)';x.fillRect(PL.x,PL.y,PL.w,PL.h);
x.strokeStyle='rgba(239,230,200,.14)';x.lineWidth=1;x.strokeRect(PL.x+.5,PL.y+.5,PL.w-1,PL.h-1);
const g=x.createRadialGradient(P.cx,P.cy,0,P.cx,P.cy,P.sw*1.1);g.addColorStop(0,`rgba(59,48,255,${.14+.14*A.low})`);g.addColorStop(1,'rgba(0,0,0,0)');
x.fillStyle=g;x.fillRect(PL.x,PL.y,PL.w,PL.h);
const S=P.sw*P.sc, rx=S*.86, ry=S*.74;
x.save();x.translate(P.cx,P.cy);x.rotate(P.rot);
/* the membrane: the landing's ellipse with its cilia, waving faster with the highs */
x.strokeStyle=C.line;x.lineWidth=1;
for(let i=0;i<90;i++){const a=i/90*TAU,px=Math.cos(a)*rx,py=Math.sin(a)*ry;let nx=Math.cos(a)/rx,ny=Math.sin(a)/ry;const l=Math.hypot(nx,ny);nx/=l;ny/=l;
const wv=Math.sin(t*(4+4*A.high)+i*.45)*.45,L=rx*.06*(1+.6*A.kick);const ex=nx*Math.cos(wv)-ny*Math.sin(wv),ey=nx*Math.sin(wv)+ny*Math.cos(wv);
x.beginPath();x.moveTo(px,py);x.lineTo(px+ex*L,py+ey*L);x.stroke();}
x.lineWidth=1.8;x.beginPath();x.ellipse(0,0,rx*(1+.012*A.kick),ry*(1+.012*A.kick),0,0,TAU);x.stroke();
x.lineWidth=.8;x.beginPath();x.ellipse(0,0,rx*.93,ry*.9,0,0,TAU);x.stroke();
/* the red band, its yellow ribs */
x.beginPath();for(let a=-2.75;a<=-.8;a+=.03)x.lineTo(Math.cos(a)*rx*.88,Math.sin(a)*ry*.86);for(let a=-.8;a>=-2.75;a-=.03)x.lineTo(Math.cos(a)*rx*.83,Math.sin(a)*ry*.8);x.closePath();
x.fillStyle=`rgba(255,59,47,${.75+.2*A.mid})`;x.fill();x.strokeStyle=C.line;x.lineWidth=.8;x.stroke();
x.strokeStyle='rgba(255,225,77,.7)';for(let a=-2.6;a<=-.95;a+=.12){x.beginPath();x.moveTo(Math.cos(a)*rx*.87,Math.sin(a)*ry*.84);x.lineTo(Math.cos(a)*rx*.81,Math.sin(a)*ry*.77);x.stroke();}
/* the cytoplasm's stipple in the ring, drifting */
x.fillStyle=C.orange;for(const d of STIP){const a=d[0]+t*.03,r=d[1];x.fillRect(Math.cos(a)*rx*r+Math.sin(t*.7+d[2])*1.5,Math.sin(a)*ry*r+Math.cos(t*.6+d[2])*1.5,1.7,1.7);}
/* the nerve net, its pulses on the beat */
x.strokeStyle=C.cyan;x.lineWidth=1.4;for(const s of TREE){x.beginPath();x.moveTo(s[0]*rx,s[1]*ry);x.lineTo(s[2]*rx,s[3]*ry);x.stroke();}
const pp=(t/D.beat)%1;x.fillStyle=C.yellow;for(const s of TREE){if(s[4]>2)continue;x.beginPath();x.arc((s[0]+(s[2]-s[0])*pp)*rx,(s[1]+(s[3]-s[1])*pp)*ry,2.4,0,TAU);x.fill();}
/* the screen, the nucleus of the specimen */
x.scale(P.sc,P.sc);const h=P.sw/2*.82, sw=h*2;
x.imageSmoothingEnabled=false;
if(cut>0){const o=Math.round(cut*14);
x.globalCompositeOperation='lighter';x.globalAlpha=.6;x.drawImage(scr,-h-o,-h,sw,sw);x.drawImage(scr,-h+o,-h,sw,sw);x.globalAlpha=1;x.globalCompositeOperation='source-over';
for(let i=0;i<6;i++){const yy=((f*37+i*71)%240);x.drawImage(scr,0,yy,240,6,-h+((i%2)?o*2:-o*2),-h+yy*sw/240,sw,6*sw/240);}
} else x.drawImage(scr,-h,-h,sw,sw);
x.fillStyle='rgba(0,0,0,.14)';for(let yy=0;yy<sw;yy+=sw/120)x.fillRect(-h,-h+yy,sw,1);
x.strokeStyle=`rgba(255,122,26,${.55+.4*A.kick})`;x.lineWidth=1.5;x.strokeRect(-h-.5,-h-.5,sw+1,sw+1);
x.restore();
/* the plate's print */
x.fillStyle=C.cyan;x.font='16px "IBM Plex Mono"';x.textAlign='right';x.fillText('S. 02',PL.x+PL.w-16,PL.y+28);
x.fillStyle='rgba(239,230,200,.6)';x.fillText('J. Jiant 2026',PL.x+PL.w-16,PL.y+PL.h-14);x.textAlign='center';x.fillText('IMP. BUENOS AIRES',PL.x+PL.w/2,PL.y+PL.h-14);
x.textAlign='left';x.fillText('© JIANT · M-Vave FM1',PL.x+16,PL.y+PL.h-14);
return {rx,ry};
}
/* the legend: each data line a letter on the plate, a dashed leader into the specimen */
function legend(sc,idx,f,t,A,P,E){
if(!sc||!sc.data||!sc.data.length)return;
const el=t-sc.t, R=rng(idx*977+5), n=sc.data.length;
sc.data.forEach((s,i)=>{
const q=Math.min(1,Math.max(0,(el-.5-i*.3)/.35)); if(q<=0)return;
const ang=-Math.PI*.95+i*(Math.PI*1.9/Math.max(1,n-1))*.5+Math.PI*.15, side=i%2?1:-1;
const a2=(i%2?.1:Math.PI-.1)+(Math.floor(i/2)-((n-1)/4))*.42;
const cx=P.cx+Math.cos(a2)*E.rx*1.18, cy=P.cy+Math.sin(a2)*E.ry*1.22;
const lx=Math.min(PL.x+PL.w-40,Math.max(PL.x+40,cx)), ly=Math.min(PL.y+PL.h-60,Math.max(PL.y+50,cy));
const [ax,ay]=toWorld(P,.15+R()*.7,.2+R()*.6);
x.globalAlpha=q;
x.strokeStyle=C.cyan;x.setLineDash([5,4]);x.lineWidth=1;x.beginPath();x.moveTo(ax,ay);x.lineTo(lx,ly);x.stroke();x.setLineDash([]);
x.fillStyle=C.cyan;x.beginPath();x.arc(ax,ay,2.6+1.5*(A.trk[i%6]||0),0,TAU);x.fill();
const cr=17;x.beginPath();x.arc(lx,ly,cr,0,TAU);x.fill();
x.fillStyle='#030207';x.font='600 18px "IBM Plex Mono"';x.textAlign='center';x.textBaseline='middle';x.fillText(String.fromCharCode(65+i),lx,ly+1);
x.textBaseline='alphabetic';
x.font='500 19px "IBM Plex Mono"';
let left=lx>P.cx;const tw0=x.measureText(s).width;
if(left&&lx+cr+10+tw0>PL.x+PL.w-12)left=false; /* (never past the plate's edge) */
if(!left&&lx-cr-10-tw0<PL.x+12)left=true;
x.textAlign=left?'left':'right';const tx=left?lx+cr+10:lx-cr-10;
x.fillStyle='rgba(3,2,7,.8)';const w=x.measureText(s).width;x.fillRect(left?tx-4:tx-w-4,ly-16,w+8,26);
x.fillStyle=C.line;x.fillText(s,tx,ly+3);x.textAlign='left';
x.globalAlpha=1;
});
}
/* ---------- the terminal: the landing's red VT323, the story typed in ---------- */
function typed(s,n){return s.slice(0,Math.max(0,Math.floor(n)));}
function terminal(sc,idx,f,t,A){
const X=60,Y=130,Wd=620,Hd=600, el=t-sc.t;
brk(X,Y,Wd,Hd,C.red,16,'rgba(6,5,12,.9)');
x.save();x.shadowColor='rgba(255,59,47,.45)';x.shadowBlur=8;
text('----- JIANT FM ----- HEMS '+D.version,X+26,Y+48,'34px VT323',C.orange);
text(('> '+sc.tag.toLowerCase()).slice(0,40),X+26,Y+96,'30px VT323','rgba(255,59,47,.65)');
let n=el*38, yy=Y+178;
sc.title.forEach(l=>{const s=typed(l,n);n-=l.length+4;text(s,X+26,yy,'78px VT323',C.red);yy+=72;});
yy+=14;
sc.sub.forEach(l=>{const s=typed(l,n);n-=l.length+2;text(s,X+26,yy,'36px VT323',C.red);yy+=40;});
if(Math.floor(t/.5)%2){x.fillStyle=C.red;x.fillRect(X+26+Math.min(560,(n<0?0:0)),yy-28+(n<0?-40:0),16,30);}
x.restore();
const st=[['status','IN DEVELOPMENT'],['signal',(A.rms*100|0)+' %'],['tempo','112 BPM · D MINOR']];
st.forEach((r,i)=>{text(r[0],X+26,Y+Hd-90+i*30,'26px VT323','rgba(255,59,47,.55)');text(r[1],X+220,Y+Hd-90+i*30,'26px VT323',i?C.red:C.yellow);});
}
function fieldnote(sc,idx,f,t,A){
const X=60,Y=130,Wd=620,Hd=600, el=t-sc.t;
brk(X,Y,Wd,Hd,C.mag,16,'rgba(6,5,12,.9)');
text(sc.tag,X+26,Y+46,'500 18px "IBM Plex Mono"',C.cyan,3);
x.fillStyle=C.mag;x.font=`400 140px ${DISPLAY}`;x.fillText('“',X+16,Y+180);
sc.title.forEach((l,i)=>{const q=Math.min(1,Math.max(0,(el-.15-i*.25)/.4));x.globalAlpha=q;
text(l,X+30+(1-q)*20,Y+230+i*58,`500 44px ${BODY}`,C.line);});
x.globalAlpha=Math.min(1,Math.max(0,(el-.8)/.4));
x.fillStyle=C.yellow;x.fillRect(X+30,Y+Hd-70,12,12);
text('a comment on the launch video',X+52,Y+Hd-59,'400 20px "IBM Plex Mono"','rgba(239,230,200,.7)',1);
x.globalAlpha=1;
}
function cover(t,A){
const X=60,Y=300,p=Math.min(1,t/1.0);
veil(X+320,Y+150,520,360);x.globalAlpha=p;
x.fillStyle=C.cyan;x.beginPath();x.arc(X+16,Y-8,16,0,TAU);x.fill();x.textAlign='center';text('S',X+16,Y-2,'600 17px "IBM Plex Mono"',C.void);x.textAlign='left';
text('PLATE S.02',X+44,Y-1,'500 18px "IBM Plex Mono"',C.cyan,3);
shadowed(()=>text('JIANT',X,Y+130,`400 128px ${DISPLAY}`,C.line,3));
x.save();x.shadowColor=`rgba(255,159,210,${.4+.5*A.low})`;x.shadowBlur=24;text('FM',X,Y+262,`400 128px ${DISPLAY}`,heatGrad(X,X+320,true),3);x.restore();
text('ANATOMY OF A PROJECT',X,Y+326,'500 26px "IBM Plex Mono"',C.line,6);
x.globalAlpha=1;
}
function outro(t0,f,t,A){
const el=t-t0, X=60, Y=150, q=k=>Math.min(1,Math.max(0,(el-k)/.6));
brk(X,Y-20,620,780,C.yellow,18,'rgba(6,5,12,.9)');
x.globalAlpha=q(0);
text('DESIGNED BY JIANT · BUENOS AIRES',X+26,Y+28,'500 17px "IBM Plex Mono"',C.cyan,3);
text('A SOLO PROJECT',X+26,Y+96,`400 50px ${DISPLAY}`,C.line,2);
x.globalAlpha=q(.5);
['Every engine, page, being and pixel','of JIANT FM was designed by me:','an artist, one person, free and open.'].forEach((l,i)=>text(l,X+26,Y+150+i*38,`400 28px ${BODY}`,'#d6cfe6'));
x.globalAlpha=q(1.1);
text('IF IT IS USEFUL TO YOU, BUY ME A COFFEE',X+26,Y+302,'600 17px "IBM Plex Mono"',C.yellow,3);
[['Ko-fi',C.mag,'ko-fi.com/juanjiant'],['Cafecito',C.orange,'cafecito.app/juanjiant']].forEach((c,i)=>{
const bx=X+26,by=Y+330+i*150,b=1+.03*A.low;
brk(bx,by,568,130,C.yellow,18,'rgba(3,2,7,.9)');
text(c[0],bx+22,by+66,`400 ${Math.round(42*b)}px ${DISPLAY}`,c[1]);
text(c[2],bx+22,by+108,'600 21px "IBM Plex Mono"',C.yellow,1);});
x.globalAlpha=q(1.8);
text('install: juanjiant-bit.github.io/JIANT',X+26,Y+660,'500 18px "IBM Plex Mono"',C.line,2);
text('code: github.com/juanjiant-bit/JIANT',X+26,Y+692,'500 18px "IBM Plex Mono"',C.dim,2);
x.globalAlpha=1;
}
/* ---------- the beings: out of the plate's membrane on their notes ---------- */
let swim=[], lastF=-1;
function beings(f,t,A,P,E){
const R=rng(f*7919+13), cap=D.home[f]?18:10;
if(f!==lastF){
const spawn=(k,v)=>{const a=R()*TAU, px=P.cx+Math.cos(a)*E.rx*1.05, py=P.cy+Math.sin(a)*E.ry*1.05, sp=2.5+R()*4;
const o={type:TYPE_OF[k],trk:k,x:px,y:py,s0:8+9*v,born:f,life:45+R()*35,vx:Math.cos(a)*sp,vy:Math.sin(a)*sp,rot:R()*TAU,ph:R()*10,glow:k===4,dots:[],spin:(R()-.5)*.04};
for(let i=0;i<26;i++){const b=R()*TAU,rr=Math.sqrt(R())*.5;o.dots.push([Math.cos(b)*rr,Math.sin(b)*rr]);}swim.push(o);};
for(let k=0;k<6;k++){const v=D.on[f][k];if(v>0&&k!==3&&swim.length<cap&&R()<.4)spawn(k,v);}
if(D.kick[f]>.3&&swim.length<cap+2&&R()<.4)spawn(3,1);
lastF=f;
}
swim=swim.filter(o=>f-o.born<o.life);
for(const o of swim){const age=(f-o.born)/30,u=(f-o.born)/o.life;const sz=Math.min(300,o.s0*(1+age*age*12))*(1+.35*(A.trk[o.trk]||0));
organism(x,{type:o.type,x:o.x+o.vx*(f-o.born)*(1+age*1.4),y:o.y+o.vy*(f-o.born)*(1+age),s:sz,rot:o.rot+o.spin*(f-o.born),ph:o.ph,glow:o.glow&&sz<70,dots:o.dots,lw:Math.min(3,1+age),a:Math.min(1,age*6)*Math.pow(1-u,1.5)*.85},t);}
}
/* ---------- the HUD: the landing's top bar and its caption ---------- */
const CAPS=['Evaluating vital signs… Evaluating recognition response…','Executing neurological subroutine.','Mitosis in progress. Stay with me.','One artist, one firmware, one small machine.','Everything you see follows the sound.'];
function hud(f,t,A){
brk(60,30,1800,52,C.cyan,14,'rgba(6,5,12,.9)');
text('JIANT',84,64,'600 16px "IBM Plex Mono"',C.line,2);text('/ FM · PLATE S.02',146,64,'500 16px "IBM Plex Mono"',C.dim,2);
const o=orgs[Math.floor(t/4)%orgs.length];
text('x:'+String(Math.round(Math.abs(o.x0+o.vx*f*2)%W)).padStart(4,'0')+' y:'+String(Math.round(Math.abs(o.y0+o.vy*f*2)%H)).padStart(4,'0'),640,64,'500 16px "IBM Plex Mono"',C.yellow,2);
x.fillStyle=C.red;x.globalAlpha=(Math.floor(t/.6)%2)?1:.2;x.fillRect(900,52,8,8);x.globalAlpha=1;
text('IN DEVELOPMENT · OPEN SOURCE · AUDIO-REACTIVE',918,64,'500 16px "IBM Plex Mono"',C.line,2);
x.textAlign='right';text(D.version.toUpperCase(),1836,64,'500 16px "IBM Plex Mono"',C.orange,2);x.textAlign='left';
const ci=Math.floor(t/(D.beat*16))%CAPS.length,s=CAPS[ci];x.font='400 18px "IBM Plex Mono"';const w=x.measureText(s).width+40;
x.fillStyle='rgba(5,4,9,.9)';x.fillRect(60,1016,w,36);x.strokeStyle='rgba(239,230,200,.14)';x.strokeRect(60.5,1016.5,w-1,35);
text(s,80,1040,'400 18px "IBM Plex Mono"',C.line);
const X0=60,Y0=990,bw=16;
for(let i=0;i<32;i++){const v=D.spec[f][i]||0;const hgt=3+v*30;x.fillStyle=heatGrad(X0,X0+32*(bw+3));x.globalAlpha=.3+.6*Math.min(1,v);x.fillRect(X0+i*(bw+3),Y0-hgt-210,bw,hgt);}
x.globalAlpha=1;text('VITAL SIGNS',X0,Y0-188,'500 12px "IBM Plex Mono"',C.dim,2);
}
/* ---------- a frame ---------- */
async function render(f){
const t=f/D.fps;
const A={rms:D.rms[f],low:D.low[f],mid:D.mid[f],high:D.high[f],kick:D.kick[f],trk:D.trk[f]};
for(let k=1;k<5&&f-k>=0;k++)A.kick=Math.max(A.kick,D.kick[f-k]*(1-k/5));
await rgbFrame(f);
let si=-1;for(let i=0;i<D.scenes.length;i++)if(D.scenes[i].t<=t)si=i;
const sc=si>=0?D.scenes[si]:null;
const cut=sc&&t-sc.t<.33?1-(t-sc.t)/.33:0;
const oc=D.scenes.find(q=>!q.title.length), outK=oc&&t>=oc.t?Math.min(1,(t-oc.t)/1.2):0;
background(f,t,A);
const P=specPose(t,A,outK);
const E=plate(f,t,A,P,cut);
beings(f,t,A,P,E);
if(!sc)cover(t,A);
else if(!sc.title.length)outro(sc.t,f,t,A);
else if(sc.kind===4)fieldnote(sc,si,f,t,A);
else{terminal(sc,si,f,t,A);legend(sc,si,f,t,A,P,E);}
hud(f,t,A);
finish(f);
if(cut>0){x.fillStyle=`rgba(255,59,47,${cut*.06})`;x.fillRect(0,0,W,H);}
}
async function boot(film){
D=await (await fetch('data.json')).json(); D.version=(await (await fetch('version')).text()).trim();
await document.fonts.load('400 40px Michroma');await document.fonts.load('400 30px "Instrument Sans"');await document.fonts.load('500 30px "Instrument Sans"');
await document.fonts.load('600 20px "IBM Plex Mono"');await document.fonts.load('500 20px "IBM Plex Mono"');
await document.fonts.load('400 20px "IBM Plex Mono"');await document.fonts.load('22px VT323');
return D.n;
}
async function frameJpeg(f,q){await render(f);return cv.toDataURL('image/jpeg',q||.92);}
</script></body></html>