Raspberry Pi plays MIDI without an operating system

For all the interesting DSP functions locked away in the Raspberry Pi, it’s still hard to imagine using the Raspberry Pi as an eminently capable software synthesizer, tracker, or sequencer. Running any of the usual Linux digital audio programs means – surprise – running Linux, and the performance penalty associated with that.

It would be much better if all these audio programs could run directly on the Raspberry Pi without an operating system, and [Joe]‘s project is right up that alley. He’s playing MIDI files without an operating system, in effect making the Raspberry Pi a very powerful embedded platform.

[Joe]‘s build is the first bare metal audio code for the Raspberry Pi. It’s actually an LV2 plugin host that will load audio plugins, read MIDI files, and shoot the resulting audio out over the 1/8″ jack on the Pi. ┬áThis work wouldn’t have been possible without a few Raspberry Pi bare metal tutorials┬áput together by [David Welch].

Hopefully this won’t be the last we’ll see of [Joe] and his code; the Raspberry Pi has more than enough horsepower to be an amazing sampler, synth, beat machine, or the next generation of Akai MPC. All we need are a few brave coders to take up coding bare metal on the Raspberry Pi.

11 thoughts on “Raspberry Pi plays MIDI without an operating system

  1. Now we’re talking. I like how you guys put that crapshoot raspi project up yesterday and then pwned it with this one today.

  2. Dex: That’s cool, looking forward to seeing it. Did you manage to set the clock source for the PWM to one of the PLLs? It didn’t seem to work when I tried it, so I’m using the ‘oscillator’ source, which gives pretty lousy quality.

    1. I am having the same problems as you (can not get PLLs working in bare metal), but i am working on it ;), will release demo and code as soon as i get to the bottom of it.
      I have improved the sound quality a bit (still only can only play 8bit wav’s)
      Heres a kernel.img if you want to hear it

      http://www.dex-os.com/ARM/pi-sound.zip

      Really like your bare metal midi player, maybe i will get round to porting it to DexOS
      one day.

      1. Awesome, sounds funky.

        So, I’m now hoping I can neglect the PLL issue for now and somebody else will work it out for me.

        On a similar note, at some point I’d also really like to get a filesystem working on this (at the moment everything’s statically linked into the kernel). I think you mentioned on the rpi forums that you were going to port your fasm filesystem functions to gnu asm. This would be really for handy me at some point, if you’re still planning to do it. I don’t have time to work on this for a bit though, so no rush.

  3. What is this nonsense? Linux is a very lean kernel indeed and does not steal your precious cpu cycles if so configured.
    I’m not saying there’s anything wrong in coding for “bare metal”.

    1. It’s true, you can set your Linux program to run as SCHED_FIFO and you won’t lose cycles to other processes.

      My reasons for doing this were broadly: I might want to port it to non-Linuxy platforms like Stellaris; musical instruments with long boot times are annoying and potentially disruptive when performing; a whole Linux distro just seems excessively big and complicated for the task; it was fun. Preserving my precious CPU cycles was never really the point.

  4. Bare metal. There’s a term I haven’t encountered for quite a while, since the days of self booting games on the IBM 5150.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s