Pages

Monday, January 5, 2015

jazz

I told you in July about  a small logo I built for my kids. It is still here.

We still use it -- more than I can say for some already forgotten Christmas toys. We use it a lot.

We use it for logo. We use it to generate G-code for our CNC machine. Now we use it to make music.

Shouts out all around for the community of hackers who brought us HTML5 web audio. The best thing about web audio is that it makes sense. There should be many moneyed interests that benefit from a programmable web.

Our logo now lets kids play musical notes with the 'play' command. Here's an example:

play [ list '4G4' '8F4' '4E4' '4D4' '4C4' '4D4' '4E4' '4C4' ]

'play', of course, is implemented with web audio. My six year old played with 'play' for just a few minutes before going to a cupboard and dragging out a USB MIDI keyboard controller. It was completely obvious to her that music should go into the computer just as easily as it comes out.

Thank heavens for six year olds.

I sat her down to have a little chat. I dread these chats. Granny's dead. Santa's not real. Democrats lost the Senate. The chat I dread most is also one of the most common in our household -- Computers aren't wonderful in the way you are now imagining. It breaks my heart every time.

I told my daughter that we could plug it in but nothing would happen. I said we could run GarageBand, but her expression turned to a scowl before I could even finish speaking. "That's
the confusing program!" she said. She's right. GarageBand has all kinds of problems. One is that
it often crashes for us -- on both iOS and MacOS -- when our four year old wails randomly on the MIDI keyboard.

This is where Chris Wilson, from Google, swoops in to the rescue.

Chris wrote Jazz, a browser plugin for MIDI. Chris is also an author of the more complicated W3C Web MIDI API specification.

It took me only about ten minutes to bang some basic MIDI into our logo using Jazz. I took a stab
at using the native MIDI apparently available in Chrome. More than an evening has already disappeared down that hole at this point.

If you load logo and have the plug-in installed, you can plug in a MIDI keyboard and hear notes
without doing anything -- even reloading the tab. It works as an automatic, trivial keyboard instrument. It tolerates a four year old banging on the keyboard.

Almost nothing else works properly at this point. You can't record MIDI from logo yet. You can't do MIDI output. You can't use the keyboard to control the turtle. I'm not worrried about any of that. That's the easy stuff. The fun stuff!

The hard part was building something that just works. Chris Wilson did that with Jazz and I'm grateful.

MIDI input is not like web audio. It doesn't make automatic sense for folks under 40. That's what makes me especially glad for Jazz. The various moneyed browser folks are still in the wilderness on this one.

The Chrome folks took a swing at MIDI in the browser but haven't quite gotten there yet. The Mozilla folks are still fooling around with game controller support in the browser. I suspect they were smoking some powerful 'set-top box' peyote when they came up with this one. They will
eventually get on board. Apple's still busy not supporting WebRTC. They will get their act together once they realize that MIDI keyboards don't have an escape key.

MIDI in the browser is solid gold. With MIDI and logo together in the browser, I feel like I'm getting the band back together from the '80s. It feels good, though we're having a bit of trouble coaxing the KoalaPad out of retirement to play bass.


No comments:

Post a Comment