<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><title>Simple JS Piano</title><style>body{font-family:sans-serif;text-align:center;background:#222;color:white;padding-top:50px;}.piano{display:flex;justify-content:center;gap:5px;}.key{width:60px;height:200px;background:white;border-radius:005px5px;cursor:pointer;color:black;display:flex;align-items:flex-end;justify-content:center;padding-bottom:20px;font-weight:bold;transition:background0.1s;user-select:none;}.key:active{background:#ddd;transform:scale(0.98);}.controls{margin-bottom:20px;}button{padding:10px20px;cursor:pointer;font-size:16px;}</style></head><body><h1>JavaScript AudioSynth</h1><divclass="controls"><label>Instrument: </label><selectid="instrument-select"><optionvalue="0">Piano</option><optionvalue="1">Organ</option><optionvalue="2">Acoustic Guitar</option><optionvalue="3">EDM</option></select></div><divclass="piano"><divclass="key"onclick="playNote('C', 4)">C</div><divclass="key"onclick="playNote('D', 4)">D</div><divclass="key"onclick="playNote('E', 4)">E</div><divclass="key"onclick="playNote('F', 4)">F</div><divclass="key"onclick="playNote('G', 4)">G</div><divclass="key"onclick="playNote('A', 4)">A</div><divclass="key"onclick="playNote('B', 4)">B</div></div><script src="https://cdn.jsdelivr.net/npm/audiosynth@0.0.5/index.min.js"></script><script>// 1. Create the AudioSynth Instance// AudioSynth is a singleton in this library, accessed via 'Synth'functionplayNote(note,octave){// Get selected instrument ID from the dropdownconstinstrumentId=document.getElementById('instrument-select').value;// Create the instrument (0=Piano, 1=Organ, 2=Acoustic, 3=EDM)constinstrument=Synth.createInstrument(instrumentId);// Play the note: Note Name, Octave, Duration (seconds)instrument.play(note,octave,2);}</script></body></html>