A simple MIDI-Out implementation for the systems with no better option available.
Mainly, for use as a template for your own JZZ-compatible synths.
For real world applications,
please consider using JZZ-synth-Tiny instead.
npm install jzz-synth-osc
or yarn add jzz-synth-osc
or get the full development version and minified scripts from GitHub
<script src="JZZ.js"></script>
<script src="JZZ.synth.OSC.js"></script>
//...
<script src="https://cdn.jsdelivr.net/npm/jzz"></script>
<script src="https://cdn.jsdelivr.net/npm/jzz-synth-osc"></script>
//...
<script src="https://unpkg.com/jzz"></script>
<script src="https://unpkg.com/jzz-synth-osc"></script>
//...
var JZZ = require('jzz');
require('jzz-synth-osc')(JZZ);
//...
import { JZZ } from 'jzz';
import { OSC } from 'jzz-synth-osc';
OSC(JZZ);
//...
require(['JZZ', 'JZZ.synth.OSC'], function(JZZ, dummy) {
// ...
});
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');
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(); });
Please visit https://jazz-soft.net for more information.
Your questions and comments are welcome here.