Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

feat: composite wavetype — 5 layered detuned oscillators

Rich pad sound inspired by web notepat: sine base, detuned sine,
short sawtooth burst, slow triangle swell, quiet square.
All voices killed together on key release.

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

+20 -3
+20 -3
fedac/native/pieces/notepat.mjs
··· 13 13 let wave = "sine"; 14 14 let waveIndex = 0; 15 15 let quickMode = false; 16 - const wavetypes = ["sine", "triangle", "sawtooth", "square", "noise", "sample"]; 16 + const wavetypes = ["sine", "triangle", "sawtooth", "square", "composite", "noise", "sample"]; 17 17 let sampleLoaded = false; // true when sample buffer has data (default or recorded) 18 18 let lastLoadedSample = null; // track which sample object is currently loaded 19 19 let recording = false; // true while holding REC ··· 617 617 return; 618 618 } 619 619 if (sounds[key]) { 620 - const s = sounds[key].synth || sounds[key]; 621 - sound.kill(s, quickMode ? 0.02 : 0.08); 620 + const fade = quickMode ? 0.02 : 0.08; 621 + if (sounds[key].compositeVoices) { 622 + for (const v of sounds[key].compositeVoices) sound.kill(v, fade); 623 + } else { 624 + sound.kill(sounds[key].synth || sounds[key], fade); 625 + } 622 626 delete sounds[key]; 623 627 } 624 628 } ··· 802 806 synth = smp; 803 807 sounds[hitNote.key] = { synth, note: hitNote.letter, octave: hitNote.octave, baseFreq: freq, isSample: true }; 804 808 } 809 + } else if (wave === "composite") { 810 + // Rich layered pad: 5 detuned oscillators 811 + const detune = () => Math.floor(Math.random() * 13) - 6; 812 + const a = sound.synth({ type: "sine", tone: playFreq, duration: Infinity, volume: 0.5, attack: 0.003, decay: 0.9, pan }); 813 + const b = sound.synth({ type: "sine", tone: playFreq + 9 + detune(), duration: Infinity, volume: 0.17, attack: 0.003, decay: 0.9, pan }); 814 + const c = sound.synth({ type: "sawtooth", tone: playFreq + detune(), duration: 0.15 + Math.random() * 0.05, volume: 0.01, attack: 0.005, decay: 0.1, pan }); 815 + const d = sound.synth({ type: "triangle", tone: playFreq + 8 + detune(), duration: Infinity, volume: 0.016, attack: 0.999, decay: 0.9, pan }); 816 + const e2 = sound.synth({ type: "square", tone: playFreq + detune(), duration: Infinity, volume: 0.008, attack: 0.05, decay: 0.9, pan }); 817 + synth = a; // primary handle for kill 818 + sounds[hitNote.key] = { 819 + synth, note: hitNote.letter, octave: hitNote.octave, baseFreq: freq, 820 + compositeVoices: [a, b, c, d, e2], 821 + }; 805 822 } else { 806 823 synth = sound.synth({ 807 824 type: wave, tone: playFreq, duration: Infinity,