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-input-uke

SVG MIDI Ukulele
https://github.com/jazz-soft/jzz-input-uke

midi svg ukulele

Last synced: 3 days ago
JSON representation

SVG MIDI Ukulele

Awesome Lists containing this project

README

        

# JZZ-input-Uke
SVG MIDI Ukulele

[![npm](https://img.shields.io/npm/v/jzz-input-uke.svg)](https://www.npmjs.com/package/jzz-input-uke)
[![npm](https://img.shields.io/npm/dt/jzz-input-uke.svg)](https://www.npmjs.com/package/jzz-input-uke)
[![build](https://github.com/jazz-soft/JZZ-input-Uke/actions/workflows/build.yml/badge.svg)](https://github.com/jazz-soft/JZZ-input-Uke/actions)
[![Coverage Status](https://coveralls.io/repos/github/jazz-soft/JZZ-input-Uke/badge.svg?branch=main)](https://coveralls.io/github/jazz-soft/JZZ-input-Uke?branch=main)

## Install
`npm install jzz-input-uke --save`
or `yarn add jzz-input-uke`
or get the full development version and minified scripts from [**GitHub**](https://github.com/jazz-soft/JZZ-input-Uke)

## Usage

##### Plain HTML
```html

//...
```

##### CDN (jsdelivr)
```html

//...
```

##### CDN (unpkg)
```html

//...
```

##### CommonJS
```js
var JZZ = require('jzz');
require('jzz-input-uke')(JZZ);
//...
```

##### TypeScript / ES6

```ts
import { JZZ } from 'jzz';
import { Uke } from 'jzz-input-uke';
Uke(JZZ);
//...
```

## Example HTML
```html

JZZ.synth.Tiny.register('Web Audio');
var out = JZZ().openMidiOut();
var uke = JZZ.input.Uke({ at: "uke_div" });
uke.viewbox(-3.1, -.15, 3.2, 1.35);
uke.transform(1, 3, -3, 1, 0, 0)
uke.connect(out);

```

## API
#### Construction
```js
var uke = JZZ.input.Uke(args);
// or
JZZ.input.Uke.register('My Cool Ukulele', args);
var uke = JZZ().openMidiIn('My Cool Ukulele');
```
`args` is an object with th optional keys:
- `at`: DOM element to insert SVG, or its ID as string; default: the bottom of the page;
- `frets`: number of frets; default: `18`;
- `strings`: tuning; default: `gCEA`;
- `channels`: MIDI channels for each string; default: `[0, 1, 2, 3]`;
- `active`: if `false`, ignore the user interaction; default: `true`

#### Connection
```
var midi_in = JZZ().openMidiIn();
var midi_out = JZZ().openMidiOut();
midi_in.connect(uke);
uke.connect(midi_out);
```