Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jazz-soft/jzz-synth-osc

Fallback MIDI-Out implementation
https://github.com/jazz-soft/jzz-synth-osc

audio midi web-audio web-audio-api web-midi web-midi-api webaudio webaudioapi webmidi webmidiapi

Last synced: about 1 month ago
JSON representation

Fallback MIDI-Out implementation

Awesome Lists containing this project

README

        

# 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](https://www.npmjs.com/package/jzz-synth-tiny) instead.

[![npm](https://img.shields.io/npm/v/jzz-synth-osc.svg)](https://www.npmjs.com/package/jzz-synth-osc)
[![npm](https://img.shields.io/npm/dt/jzz-synth-osc.svg)](https://www.npmjs.com/package/jzz-synth-osc)
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/jzz-synth-osc/badge)](https://www.jsdelivr.com/package/npm/jzz-synth-osc)
[![build](https://github.com/jazz-soft/JZZ-synth-OSC/actions/workflows/build.yml/badge.svg)](https://github.com/jazz-soft/JZZ-synth-OSC/actions)
[![Coverage Status](https://coveralls.io/repos/github/jazz-soft/JZZ-synth-OSC/badge.svg?branch=master)](https://coveralls.io/github/jazz-soft/JZZ-synth-OSC?branch=master)

## Install

`npm install jzz-synth-osc`
or `yarn add jzz-synth-osc`
or get the full development version and minified scripts from [**GitHub**](https://github.com/jazz-soft/JZZ-synth-OSC)

## Usage

##### Plain HTML

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

## More information

Please visit [**https://jazz-soft.net**](https://jazz-soft.net) for more information.
Your questions and comments are welcome [**here**](https://jazz-soft.org).