Categories
Uncategorized

WebMIDI API in Chrome 43

Last Tuesday Chrome has been updated to version 43, this is the first stable release that has the WebMIDI API built in. Obviously, the WebMIDI API is much faster and more stable than any MIDI plugin that we have seen in the past decade.

Unfortunately, the WebMIDI API is not implemented in Chrome for iOS, nor in any other browser but Chrome. It is not to be expected that other browser vendors will implement the WebMIDI API any time soon.

Fortunately we can use the Jazz plugin in those browsers, and if you use Chris Wilson’s WebMIDIAPIShim you can write your code against the offical WebMIDI API. This means that your project will run both in browsers that have the WebMIDI API implemented, and in browsers that have the Jazz plugin installed.

The WebMIDIAPIShim is called a shim and a polyfill interchangeably. Actually it is both a shim and a polyfill; it is a shim because it intercepts the API calls to the Jazz plugin and converts them to WebMIDI API calls, and it is a polyfill because it adds modern functionality to ‘legacy’ browsers. See also this article on Stackoverflow.

See some examples of what you can do with the WebMIDI API at the heartbeat site.

Categories
es6

es6 destructering

We want to pass a settings object to the constructor of the Data class.

The settings object:

{
  id: 1,
  name: 'John'
}

Without destructering:

class Data{
  constructor(settings){
    this.id = settings.id;
    this.name = settings.name;
  }
}

With destructering:

class Data{
  constructor(settings){
    ({id: this.id, name: this.name} = settings);
  }
}
Categories
javascript midi

heartbeatjs

The heartbeat repository has been moved from bitbucket to github.

The heartbeat site has been updated as well, but I still have to write a lot of documentation.

Please don’t hesitate to send me an email if you have any questions.

Categories
javascript midi

Jazz plugin replaces Java applet

Deprecated, please use Chris Wilson’s WebMIDIAPI Shim

The MIDIBridge code has been rewritten as a wrapper for the Jazz plugin by Sema. It is called JazzMIDIBridge now and you can find the code and documentation on Github: https://github.com/abudaan/JazzMIDIBridge https://github.com/abudaan/JazzMIDIBridge/wiki

This is the first step in phasing out the Java applet in favor of the Jazz plugin. Currently not all functionality of the Java version has been ported over, for instance playing back and recording MIDI files is not yet implemented. I am thinking of using jsmidi for recording and jasmid for playing back MIDI files. Also in this version it is not possible to setup multiple connections, or to daisy chain devices. The Jazz plugin requires a separate instance per connection (see comment of Sema below) and I still have to write the wrapper code for that. Please let me know if you have any problems, suggestions or feature requests!

Categories
javascript midi

Beta version of Jazz plugin supports MIDI in

Deprecated, please use Chris Wilson’s WebMIDIAPI Shim

The Jazz plugin is a MIDI plugin that works in all major browsers. Until now, it supported MIDI out only, but today a new version with MIDI in support was released for testing. Currently this beta version is for Windows only. All major browsers are supported. I made an example that shows you how to setup MIDI connections with the Jazz plugin, see: http://abumarkub.net/jazz/

Categories
java javascript midi

New API in MIDIBridge

Deprecated, please use Chris Wilson’s WebMIDIAPI Shim The new API is an implementation in Java and Javascript of the W3C proposal for MIDI support in browsers by

Jussi Kalliokoski. You can read the proposal here. Besides the API that Jussi proposes, I have also added some extra functionality, notably a Sequencer. The documentation still is very scarce, I will add it bit by bit the coming weeks. Meanwhile the code examples provide useful information on using the new API. All code is available at Github and you can test the code examples online as well: 1. A basic example. code | launch 2. Connects your your computer keyboard to a MIDI output. code | launch 3. Example that lets you select a MIDI input and a MIDI output. code | launch 4. Same example as above, but the MIDI output gets connected directly in Java which results in better playback performance. If your application does a lot of graphical updates on incoming MIDI events, you should use this method. code | launch 5. Select a MIDI file on your local hard drive and play it back on a MIDI output. You can change the instrument as well. code | launch 6. Same example as above, but the MIDI output gets connected directly in Java which results in better playback performance. code | launch 7. Example of how you can send MIDI events generated in Javascript to a MIDI output. code | launch If you come across bugs or issues, or if you have feature requests or other questions, file an

issue on Github, or email me at daniel@abumarkub.net

Categories
javascript midi

MIDI browser plugin

Deprecated, please use Chris Wilson’s WebMIDIAPI Shim I made a NPAPI browser plugin that gives you access to the MIDI devices connected to your computer directly from within your browser. The plugin is built with the

JUCE library. You can download the plugin from Github or directly from here. In the zip you find the plugin file and a simple test page. The comments in main.js explain how to use the plugin and its API. In the README file you’ll find instructions on how to install the plugin in various browsers. Currently on OSX Chrome and Safari are supported, and on Windows Chrome is supported.

Categories
dynamic sound generation javascript midi

Quick experiment with audiolib.js

Via a comment of Ned on this blog, i came to know the impressive library audiolib.js of Jussi Kalliokoski.

I made a quick example of how you can connect the midibridge with an Oscillator, see:

http://abumarkub.net/midibridge/examples/audiolib/

This is just a very basic example, you can do a lot more with audiolib.js, check GitHub for code and documentation.

Categories
java javascript midi

Midibridge using base64 soundfonts, a proof of concept

Deprecated, please use Chris Wilson’s WebMIDIAPI Shim

Michael Deal made a brilliant music theory learning app for Google Chrome using base64 soundfonts. In fact he is not really using the soundfonts itself, but rendered .ogg files that are loaded as base64 files into the html5

Categories
java javascript midi

Playback of midi files added to the midibridge (preview)

Deprecated, please use Chris Wilson’s WebMIDIAPI Shim I made a test version of the midibridge that allows you to playback midi files. This version uses the File API for loading the midi file and a html5 slider for controlling the song position, so it currently only runs in Chrome:

http://abumarkub.net/midibridge/examples/base64.html You can simply drag and drop a midi file (.mid extension) onto the dropbox and the file gets loaded into the applet as a base64 string.