Raspberry Pi Plays MIDI Without An Operating System

[youtube=http://www.youtube.com/watch?v=k6TCysv6AzE&w=580]

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.

Tired Of Playing The MacBook? Play The Raspberry Pi!

pithingy

Hit up any club, party, or get together where musicians are present and you’ll probably find a DJ booth stacked to the gills with faders, various MIDI devices, and a MacBook. However abundant an OS X-based DJ platform is, we haven’t heard hide nor hare of a Raspberry Pi being used as a sequencer, MIDI device, or MaxMSP box.

[James] over at Illuminated Sound put together a great tutorial for making all those cool electronic music devices play nice with a Raspberry Pi. He used a Novation Launchpad, an 8×8 MIDI controller that can act as faders, a keyboard, or even a functional equivalent to the pads on an MPC.

Hardware is nothing without software, so [James] used Puredata and libusb to turn the MIDI data into notes and audio effects.

[James] added a download that includes the Launchpad driver and a Puredata sketch to test everything out. You can see how it all fits together in the video after the break.

Continue reading “Tired Of Playing The MacBook? Play The Raspberry Pi!”

Turning Toy Pianos Into MIDI Keyboards

Building a MIDI device is always a great microcontroller project, and nearly everyone has an old toy keyboard lying around in the back of a closet or in the basement. [JenShen] decided to take one of these toy keyboards and build a MIDI keyboard.

The keyboard [JenShen] used was a simple Casio keyboard with built-in voices. After tearing out the guts of the keyboard, the only thing that remained is the row of push buttons underneath the keys. These buttons were laid out in a row/column matrix, so [JenShen] needed to decode this matrix before sending the result to an Arduino for processing.

A 74HN595 shift register was used to read the 8 rows of buttons underneath the keys, while the rows were tied to different input pins on the ‘duino. This allowed [JenShen] to scan the keyboard matrix with an Arduino and generate MIDI notes and send them to other synths.

In the video after the break, you can check out [JenShen]’s circuit and code that allowed him to turn a toy keyboard into a proper 32-note MIDI keyboard. It’s not velocity sensitive, but he says he’ll show everyone how to accomplish that in a future post.

Continue reading “Turning Toy Pianos Into MIDI Keyboards”

Homebrew Guitar Tuner Also Includes MIDI Out

A few years ago, [Frédéric]’s brother in law wanted a guitar tuner for Christmas. Instead of going out and buying one, [Frédéric] broke out the soldering iron and built one from scratch.

[Frédéric]’s tuner is built around an ATMega168 uC on a Real Bare-Bones Board with an LM386 amplifier. The display is a standard 20×2 LCD character display, and the interface is torn from the pages of stomp box schematics with a very hefty foot switch.

Detecting the frequency of a note played into [Frédéric]’s tuner involves a fair bit of math. To measure the frequency, the Arduino samples the waveform coming from the input jack. This signal is delayed for a fraction of a second and the area underneath the real and delayed waveforms is measured. This delay slides across the original waveform until the area between the real and delayed samples are minimized. At that point, delayed wave form will be exactly one cycle behind the real signal, and the cycles per second can be calculated. It’s called the YIN algorithm, and you can read more about it here.

Since [Frédéric] already knew the exact frequency being played into the tuner, he figured it would be trivial to add a small analog audio to MIDI converter. This feature (as shown in the video after the break) turns the sounds from a guitar into MIDI notes. It’s monophonic and probably a little superfluous, but still very cool.

Continue reading “Homebrew Guitar Tuner Also Includes MIDI Out”

Typing With A MIDI Drum Set

[Autuin] picked up the drums at the age of 18, but by his own admission he’s no [Bonzo], [Buddy Rich] or [Ringo]. Practicing always seems to fall off the end of his to-do list, and there really is only one way to Carnegie Hall. One thing [Autuin] is really fast at is typing, so he figured he could improve his drumming skills by banging a few paragraphs out.

The core of the build is a Yamaha DTX drum module, a MIDI-to-USB adapter, and little light coding. Basically, [Autuin] made a chorded keyboard out of his drums; by hitting one (or two, or three) drum heads at the same time, he can type characters in Open Office.

For going outside the comfort zone of a steady rock beat, we’re thinking [Autuin]’s build might just be useful. He’ll be displaying his Keyboard/Drum mashup at Vancouver’s East Side Culture Crawl alongside a horrible device of artistic merit. If you promise not to break anything, drop in on him in a few weeks.

Vidia after the break.

Continue reading “Typing With A MIDI Drum Set”

A Harpsichord That Plays Itself

[Malcolm Messiter] is an Oboe player who loves to play pieces from the Baroque era. This often means playing with a Harpsichord and he managed to acquire one to call his very own. Unfortunately you can’t play both instruments at once so he set out to automate the keyboard. What you see here is a fully working version, but he soon went on to add solenoids to the upper rank as well. His story starts on page 27 of this newsletter (PDF).

He really went out of his way to make sure the instrument was not mistreated. A cabinet-maker built some brackets to mount the system above the keys. A friend drilled and tapped a sheet of acrylic to which each solenoid was mounted. The solenoid shafts have each been padded with felt to cushion the blow on the keys. We’ve embedded two demo video after the break that show off the first and second versions of the builds.

Harpsichords pluck the strings instead of hitting them with a hammer as the piano does. The mechanism that does the plucking had worn out on many of the keys so [Malcolm] used a 3D printer to help replace them.

Continue reading “A Harpsichord That Plays Itself”

MIDI Man-in-the-middle Hack Lets You Add Pedal To The Mix

[Sebastian] has a friend who would like to use a pedal with his MIDI setup, but his keyboard doesn’t support one. Some might interpret that as a sign you need to buy a new keyboard. But [Sebastian] has already done a lot of work with the MIDI protocol. He knew it should be possible to create a MIDI pass-through which adds support for a pedal.

You can see the two MIDI cables connected to the box above. One is the input from the keyboard, the other is the output to the synthesizer. There is also a jack for a pedal input to the left. The chip inside intercepts each packet, rolling in values based from the pedal input and passing on the altered packets to the synthesizer. As you can hear in the video after the break, this works like a charm.

Catch more of [Sebastian’s] midi work by following his keyboard sensor replacement projects.

Continue reading “MIDI Man-in-the-middle Hack Lets You Add Pedal To The Mix”