1.2.7 • Published 25 days ago

jzz-synth-osc v1.2.7

Weekly downloads
1
License
MIT
Repository
github
Last release
25 days ago

JZZ-synth-OSC

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 npm jsDelivr build Coverage Status

Install

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

Usage

Plain HTML
<script src="JZZ.js"></script>
<script src="JZZ.synth.OSC.js"></script>
//...
CDN (jsdelivr)
<script src="https://cdn.jsdelivr.net/npm/jzz"></script>
<script src="https://cdn.jsdelivr.net/npm/jzz-synth-osc"></script>
//...
CDN (unpkg)
<script src="https://unpkg.com/jzz"></script>
<script src="https://unpkg.com/jzz-synth-osc"></script>
//...
CommonJS
var JZZ = require('jzz');
require('jzz-synth-osc')(JZZ);
//...
TypeScript / ES6
import { JZZ } from 'jzz';
import { OSC } from 'jzz-synth-osc';
OSC(JZZ);
//...
AMD
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');

Using in Node.js with headless Web Audio

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(); });

More information

Please visit https://jazz-soft.net for more information.
Your questions and comments are welcome here.

1.2.7

25 days ago

1.2.6

1 month ago

1.2.5

3 months ago

1.2.4

7 months ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.0

2 years ago

1.1.9

2 years ago

1.2.1

2 years ago

1.1.8

3 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago