{"id":840,"date":"2012-05-01T01:51:45","date_gmt":"2012-05-01T00:51:45","guid":{"rendered":"http:\/\/abumarkub.net\/abublog\/?p=840"},"modified":"2015-08-22T13:54:43","modified_gmt":"2015-08-22T12:54:43","slug":"new-api-in-midibridge","status":"publish","type":"post","link":"https:\/\/abumarkub.net\/abublog\/?p=840","title":{"rendered":"New API in MIDIBridge"},"content":{"rendered":"<p><strong>Deprecated, please use Chris Wilson&#8217;s <a target=\"blank\" href=\"https:\/\/github.com\/cwilso\/WebMIDIAPIShim\">WebMIDIAPI Shim<\/a><\/strong> The new API is an implementation in Java and Javascript of the W3C proposal for MIDI support in browsers by<\/p>\n<p><a href=\"http:\/\/avd.io\/#about-me\" title=\"Jussi Kalliokoski W3C proposal for MIDI support in browsers\" target=\"_blank\">Jussi Kalliokoski<\/a>. You can read the proposal <a href=\"https:\/\/gist.github.com\/1752949\" title=\"Jussi Kalliokoski W3C proposal for MIDI support in browsers\" target=\"_blank\">here<\/a>. Besides the API that Jussi proposes, I have also added some extra functionality, notably a Sequencer. The <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/wiki\" title=\"abumarkub MIDIBridge new API documentation\" target=\"_blank\">documentation<\/a> 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 <a href=\"https:\/\/github.com\/abudaan\/midibridge\" title=\"abumarkub MIDIBridge new API code on Github\" target=\"_blank\">Github<\/a> and you can test the code examples online as well: 1. A basic example. <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/blob\/master\/examples\/js\/basic-example.js\" title=\"abumarkub MIDIBridge basic example\" target=\"_blank\">code<\/a> | <a href=\"http:\/\/abumarkub.net\/midibridge\/example\/basic-example.html\" title=\"abumarkub MIDIBridge basic example\" target=\"_blank\">launch<\/a> 2. Connects your your computer keyboard to a MIDI output. <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/blob\/master\/examples\/js\/computer-keyboard.js\" title=\"abumarkub MIDIBridge connect computer keyboard\" target=\"_blank\">code<\/a> | <a href=\"http:\/\/abumarkub.net\/midibridge\/example\/computer-keyboard.html\" title=\"abumarkub MIDIBridge connect computer keyboard\" target=\"_blank\">launch<\/a> 3. Example that lets you select a MIDI input and a MIDI output. <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/blob\/master\/examples\/js\/setup-connections.js\" title=\"abumarkub MIDIBridge setup MIDI connections\" target=\"_blank\">code<\/a> | <a href=\"http:\/\/abumarkub.net\/midibridge\/example\/setup-connections.html\" title=\"abumarkub MIDIBridge setup MIDI connections\" target=\"_blank\">launch<\/a> 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. <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/blob\/master\/examples\/js\/setup-connections-direct.js\" title=\"abumarkub MIDIBridge setup MIDI connections\" target=\"_blank\">code<\/a> | <a href=\"http:\/\/abumarkub.net\/midibridge\/example\/setup-connections-direct.html\" title=\"abumarkub MIDIBridge setup MIDI connections\" target=\"_blank\">launch<\/a> 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. <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/blob\/master\/examples\/js\/play-midifile.js\" title=\"abumarkub MIDIBridge play MIDI file\" target=\"_blank\">code<\/a> | <a href=\"http:\/\/abumarkub.net\/midibridge\/example\/play-midifile.html\" title=\"abumarkub MIDIBridge play MIDI file\" target=\"_blank\">launch<\/a> 6. Same example as above, but the MIDI output gets connected directly in Java which results in better playback performance. <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/blob\/master\/examples\/js\/play-midifile-direct.js\" title=\"abumarkub MIDIBridge play MIDI file\" target=\"_blank\">code<\/a> | <a href=\"http:\/\/abumarkub.net\/midibridge\/example\/play-midifile-direct.html\" title=\"abumarkub MIDIBridge play MIDI file\" target=\"_blank\">launch<\/a> 7. Example of how you can send MIDI events generated in Javascript to a MIDI output. <a href=\"https:\/\/github.com\/abudaan\/MIDIBridge\/blob\/master\/examples\/js\/random-sequence.js\" title=\"abumarkub MIDIBridge play MIDI file\" target=\"_blank\">code<\/a> | <a href=\"http:\/\/abumarkub.net\/midibridge\/example\/random-sequence.html\" title=\"abumarkub MIDIBridge play MIDI file\" target=\"_blank\">launch<\/a> If you come across bugs or issues, or if you have feature requests or other questions, file an<\/p>\n<p><a href=\"https:\/\/github.com\/abudaan\/midibridge\/issues\" title=\"abumarkub MIDIBridge file an issue at Github\" target=\"_blank\">issue on Github<\/a>, or email me at &#100;&#x61;&#110;&#x69;e&#x6c;&#64;&#97;&#x62;&#117;&#x6d;a&#x72;k&#117;&#x62;&#46;&#x6e;e&#x74;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deprecated, please use Chris Wilson&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,8,9],"tags":[],"class_list":["post-840","post","type-post","status-publish","format-standard","hentry","category-java","category-javascript","category-midi"],"_links":{"self":[{"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=\/wp\/v2\/posts\/840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=840"}],"version-history":[{"count":17,"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=\/wp\/v2\/posts\/840\/revisions"}],"predecessor-version":[{"id":1031,"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=\/wp\/v2\/posts\/840\/revisions\/1031"}],"wp:attachment":[{"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abumarkub.net\/abublog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}