/JZZ-synth-Tiny

Tiny Web-Audio GM Synthesizer

Primary LanguageJavaScript

JZZ-synth-Tiny

npm npm Try jzz-synth-tiny on RunKit

Tiny Web-Audio GM Synthesizer (g200kg/webaudio-tinysynth) wrapped for JZZ.js

Please check the demo...

Install

npm install jzz-synth-tiny
or bower install jzz-synth-tiny
or yarn add jzz-synth-tiny
or get the full development version and minified scripts from GitHub

Usage

Plain HTML
<script src="JZZ.js"></script>
<script src="JZZ.synth.Tiny.js"></script>
//...
CDN (jsdelivr)
<script src="https://cdn.jsdelivr.net/npm/jzz"></script>
<script src="https://cdn.jsdelivr.net/npm/jzz-synth-tiny"></script>
//...
CDN (unpkg)
<script src="https://unpkg.com/jzz"></script>
<script src="https://unpkg.com/jzz-synth-tiny"></script>
//...
CommonJS
var JZZ = require('jzz');
require('jzz-synth-tiny')(JZZ);
//...
AMD
require(['JZZ', 'JZZ.synth.Tiny'], function(JZZ, dummy) {
  // ...
});

API

Play directly
JZZ.synth.Tiny().noteOn(0, 'C5', 127)
   .wait(500).noteOn(0, 'E5', 127)
   .wait(500).noteOn(0, 'G5', 127)
   .wait(500).noteOff(0, 'C5').noteOff(0, 'E5').noteOff(0, 'G5');
Register as MIDI port
JZZ.synth.Tiny.register('Web Audio');

JZZ().openMidiOut('Web Audio').noteOn(0, 'C5', 127)
   .wait(500).noteOn(0, 'E5', 127)
   .wait(500).noteOn(0, 'G5', 127)
   .wait(500).noteOff(0, 'C5').noteOff(0, 'E5').noteOff(0, 'G5');

To make vitual port visible by Web MIDI API, please check https://github.com/jazz-soft/JZZ#virtual-midi-ports

More information

Please visit https://jazz-soft.net for more information.