Skip to content

Latest commit

 

History

History

web

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@kabelsalat/web

This package allows you to use kabelsalat anywhere on the web. Example:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="https://unpkg.com/@kabelsalat/[email protected]/dist/index.js"></script>
  </head>
  <body>
    <button id="play">play</button>
    <button id="stop">stop</button>
    <script>
      let code = `saw([55,110,220,330]).lpf( sine(.25).range(.3,.7) )
.mix(2)
.mul(impulse(4).perc(.1).lag(.05))
.add(x=>x.delay(saw(.01).range(.005,.02)).mul(.9))
.add(x=>x.delay(.3).mul(.7))
.fold().mul(.6)
.out()`;
      const { SalatRepl } = kabelsalat;
      const repl = new SalatRepl();
      document.getElementById("play").onclick = () => repl.run(code);
      document.getElementById("stop").onclick = () => repl.stop();
    </script>
  </body>
</html>