All Projects → ng-web-apis → midi

ng-web-apis / midi

Licence: MIT license
An Observable based library for the use of Web MIDI API with Angular

Programming Languages

typescript
32286 projects
Less
1899 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to midi

PicoAudio.js
A JavaScript library for playing MIDI (Standard MIDI File) on Web.
Stars: ✭ 28 (-20%)
Mutual labels:  midi, webmidi, webaudio, webmidi-api
Scribbletune
Create music with JavaScript
Stars: ✭ 3,509 (+9925.71%)
Mutual labels:  midi, webmidi, webaudio
pacer-editor
Web editor for the Nektar Pacer MIDI controler
Stars: ✭ 16 (-54.29%)
Mutual labels:  midi, webmidi
Eternal
👾~ music, eternal ~ 👾
Stars: ✭ 323 (+822.86%)
Mutual labels:  midi, webaudio
Jzz
MIDI library for Node.js and web-browsers
Stars: ✭ 325 (+828.57%)
Mutual labels:  midi, webaudio
jamhub
low-latency jamming space for musicians
Stars: ✭ 29 (-17.14%)
Mutual labels:  midi, webaudio
learn-push2-with-svelte
Learn chords, scales, and music theory on the Push 2, right inside your web browser!
Stars: ✭ 37 (+5.71%)
Mutual labels:  midi, webmidi
OpenDeck
Software and hardware platform for simpler building of MIDI controllers with support for DMX.
Stars: ✭ 438 (+1151.43%)
Mutual labels:  midi, webmidi
Fsynth
Web-based and pixels-based collaborative synthesizer
Stars: ✭ 146 (+317.14%)
Mutual labels:  midi, webaudio
Signal
A friendly music sequencer built with web technology
Stars: ✭ 166 (+374.29%)
Mutual labels:  midi, webaudio
webaudio-synth
WebAudio Polyphonic Synthesizer
Stars: ✭ 83 (+137.14%)
Mutual labels:  midi, webaudio
abletonpush
A library for working with the Ableton Push in the browser
Stars: ✭ 47 (+34.29%)
Mutual labels:  webmidi, webaudio
webmscore
MuseScore's core library (libmscore) in WebAssembly! Read mscz data, and generate audio/MIDI/MusicXML/SVG/PNG/PDF sheets right in browsers.
Stars: ✭ 91 (+160%)
Mutual labels:  midi, webaudio
microfreak-reader
An application to read and display the presets stored in the Arturia MicroFreak memory.
Stars: ✭ 32 (-8.57%)
Mutual labels:  midi, webmidi
BS2-Web
Novation Bass Station II Web interface
Stars: ✭ 34 (-2.86%)
Mutual labels:  midi, webmidi
Shape-Your-Music
A web application for drawing music.
Stars: ✭ 106 (+202.86%)
Mutual labels:  midi, webaudio
muzikilo.js
A code driven synth for the browser
Stars: ✭ 20 (-42.86%)
Mutual labels:  webmidi, webaudio
Awesome Webaudio
A curated list of awesome WebAudio packages and resources.
Stars: ✭ 685 (+1857.14%)
Mutual labels:  midi, webaudio
wui
Collection of GUI widgets for the web
Stars: ✭ 44 (+25.71%)
Mutual labels:  midi, webmidi
midibus.js
🚌💨🎶 Web MIDI API wrapper based on themidibus
Stars: ✭ 24 (-31.43%)
Mutual labels:  midi, webmidiapi

ng-web-apis logo Web MIDI API for Angular

Part of Web APIs for Angular

npm version npm bundle size Travis (.com) Coveralls github angular-open-source-starter

This library contains abstractions and helpful utils to use Web MIDI API idiomatically with Angular.

Install

If you do not have @ng-web-apis/common:

npm i @ng-web-apis/common

You would also need @types/webmidi package until it is included in TypeScript. Now install the package:

npm i @ng-web-apis/midi

Usage

To use Web MIDI API with your Angular application you can use tokens, RxJs operators and utils included with this package:

Tokens

  • MIDI_SUPPORTboolean value checking browser support
  • SYSEXboolean token responsible for system exclusive access, false by default
  • MIDI_ACCESS — a Promise with MIDIAccess object, depends on SYSEX token for access level
  • MIDI_INPUT — a Promise with MIDIInput. You would need to provide it yourself see utility functions below
  • MIDI_OUTPUT — a Promise with MIDIOutput. You would need to provide it yourself see utility functions below
  • MIDI_MESSAGES — an Observable of MIDIMessageEvent from all MIDIInputs, use rxjs function below to narrow and process the stream

Utility functions

  • You can provide MIDI_INPUT and MIDI_OUTPUT tokens with following functions:

    inputById, inputByName, outputById, outputByName:

import {Component, Inject} from '@angular/core';
import {inputById, MIDI_INPUT, MIDI_OUTPUT, outputByName} from '@ng-web-apis/midi';

@Component({
    selector: 'my-comp',
    template: '...',
    providers: [inputById('input-0'), outputByName('VirtualMIDISynth')],
})
export class MyComponent {
    constructor(
        @Inject(MIDI_INPUT) input: Promise<MIDIInput>,
        @Inject(MIDI_OUTPUT) output: Promise<MIDIOutput>,
    ) {}
}
  • You can convert MIDI note to frequency and back using toFrequency and toNote functions. They optionally accept second argument for tuning of middle A note using 440 as default value
  • You can use frequency pipe from FrequencyPipeModule to convert MIDI note to frequency directly in template

RxJs operators

Monotype operators

These are filtering operators which you can use on MIDI_MESSAGES stream to narrow it to your needs. All of them are applied like that:

messages$.pipe(
    filterByChannel(1),
    aftertouch(),
);
  • filterByChannel only lets through messages from given channel (0 to 15)
  • filterById only lets through messages from particular MIDIInput identifying it by id property
  • filterByName only lets through messages from particular MIDIInput identifying it by name property
  • notes only lets through played notes messages, normalizing noteOff messages to noteOn with 0 velocity
  • aftertouch only lets through aftertouch messages, same logic goes fow all functions below
  • modulationWheel
  • pan
  • pitchBend
  • polyphonicAftertouch
  • programChange
  • sustainPedal

If you believe other operators could be helpful, please file an issue explaining what would you like to be added and why.

Operators

These are used to convert message to something necessary for you, since it turns MIDIMessageEvents to different objects, use it after all monotype operations from the list above have been applied.

Keep in mind some messages might not contain third or even second byte so only use those extractions when you are sure (i.e. filtered the stream to compliant messages beforehand).

Demo

You can try online demo here

See also

Other Web APIs for Angular by @ng-web-apis

Open-source

Do you also want to open-source something, but hate the collateral work? Check out this Angular Open-source Library Starter we’ve created for our projects. It got you covered on continuous integration, pre-commit checks, linting, versioning + changelog, code coverage and all that jazz.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].