npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jzz-gui-select

v1.1.3

Published

Select MIDI port

Downloads

96

Readme

JZZ-gui-Select

MIDI Input/Output pickers for HTML projects

Firefox Chrome Opera Safari Internet Explorer Edge
npm npm build Coverage Status

MIDI pickers
See the demo...

Install

npm install jzz-gui-select --save
or yarn add jzz-gui-select
or get the full development version and minified scripts from GitHub

Usage

Plain HTML
<script src="JZZ.js"></script>
<script src="JZZ.gui.Select.js"></script>
//...
CDN (jsdelivr)
<script src="https://cdn.jsdelivr.net/npm/jzz"></script>
<script src="https://cdn.jsdelivr.net/npm/jzz-gui-select"></script>
//...
CDN (unpkg)
<script src="https://unpkg.com/jzz"></script>
<script src="https://unpkg.com/jzz-gui-select"></script>
//...
CommonJS
var JZZ = require('jzz');
require('jzz-gui-select')(JZZ);
//...
AMD
require(['JZZ', 'JZZ.gui.Select'], function(JZZ, select) {
  // ...
});

Example

<select id=select_midi_in></select>
<select id=select_midi_out></select>

<script>
var midi_in = JZZ.gui.SelectMidiIn({ at: 'select_midi_in' });
var midi_out = JZZ.gui.SelectMidiOut({ at: 'select_midi_out' });
// direct MIDI stream from midi_in to midi_out:
midi_in.connect(midi_out);
</script>

API

All calls are identical for both Input/Output pickers except of the In/Out name suffixes where appropriate.

constructor

JZZ.gui.SelectMidiIn(options)
JZZ.gui.SelectMidiOut(options)

Can be used with or without the new keyword.
options is the obect with the following properties:

  • at: (required) HTML DOM <SELECT> object to be associated with the picker.
    Either a DOM obect or its string ID.
  • none: text string for the "no port opened" option.
    Default: '=== NONE ==='
select

midi_in.select(arg)
midi_out.select(arg)

Programmatically select MIDI port.
arg is an option name or any other argument accepted by JZZ().openMidiIn(arg) or JZZ().openMidiOut(arg).
e.g.:

// select the "no port" option and close the current port if it was open:
midi_in.select('=== NONE ===');
midi_out.select(); // open the default MIDI-Out port.
standard calls

MIDI Input/Output pickers are regular JZZ MIDI nodes, and therefore, can be used with all standard calls.
e.g.:

midi_in.connect(function(msg) { console.log('MIDI received: ' + msg); });
midi_out.noteOn(0, 'C#5', 127).wait(500).noteOff(0, 'C#5');
// etc...
user hooks

midi_in.onSelect(name)
midi_out.onSelect(name)

Called when the MIDI port is successfully selected; name is the port name.
e.g.:

midi_in.onSelect = function(name) {
  console.log('MIDI-In selected:', name);
};
midi_out.onSelect = function() {
  this.noteOn(0, 'C#5', 127).wait(500).noteOff(0, 'C#5');
};

More information

Please visit https://jazz-soft.net for more information.