update readme gifs Hunter Friday, November 13th, 2026 at 11:11 AM
10 11 ### play it loud. 12 -<p align="center"><img src="readme_images/loud.gif" width="390"></p> 13 +<p align="center"><img src="readme_images/volume.gif" width="390"></p> 14 15 ### scrub a dub, bub. 16 17 <p align="center"><img src="readme_images/scrub.gif" width="390"></p> 18 19 +### wipeout. 20 + 21 +<p align="center"><img src="readme_images/delete.gif" width="390"></p> 22 + 23 +### take it from the top. 24 + 25 +<p align="center"><img src="readme_images/scroll.gif" width="390"></p> 26 + 27 ### home recording. 28 29 try soundstone <a href="https://hunterirving.github.io/soundstone">in your web browser</a>, or install it as a <a href="https://hunterirving.github.io/web_workshop/pages/pwa">progressive web app</a>.
Binary files differ.
Binary files differ.
Binary files differ.
Binary files differ.
Binary files differ.
Binary files differ.
Binary files differ.
Binary files differ.
22 super(); 23 this.spinUpRate = 1 / (processorOptions.spinUpSeconds * sampleRate); 24 this.spinDownSamples = processorOptions.spinDownSeconds * sampleRate; 25 + this.deleteRate = 1 / (processorOptions.deleteSeconds * sampleRate); 26 this.tapes = []; 27 this.recording = null; 28 this.renders = 0; 53 tape.held = true; 54 tape.pressed = false; 55 } - // Nulled, not spliced, so the other ids stay valid. - if (data.type === 'delete') this.tapes[data.id] = null; 56 + // A deleted tape fades out first, so that a playing one does not click. 57 + if (data.type === 'delete') tape.fadeRate = this.deleteRate; 58 if (data.type === 'drag') tape.pull += data.bars * BAR_SAMPLES; 59 if (data.type === 'drop') tape.pressed = false; 60 if (data.type === 'release') { 149 volume, 150 // Smoothed `volume`. 151 gain: volume, 152 + // Falls from 1 to 0 at `fadeRate` per sample once the tape is deleted. 153 + fade: 1, 154 + fadeRate: 0, 155 }); 156 } 157 168 } 169 } 170 - for (const tape of this.tapes) { 171 + for (const [id, tape] of this.tapes.entries()) { 172 if (!tape) continue; 173 const goal = tape.pressed ? 0 : tape.target; 174 + // Nulled, not spliced, so the other ids stay valid. 175 + if (tape.fade === 0 || (tape.fadeRate && tape.speed === 0)) { 176 + this.tapes[id] = null; 177 + continue; 178 + } 179 if (tape.speed === 0 && tape.pull === 0 && (tape.held || goal === 0)) { 180 tape.gain = tape.volume; 181 continue; 195 tape.speed += Math.sign(gap) * Math.min(distance, change); 196 } 197 tape.gain += (tape.volume - tape.gain) * VOLUME_RATE; 198 + tape.fade = Math.max(0, tape.fade - tape.fadeRate); 199 const index = Math.floor(tape.position); 200 const fraction = tape.position - index; 201 const a = samples[index]; 202 const b = samples[index + 1 === length ? 0 : index + 1]; 203 // Level follows speed up to 1, like a real playback head. - output[i] += (a + (b - a) * fraction) * Math.min(1, Math.abs(tape.speed)) * tape.gain; 204 + output[i] += (a + (b - a) * fraction) * Math.min(1, Math.abs(tape.speed)) * tape.gain * tape.fade; 205 tape.position += tape.speed; 206 if (tape.position < 0 || tape.position >= length) { 207 tape.position = (tape.position % length + length) % length;
10 // In CSS px. 11 const DRAG_THRESHOLD = 5; 12 const APPEAR_MILLISECONDS = 300; 13 +// A deleted row fades out faster than it shrinks. 14 +const DELETE_FADE_MILLISECONDS = 200; 15 const HOLD_TO_DELETE_MILLISECONDS = 2000; 16 const UPCOMING_OPACITY = 0.35; 17 const MAX_VOLUME = 2; 120 await audio.audioWorklet.addModule('resources/deck.js'); 121 deck = new AudioWorkletNode(audio, 'deck', { 122 outputChannelCount: [1], - processorOptions: {spinUpSeconds: SPIN_UP_SECONDS, spinDownSeconds: SPIN_DOWN_SECONDS}, 123 + processorOptions: { 124 + spinUpSeconds: SPIN_UP_SECONDS, 125 + spinDownSeconds: SPIN_DOWN_SECONDS, 126 + deleteSeconds: APPEAR_MILLISECONDS / 1000, 127 + }, 128 }); 129 deck.connect(audio.destination); 130 deck.port.onmessage = ({data}) => handlers[data.type](data); 320 forgetTape(tape); 321 tapes[id] = null; 322 row.classList.remove('finished'); 323 + row.animate([{}, {opacity: 0}], {duration: DELETE_FADE_MILLISECONDS, easing: 'ease-out', fill: 'forwards'}); 324 row.animate( - [{}, {height: 0, opacity: 0}], 325 + [{}, {height: 0}], 326 {duration: APPEAR_MILLISECONDS, easing: 'ease-out'}, 327 ).finished.then(() => row.remove()); 328 };