Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jazz-soft/jazz-midi-electron
MIDI for Electron
https://github.com/jazz-soft/jazz-midi-electron
electron midi midi2
Last synced: 3 months ago
JSON representation
MIDI for Electron
- Host: GitHub
- URL: https://github.com/jazz-soft/jazz-midi-electron
- Owner: jazz-soft
- License: mit
- Created: 2018-01-21T20:04:56.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-27T01:18:20.000Z (6 months ago)
- Last Synced: 2024-06-29T18:21:03.490Z (4 months ago)
- Topics: electron, midi, midi2
- Language: JavaScript
- Homepage:
- Size: 134 KB
- Stars: 24
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- awesome-javascript-audio - jazz-midi-electron - WebMIDI API for Electron (Libraries: Web MIDI API / Web MIDI API)
README
# jazz-midi-electron
[![npm](https://img.shields.io/npm/v/jazz-midi-electron.svg)](https://www.npmjs.com/package/jazz-midi-electron)
[![npm](https://img.shields.io/npm/dt/jazz-midi-electron.svg)](https://www.npmjs.com/package/jazz-midi-electron)
[![build](https://github.com/jazz-soft/jazz-midi-electron/actions/workflows/build.yml/badge.svg)](https://github.com/jazz-soft/jazz-midi-electron/actions)
[![Coverage Status](https://coveralls.io/repos/github/jazz-soft/jazz-midi-electron/badge.svg?branch=master)](https://coveralls.io/github/jazz-soft/jazz-midi-electron?branch=master)## MIDI for Electron
MIDI integration in [**Electron**](https://electronjs.org) applications.
( see also: [jazz-midi-vscode](https://github.com/jazz-soft/jazz-midi-vscode) ... )
*Notice:* v2.x.x introduces some breaking changes,
however, upgrading old projects from v1.x.x will well worth the trouble.
You are getting:
- fewer dependencies
- improved code security
- no additional installs required## Examples
[**sample-midi-piano**](https://github.com/jazz-soft/jazz-midi-electron/tree/master/sample-midi-piano)
[![screenshot](https://raw.githubusercontent.com/jazz-soft/jazz-midi-electron/master/sample-midi-piano/screenshot.png)](https://github.com/jazz-soft/jazz-midi-electron/tree/master/sample-midi-piano)[**sample-midi-player**](https://github.com/jazz-soft/jazz-midi-electron/tree/master/sample-midi-piano)
[![screenshot](https://raw.githubusercontent.com/jazz-soft/jazz-midi-electron/master/sample-midi-player/screenshot.png)](https://github.com/jazz-soft/jazz-midi-electron/tree/master/sample-midi-player)## Install
`npm install jazz-midi-electron --save`## Usage
( see the examples above... )### Main Process
```js
const JZZ = require('jzz');
// jazz-midi-electron is not required if using MIDI only in the Main Process
// ...
JZZ().openMidiOut() // ...
```
Main Process can use [**JZZ.js**](https://github.com/jazz-soft/JZZ) as normal Node.js application.
It can access regular MIDI ports and create virtual ports.### Browser Window
```html
// ...
JZZ().openMidiOut() // ...
```
```js
// when creating the Browser Window:
const JME = require('jazz-midi-electron');
// ...
win = new BrowserWindow({
// ...
webPreferences: { // see the preload.js in this repository
preload: path.join(__dirname, 'preload.js')
}
});
JME.init(win);
// ...
```
Browser Window will see all MIDI ports (including virtual) available to the Main Process.
It can create additional Web Audio and HTML-based MIDI ports
(see [jzz-synth-tiny](https://github.com/jazz-soft/JZZ-synth-Tiny) and [jzz-input-kbd](https://github.com/jazz-soft/JZZ-input-Kbd)).