Fallback MIDI-Out implementation
npm install jzz-synth-oscnpm install jzz-synth-osc
yarn add jzz-synth-osc
html
//...
`
##### CDN (jsdelivr)
`html
//...
`
##### CDN (unpkg)
`html
//...
`
##### CommonJS
`js
var JZZ = require('jzz');
require('jzz-synth-osc')(JZZ);
//...
`
##### TypeScript / ES6
`ts
import { JZZ } from 'jzz';
import { OSC } from 'jzz-synth-osc';
OSC(JZZ);
//...
`
##### AMD
`js
require(['JZZ', 'JZZ.synth.OSC'], function(JZZ, dummy) {
// ...
});
`
##### //...
`js
JZZ.synth.OSC().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');
`
Using in Node.js with headless Web Audio
`js
const WAAPI = require('node-web-audio-api');
const JZZ = require('jzz');
require('jzz-synth-osc')(JZZ);
global.window = { AudioContext: WAAPI.AudioContext };
JZZ.synth.OSC()
.or(function() { console.log('Cannot open MIDI-Out!\n'/ + this.err() /); })
.note(0, 'C5', 127, 500).wait(500)
.note(0, 'E5', 127, 500).wait(500)
.note(0, 'G5', 127, 500).wait(500)
.note(9, 'C6', 127, 500).wait(500)
.and(function() { JZZ.lib.closeAudioContext(); });
``