Writing Music in JavaScript


    I invite all lovers of electronic music and programming to play in the synthesis of tunes using Code Music Studio .
    The bottom line is:
    You need to create a function that takes a time argument and returns an amplitude in the range from -1 to 1, for example:
    var n = 0;
    return function (t) {
        var x = Math.sin(t * 256 + Math.sin(n));
        n += Math.sin(t);
        return x;

    You can take as a basis something from studio.substack.net/-/recent
    for example polytropon , SuperMario .

    Under the hood:
    Uses the baudio audio API .
    Graphics - SVG, rendered using the amplitude-viewer module .
    As the http server NodeJS http API , and ecstatic for statics.

    And finally, a little video (in English):

    Also popular now: