Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

fix: notepat hold uses F11 (pickup)/F10 (hangup), install copy debug

- F11 (green pickup phone key): engage hold/latch
- F10 (red hangup phone key): clear hold, stop held notes
- F12: metronome (moved from F10)
- F8 hold removed (replaced by phone keys)
- Fixed obx const reassignment crash in HOLD indicator (use hbx)
- Added detailed errno logging to copy_file for install diagnosis

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

+42 -22
+20 -19
fedac/native/pieces/notepat.mjs
··· 585 585 } 586 586 return; 587 587 } 588 - if (key === "f10") { 589 - metronomeEnabled = !metronomeEnabled; 590 - if (metronomeEnabled) { 591 - metronomeBeatCount = Math.floor(syncedNow() / (60000 / metronomeBPM)); 592 - } 588 + // F11 (green phone pickup): Engage hold/latch 589 + // Snapshot current keys + auto-latch new keys while hold is on 590 + if (key === "f11") { 591 + heldKeys = new Set(Object.keys(sounds)); 592 + holdActive = true; 593 + sound?.synth?.({ type: "sine", tone: 660, duration: 0.06, volume: 0.12, attack: 0.002, decay: 0.05 }); 593 594 return; 594 595 } 595 - // F8: Hold/latch toggle 596 - // ON: snapshot current keys + auto-latch new keys while held 597 - // OFF: stop all held notes and clear 598 - if (key === "f8") { 596 + // F10 (red phone hangup): Clear hold — stop all held notes 597 + if (key === "f10") { 599 598 if (holdActive) { 600 - // Clear hold: stop all held notes 601 599 for (const k of heldKeys) stopSoundKey(k, sound, system, 0.08); 602 600 heldKeys.clear(); 603 601 holdActive = false; 604 602 sound?.synth?.({ type: "sine", tone: 330, duration: 0.06, volume: 0.12, attack: 0.002, decay: 0.05 }); 605 - } else { 606 - // Engage hold: snapshot current keys (may be empty — new keys auto-latch) 607 - heldKeys = new Set(Object.keys(sounds)); 608 - holdActive = true; 609 - sound?.synth?.({ type: "sine", tone: 660, duration: 0.06, volume: 0.12, attack: 0.002, decay: 0.05 }); 603 + } 604 + return; 605 + } 606 + // F12: metronome toggle (moved from F10) 607 + if (key === "f12") { 608 + metronomeEnabled = !metronomeEnabled; 609 + if (metronomeEnabled) { 610 + metronomeBeatCount = Math.floor(syncedNow() / (60000 / metronomeBPM)); 610 611 } 611 612 return; 612 613 } ··· 2326 2327 box(obx, waveRowY, 1, waveRowH, true); 2327 2328 ink(dark ? 140 : 100, dark ? 140 : 100, dark ? 150 : 110); 2328 2329 write("o:" + octave, { x: obx + 3, y: waveRowY + 3, size: 1, font: "font_1" }); 2329 - // HOLD indicator 2330 + // HOLD indicator (drawn to the LEFT of the octave button) 2330 2331 if (holdActive) { 2331 - obx += octBtnW + 2; 2332 2332 const holdW = 30; 2333 + const hbx = obx - holdW - 2; 2333 2334 ink(dark ? 80 : 180, dark ? 40 : 100, dark ? 40 : 100); 2334 - box(obx, waveRowY, holdW, waveRowH, true); 2335 + box(hbx, waveRowY, holdW, waveRowH, true); 2335 2336 ink(255, dark ? 180 : 60, dark ? 120 : 40); 2336 - write("HOLD", { x: obx + 2, y: waveRowY + 3, size: 1, font: "font_1" }); 2337 + write("HOLD", { x: hbx + 2, y: waveRowY + 3, size: 1, font: "font_1" }); 2337 2338 } 2338 2339 } 2339 2340
+22 -3
fedac/native/src/ac-native.c
··· 732 732 // Copy a file from src to dst path, returns bytes copied or -1 on error 733 733 static long copy_file(const char *src, const char *dst) { 734 734 FILE *in = fopen(src, "rb"); 735 - if (!in) return -1; 735 + if (!in) { 736 + ac_log("[copy_file] cannot open src %s: errno=%d\n", src, errno); 737 + return -1; 738 + } 736 739 FILE *out = fopen(dst, "wb"); 737 - if (!out) { fclose(in); return -1; } 740 + if (!out) { 741 + ac_log("[copy_file] cannot open dst %s: errno=%d\n", dst, errno); 742 + fclose(in); 743 + return -1; 744 + } 738 745 char buf[65536]; 739 746 long total = 0; 740 747 size_t n; 741 748 while ((n = fread(buf, 1, sizeof(buf), in)) > 0) { 742 - if (fwrite(buf, 1, n, out) != n) { total = -1; break; } 749 + size_t written = fwrite(buf, 1, n, out); 750 + if (written != n) { 751 + ac_log("[copy_file] write failed at offset %ld: wanted %zu got %zu errno=%d\n", 752 + total, n, written, errno); 753 + total += written; // count partial write 754 + break; 755 + } 743 756 total += n; 757 + } 758 + if (fflush(out) != 0) { 759 + ac_log("[copy_file] fflush failed: errno=%d\n", errno); 760 + } 761 + if (fsync(fileno(out)) != 0) { 762 + ac_log("[copy_file] fsync failed: errno=%d\n", errno); 744 763 } 745 764 fclose(out); 746 765 fclose(in);