Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: sample playback (don't reload every keypress) + add sync/poweroff to busybox

- notepat: only call loadData when switching to a different sample,
not on every key press (was swapping buffer mid-playback = silence)
- docker-build: add sync, poweroff, reboot, halt, mknod busybox symlinks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+9 -6
+2 -1
fedac/native/docker-build.sh
··· 71 71 date dd find grep head kill ps sed sort tail tee test touch tr wc which \ 72 72 mktemp printf seq stat basename dirname env expr true false readlink \ 73 73 realpath rmdir uniq yes tar gzip gunzip hostname id ip modprobe \ 74 - mkswap swapon vi df du diff xargs nohup pgrep killall cut whoami awk; do 74 + mkswap swapon vi df du diff xargs nohup pgrep killall cut whoami awk \ 75 + sync poweroff reboot halt mknod; do 75 76 ln -s busybox "$IROOT/bin/$cmd" 76 77 done 77 78
+7 -5
fedac/native/pieces/notepat.mjs
··· 15 15 let quickMode = false; 16 16 const wavetypes = ["sine", "triangle", "sawtooth", "square", "noise", "sample"]; 17 17 let sampleLoaded = false; // true when sample buffer has data (default or recorded) 18 + let lastLoadedSample = null; // track which sample object is currently loaded 18 19 let recording = false; // true while holding REC 19 20 let recPointerId = null; // touch pointer currently holding REC button 20 21 let recStartTime = 0; // Date.now() when recording started ··· 539 540 const playFreq = freq * Math.pow(2, effectivePitchShift()); 540 541 541 542 if (wave === "sample" && (sampleLoaded || sampleBank[key])) { 542 - // Load per-key sample if available, otherwise use global 543 - if (sampleBank[key]) { 544 - sound.sample.loadData(sampleBank[key].data, sampleBank[key].rate); 545 - } else if (globalSample) { 546 - sound.sample.loadData(globalSample.data, globalSample.rate); 543 + // Only reload sample data if switching to a different sample 544 + const targetSample = sampleBank[key] || globalSample; 545 + if (targetSample && targetSample !== lastLoadedSample) { 546 + sound.sample.loadData(targetSample.data, targetSample.rate); 547 + lastLoadedSample = targetSample; 547 548 } 548 549 const smp = sound.sample.play({ 549 550 tone: playFreq, base: SAMPLE_BASE_FREQ, volume: vol, pan, loop: true, ··· 580 581 const data = sound.sample.getData?.(); 581 582 if (data && data.length > 0) { 582 583 globalSample = { data: new Float32Array(data), len: data.length, rate: sound.microphone?.sampleRate || 48000 }; 584 + lastLoadedSample = null; // force reload on next key press 583 585 console.log(`[sample-bank] global sample saved (${data.length} samples)`); 584 586 } 585 587 return;