Änderungen
Aus Hackerspace Ffm
<script>
context = new AudioContext;
osc = context.createOscillator();
osc.type=osc.SQUARE;
osc.frequency.value = 440;
// osc.start(0);
var gainObj = context.createGain();
gainObj.gain.value = 01;
osc.connect(gainObj);
gainObj.connect(context.destination);
function myFunctionOff() {
document.getElementById("demo").innerHTML = "OFF";
osc.stop(0);
}
function myFunctionOn(f) {
document.getElementById("demo").innerHTML = "ON";
osc = context.createOscillator();
osc.type=osc.SQUARE;
osc.connect(gainObj);
osc.frequency.value = f;
osc.start(0);
}
function myFunctionRange(f) {
document.getElementById("demo").innerHTML = f;
osc = context.createOscillator();
osc.type=osc.SQUARE;
osc.connect(gainObj);
osc.frequency.value = f;
osc.start(0);
}
</script>