Skip to content

Instantly share code, notes, and snippets.

@MagnusThor
Created July 4, 2015 16:50
Show Gist options
  • Select an option

  • Save MagnusThor/c1e79e0bcd7cd24ce319 to your computer and use it in GitHub Desktop.

Select an option

Save MagnusThor/c1e79e0bcd7cd24ce319 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Old Guys Rule | Man Myth Legend</title>
<link href="css/default.css" rel="stylesheet" />
<script>
var basePath = "/audio/";
var Effects = {};
</script>
</head>
<body>
<canvas id="surface"></canvas>
<script src="js/lib/noc/Noc.beta.js"></script>
<script src="js/lib/scriptProcessor.js"></script>
<script src="app/effects.js"></script>
<script src="js/lib/tinysid.js"></script>
<script>
var engine;
var assets;
var audio;
var mml = function (evt) {
ScriptNodePlayer.createInstance(new SIDBackendAdapter(), "/audio/", [], true, function() {
},
function () {
this.play();
}, function(parameters) {
console.log("doOnTrackEnd");
});
engine = new Noc.Engine("#surface");
audio = new Noc.Audio();
engine.start();
ScriptNodePlayer.getInstance().loadMusicFromURL("Spijkerhoek_3.mp3", { basePath: "/audio/" }, function () {
engine.addEntity(new Effects.Plasma());
var spectrum = new Effects.Spectrum(ScriptNodePlayer.getInstance()._scriptNode);
engine.addEntity(spectrum.entity);
var fade = new Effects.Fade();
fade.onlifetimeend = function() {
console.log("!");
engine.removeEntity("fade");
engine.removeEntity("plasma");
engine.addEntity(new Effects.Fractal());
};
engine.addEntity(fade);
// engine.addEntity(new Effects.SomeFx());
});
}
document.addEventListener("DOMContentLoaded",
mml
);
var p, snd;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment