Loop Lab: when sound feeds itself
by PrismFalcon4494 lines11.5 KB
<!--ARCADELAB
title: Loop Lab: when sound feeds itself
description: Predict whether a signal fades, holds or grows as it passes around a feedback loop. A silent, synthetic experiment with three challenges and an inspectable model.
emoji: 🔁
color: teal
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Loop Lab: when sound feeds itself</title>
<style>
:root{color-scheme:light;--ink:#142c37;--muted:#435964;--paper:#f5faf8;--line:#a8c4bd;--teal:#006655;--gold:#e7b659}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:18px/1.55 system-ui,sans-serif}main{max-width:1000px;margin:auto;padding:24px 18px 48px}h1{font-size:clamp(30px,5vw,48px);line-height:1.1;margin:.3em 0}h2{font-size:24px;line-height:1.25;margin:.2em 0 .65em}p{margin:.65em 0}.eyebrow{font-size:14px;text-transform:uppercase;letter-spacing:.08em;color:var(--teal);font-weight:750}.intro{max-width:68ch}.card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;margin-top:22px}.grid{display:grid;grid-template-columns:minmax(240px,.8fr) minmax(280px,1.2fr);gap:26px}.formula{font:700 22px/1.5 ui-monospace,monospace;background:#eaf5f0;padding:12px;border-radius:9px;overflow-wrap:anywhere}.note{color:var(--muted);font-size:16px}label{display:block;font-weight:700;margin:15px 0 4px}input[type=range]{width:100%;min-height:40px;accent-color:var(--teal)}button{font:inherit;font-weight:700;border:2px solid var(--teal);border-radius:9px;padding:10px 14px;background:#fff;color:var(--teal);cursor:pointer;min-height:46px}button.primary{background:var(--teal);color:white}button:hover{background:#e5f4ed}button.primary:hover{background:#004e42}button:disabled{opacity:.5;cursor:default}.row{display:flex;gap:9px;flex-wrap:wrap;margin:15px 0}:focus-visible{outline:3px solid #a14608;outline-offset:4px}svg{display:block;width:100%;height:auto;background:#f1f6f5;border-radius:10px}svg text{font-family:system-ui,sans-serif;font-size:13px;fill:var(--ink)}.readout{font-size:22px;font-weight:750}.status{min-height:3.1em;background:#edf7f2;padding:12px;border-radius:9px}.steps{padding-left:1.3em}.steps li{margin:9px 0}a{color:#005c93;text-underline-offset:3px}table{border-collapse:collapse;width:100%;font-size:15px}th,td{padding:7px 9px;text-align:left;border-bottom:1px solid #c8dcd6}caption{text-align:left;font-weight:700;margin:10px 0}details{margin-top:14px}summary{cursor:pointer;font-weight:700}footer{margin-top:25px;font-size:15px;color:var(--muted)}.badge{display:inline-block;padding:4px 10px;background:#fff2d7;border-radius:20px;font-size:14px;font-weight:700}@media(max-width:680px){.grid{grid-template-columns:1fr}.card{padding:17px}main{padding-top:18px}.row button{flex:1 1 110px}h1{max-width:13ch}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
</style>
</head>
<body>
<main>
<div class="eyebrow">A silent experiment in feedback</div>
<h1>Loop Lab: when sound feeds itself</h1>
<p class="intro">A microphone can hear a loudspeaker that is playing that microphone. A little of the output returns to the input. Predict what happens when a signal makes repeated trips around a loop, then check your prediction. This page makes no sound and never uses your microphone.</p>
<section class="card grid" aria-labelledby="experiment">
<div>
<h2 id="experiment">1. Change one number</h2>
<p>Each trip multiplies the previous amplitude by the <strong>loop factor</strong>. The starting amplitude is 0.10, in arbitrary units.</p>
<div class="formula">next = previous × factor</div>
<label for="gain">Loop factor: <output id="gainValue" for="gain">0.65</output></label>
<input id="gain" type="range" min="0" max="1.3" step="0.01" value="0.65">
<div class="row"><button type="button" id="step" class="primary">One trip</button><button type="button" id="all">Ten trips</button><button type="button" id="reset">Reset</button></div>
<p class="readout" id="reading" aria-live="polite">Trip 0 · amplitude 0.1000</p>
<p class="note">Changing the factor starts a fresh experiment. No animation or listening is needed.</p>
</div>
<div>
<svg viewBox="0 0 480 290" role="img" aria-labelledby="plotTitle plotDesc">
<title id="plotTitle">Amplitude over ten trips</title>
<desc id="plotDesc">Only the starting amplitude is shown. Use the buttons to add trips. The table below provides every value.</desc>
<path d="M58 22V238H455" fill="none" stroke="#637b77" stroke-width="1.5"/>
<path d="M58 46H455M58 110H455M58 174H455" fill="none" stroke="#d3e2dd"/>
<text x="8" y="27">amplitude</text><text x="405" y="273">trip</text>
<text id="axisMax" x="10" y="51">0.12</text><text id="axisMid" x="10" y="115">0.08</text><text id="axisLow" x="10" y="179">0.04</text><text x="26" y="242">0</text>
<g id="xTicks"></g><polyline id="trace" fill="none" stroke="#006655" stroke-width="4" stroke-linejoin="round"/><g id="dots"></g>
</svg>
<p class="note">The vertical scale adjusts to show the current experiment. Read the numbers before comparing two curves.</p>
<details><summary>Open the exact values</summary><table><caption>Generated amplitudes, including the starting value</caption><thead><tr><th scope="col">Trip</th><th scope="col">Amplitude</th></tr></thead><tbody id="values"></tbody></table></details>
</div>
</section>
<section class="card" aria-labelledby="challenges">
<span class="badge" id="progress">Challenge 1 of 3</span>
<h2 id="challenges">2. Predict, then reveal</h2>
<p id="question">With a loop factor of 0.80, will the amplitude fade, stay the same or grow over ten trips?</p>
<div class="row" id="choices"><button type="button" data-choice="fade">Fade</button><button type="button" data-choice="same">Stay the same</button><button type="button" data-choice="grow">Grow</button></div>
<p class="status" id="answer" aria-live="polite">Choose a prediction. Your answers stay on this page.</p>
<button type="button" id="next" hidden>Next challenge</button>
</section>
<section class="card" aria-labelledby="meaning">
<h2 id="meaning">3. What the pattern means</h2>
<ol class="steps">
<li><strong>Below 1:</strong> each pass returns less amplitude than the previous one. For example, 0.10 × 0.80 becomes 0.08 after one trip.</li>
<li><strong>Exactly 1:</strong> the simplified model returns the same amplitude. That is a boundary in this model, not a recommended real-world setting.</li>
<li><strong>Above 1:</strong> the loop returns more amplitude each trip. A small starting signal can grow without a new large input.</li>
</ol>
<p>A real microphone–loudspeaker loop also depends on frequency, delay, direction, room reflections and the equipment. Our one-number model does not predict a safe volume, the pitch of a whistle, or the behaviour of a particular product. The model grows without a ceiling; real equipment eventually limits or distorts.</p>
<p>The useful connection is the loop itself: reconnecting the music source does not remove an acoustic path from loudspeaker to microphone. For an actual two-microphone karaoke setup, the <a href="https://alidel.kz/guides/ultraboom-ndr-nastroyka" rel="noopener noreferrer">Alidel setup guide explains how to distinguish music problems from microphone feedback and how to begin checking the microphone level, direction and separation</a>. Use the instructions for your own equipment. No product was tested for this simulation.</p>
<p><strong>Try explaining it:</strong> why can reducing the amount returned around the loop help even when the original input stays the same? Use one fading and one growing curve as evidence.</p>
</section>
<footer>Original educational model and interface by Alidel, prepared with AI assistance. All numbers are synthetic. No audio, recording, network requests, analytics, accounts or saved answer history are used by this HTML. The hosting platform has its own operation and moderation practices. This source is offered under MIT: Copyright © 2026 Alidel. Permission is granted, free of charge, to use, copy, modify, merge, publish, distribute, sublicense and/or sell copies, provided this notice and permission notice are included. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM USE OF THE SOFTWARE.</footer>
</main>
<script>
(()=>{'use strict';
const $=id=>document.getElementById(id),ns='http://www.w3.org/2000/svg';
const series=(factor,trips=10)=>Array.from({length:trips+1},(_,i)=>0.1*Math.pow(factor,i));
const classify=factor=>factor<1?'fade':factor>1?'grow':'same';
let trips=0; const gain=$('gain');
for(let i=0;i<=10;i+=2){const t=document.createElementNS(ns,'text');t.setAttribute('x',String(58+i*39.7));t.setAttribute('y','257');t.setAttribute('text-anchor','middle');t.textContent=i;$('xTicks').append(t);}
function draw(){const factor=Number(gain.value),s=series(factor,trips),top=Math.max(.12,...s)*1.05;const x=i=>58+i*39.7,y=a=>238-a/top*192;
$('gainValue').value=factor.toFixed(2);$('reading').textContent=`Trip ${trips} · amplitude ${s[trips].toFixed(4)}`;
$('trace').setAttribute('points',s.map((a,i)=>`${x(i)},${y(a)}`).join(' '));$('dots').replaceChildren();
s.forEach((a,i)=>{const c=document.createElementNS(ns,'circle');c.setAttribute('cx',String(x(i)));c.setAttribute('cy',String(y(a)));c.setAttribute('r','4.5');c.setAttribute('fill','#006655');$('dots').append(c);});
$('axisMax').textContent=top.toFixed(2);$('axisMid').textContent=(top*2/3).toFixed(2);$('axisLow').textContent=(top/3).toFixed(2);
$('values').replaceChildren(...s.map((a,i)=>{const tr=document.createElement('tr'),n=document.createElement('th'),v=document.createElement('td');n.scope='row';n.textContent=i;v.textContent=a.toFixed(6);tr.append(n,v);return tr;}));
$('plotDesc').textContent=`Factor ${factor.toFixed(2)}. ${trips} trips. Starting amplitude 0.1, current amplitude ${s[trips].toFixed(6)}. Full values appear in the table.`;
$('step').disabled=trips===10;$('all').disabled=trips===10;
}
gain.addEventListener('input',()=>{trips=0;draw();});$('step').addEventListener('click',()=>{trips=Math.min(10,trips+1);draw();});$('all').addEventListener('click',()=>{trips=10;draw();});$('reset').addEventListener('click',()=>{trips=0;draw();});
const challenges=[{factor:.8,word:'fade'},{factor:1,word:'stay the same'},{factor:1.15,word:'grow'}];let round=0,answered=false;
function prompt(){const c=challenges[round];answered=false;$('progress').textContent=`Challenge ${round+1} of 3`;$('question').textContent=`With a loop factor of ${c.factor.toFixed(2)}, will the amplitude fade, stay the same or grow over ten trips?`;$('answer').textContent='Choose a prediction. Your answers stay on this page.';$('next').hidden=true;$('choices').querySelectorAll('button').forEach(b=>{b.disabled=false;});}
$('choices').addEventListener('click',e=>{const b=e.target.closest('button[data-choice]');if(!b||answered)return;answered=true;const c=challenges[round],correct=b.dataset.choice===classify(c.factor),last=series(c.factor)[10];gain.value=String(c.factor);trips=10;draw();$('answer').textContent=`${correct?'Correct.':'Try the curve as your evidence.'} The amplitude will ${c.word}: 0.1000 becomes ${last.toFixed(4)} after ten trips. Each new value is the previous value multiplied by ${c.factor.toFixed(2)}.`;$('choices').querySelectorAll('button').forEach(x=>{x.disabled=true;});$('next').hidden=false;$('next').textContent=round===2?'Repeat the three challenges':'Next challenge';});
$('next').addEventListener('click',()=>{round=(round+1)%challenges.length;prompt();});draw();prompt();
window.loopLabModel=Object.freeze({series,classify});
})();
</script>
</body>
</html>
Game Source: Loop Lab: when sound feeds itself
Creator: PrismFalcon44
Libraries: none
Complexity: moderate (94 lines, 11.5 KB)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: loop-lab-when-sound-feeds-itself-prismfalcon44" to link back to the original. Then publish at arcadelab.ai/publish.