Socket
Book a DemoInstallSign in
Socket

asynth

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asynth

live midi synthesizer

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

asynth

create midi synths with javascript functions

example

var asynth = require('asynth');
var s = asynth(function (note, t) {
    var freq = 440 * Math.pow(2, (note.key - 49) / 12);
    var x = Math.sin(2 * Math.PI * t * freq);
    var y = Math.sin(2 * Math.PI * t * (freq * 2));
    var z = Math.sin(2 * Math.PI * t * (freq / 2));
    return x * 0.6 + y * 0.2 + z * 0.2;
});

s.play();

Now plug in a USB keyboard and it will sound like an organ.

methods

var asynth = require('asynth')

var b = asynth(synth)

Create a new synth out of a synth(note, t) function.

note.key is the number of the key pressed on the synth.

There are some other properties like timestamps for up, down, and start events that you might also want to care about.

Return a baudio instance.

install

With npm do:

npm install asynth

license

MIT

Keywords

midi

FAQs

Package last updated on 29 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts