Skip to content

Instantly share code, notes, and snippets.

@mpmckenna8
Created September 26, 2016 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpmckenna8/4c091d351d22a396a9fb8dc16709f4a5 to your computer and use it in GitHub Desktop.
Save mpmckenna8/4c091d351d22a396a9fb8dc16709f4a5 to your computer and use it in GitHub Desktop.
Very simple noisy javascript

So this is a real simple page to make noise with just some javascript:

<html>
<head>
<link rel="stylesheet" href="style/main.css" />
<title> The simplest HTML example
</title>
</head>
<body>
<h1> This is an HTML Page in which some javascript makes noise.</h1>
<script src="noisey.js"></script>
</body>
</html>
var audioCon = new AudioContext();
var start = audioCon.currentTime + .2;
var oscillate = audioCon.createOscillator();
oscillate.type = 'triangle';
oscillate.connect(audioCon.destination);
oscillate.start(start);
oscillate.stop(start + 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment