📜 ⬆️ ⬇️

We write music on JavaScript

image

I invite all fans of electronic music and programming, to play in the synthesis of melodies using Code Music Studio .
The bottom line is as follows:
You need to create a function that takes an argument time, 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; } 
[listen]

You can take something from studio.substack.net/-/recent as a basis.
for example polytropon , SuperMario .
')
Under the hood:
github.com/substack/code-music-studio
The baudio audio API is used .
Graphics - SVG, rendered using the amplitude-viewer module.
As http-server NodeJS http API , and ecstatic for static.

And finally, a little video (in English):



Source: https://habr.com/ru/post/219973/


All Articles