New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

midy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

midy

A super-minimalistic MIDI library.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

Midy

GitHub CI Status Code Coverage bundle size npm version

A super-minimalistic MIDI library.

Installation

yarn add midy
# or using npm
npm i midy

Example

import Midy from 'midy';

const midy = new Midy();
if (await midy.requestAccess()) {
	midy.on('noteDown', (note, channel, velocity) => {
		console.log('A key was pressed!', note, channel, velocity);
	});
}

Methods

Method nameParametersDescriptionType
requestAccessnoneRequest access to the Web MIDI API.Promise<boolean>
onevent name string, listener functionRegister an event listener. See Houk APIvoid
offevent name string, listener functionUnregister an event listener. See Houk APIboolean

Events

Event nameDescriptionParameters
noteUpTriggered once a key is released.MIDI note number, MIDI channel number, velocity number
noteDownTriggered once a key is pressed.MIDI note number, MIDI channel number, velocity number
midiMessageRaw MIDI events.MIDI event MIDIMessageEvent

Properties

Property nameDescriptionType
accessMIDI accessMIDIAccess
inputsMIDI inputsMIDIInputMap
outputsMIDI outputsMIDIOutputMap
stateAccess state`'none'

Keywords

midi

FAQs

Package last updated on 12 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts