Raspberry Pi – AirPiano

Wouldn’t it be cool if you could control your MIDI equipped digital piano from your iPhone?  Imagine a player piano capable of jukebox queuing up MIDI or Audio files and playing them in order.  That was my goal!  RPI to the rescue.

RaspiModelB

Required Ingredients:

  • Raspberry Pi – Model B, 512MB RAM, 16GB SD Card, Raspbian Linux, Apple 12W USB Power Adapter, USB WiFi Dongle
  • USB MIDI Digital Device (e.g. Yamaha Clavinova CLP-440 with USB MIDI port and RCA L+R Audio Inputs)
  • Software:  Apache HTTP Server, PHP, MySQL, (Nice to have:  Netatalk file server, Shairport AirPlay server)

Instructions:

My original thought was to turn the Yamaha speakers into a AirPlay device for our many iOS devices.  It’s nice to pipe in background tunes without having to hook up a device.  AirPlay is great way to do that but I didn’t want to spend $100+ to be able to do that.  The Raspberry Pi is more than capable of doing this. I found an extremely helpful blog post here:  http://www.raywenderlich.com/44918/raspberry-pi-airplay-tutorial

NOTE: Power is a big issue for the Raspberry Pi.  If you are using a WiFi dongle or any other USB device, I recommend making sure your power supply has enough kick to keep the RPI going.   I started out with a microUSB adapter that advertised 700mA but performance became very unstable, especially under load.  I switched to a 12W Apple adapter that I had handy and the problems disappeared.   The RPI FAQ recommends 1.2A (1200mA).

Setup for AirPiano – MIDI Control

The Project Code: https://github.com/jasonacox/raspberrypi

  • MySQL: Database ‘piano’ – see piano.sql file
  • Dequeue Service: Run the cron.sh script to have the RPI scan for new midi or wave files to play. Run it with:
bash -x cron.sh 0<&- 1>/dev/null 2>/dev/null &
  • Apache: Install apache http with mod_php and mysql support
  • Website Code: Install index.php, setup.php and the folder.png files into the document root of your webserver. Upload the MIDI (*.mid) and WAVE (*.wav) files to this location. Be sure to update $globalBase in setup.php to the folder where these files are located.

 

AirPlay via Raspberry Pi

Adam Burkepile has the best tutorial I’ve found on how to set up a RPI for AirPlay:

http://www.raywenderlich.com/44918/raspberry-pi-airplay-tutorial

Apple Share (AFP) Server via Raspberry Pi

The RPI is great for a tiny file server!  At the least, having it run an AFP server will allow quick drag and drop transfer from your Macs.  A Samba service for Windows shares is easy to set up as well.

sudo apt-get install netatalk

Yes, it is that easy.  Finder will now show your Raspberry Pi under “shared” along with any other local network shares:

Screen Shot 2013-12-27 at 11.22.08 PM

 

 

 

 

Yamaha Clavinova CLP-440

I wanted a music workstation synthesizer and my wife wanted a real acoustic piano that looks like beautiful furniture.  We compromised by getting the Yamaha Clavinova CLP-440.  It looks, sounds and feels like a real piano with enough tech (MIDI, USB, voices) to make a armchair techy musician like me happy.  The PDF documentation covers most of the details you will need to start using the nice features, but there are a few things lacking so I’ll record some of my discoveries in this post.

USB Files

The piano has a USB port that will easily accommodate a thumb drive or external hard drive.  It stores and reads MIDI and WAV files.

Files created by the Clavinova will be stored in the “User Files” folder with a name USERSONG??.MID for MIDI files and USERAUDIO??.WAV for Audio files saved from the Clavinova.  The ?? is the number of the song selected from the Clavinova LED interface.  Here is an example listing of files on the USB drive:

USB Host with iPad

I wanted to be able to use my iPad to link to the piano for added voices and sequencing.  There are several MIDI options available for the iPad, but since the CLP-440 has a USB host port, I was able to use an iPad camera kit (essentially an adapter to allow the iPad to view pictures from a SD card or USB camera).   The Apple version and third party version should work fine.  Using that, I found that several apps could see and control the CLP-440.

iPad Apps for the CLP-440

Searching the Apple iTunes store for app to work with the Clavinova wasn’t easy.  I’ll record a few good apps that I found.

GarageBand
http://itunes.apple.com/us/app/garageband/id408709785?mt=8 – This $5 app from Apple is amazing on its own but it works great with MIDI from the Clavinova.

Midi Monitor
http://iosmidi.com/apps/midi-monitor/ – This app shows the iPad connecting to the Clavinova and the events coming from the keyboard (as well as driving action back to the keyboard through the iPad interface).  Useful for troubleshooting.

Alchemy mobile Synth App
http://www.camelaudio.com/AlchemyMobile.php – This great app from CamelAudio adds a great selection of synth voices to be controlled by the Clavinova.  As their site says, “Turn your iPhone/iPad into a powerful synthesizer! Alchemy Mobile includes everything from evolving soundscapes and fat basses to lush pads and pulsing arpeggios, and is available for free from the iTunes App store.”

 

 

Disney War

Author, James B. Stewart, provides a chronological account of the Walt Disney Company during the Eisner 20-year tenure.  This book of nearly 600 pages dives in to the details of the events, players, tragedies and successes that surrounded the on-boarding of Michael Eisner, his career as Chairman and CEO, and the drama surrounding his departure. 

The book is divided into three sections: The Wonderful World of Disney, The Disenchanted Kingdom, and Disney War. 

Walt Disney: The Triumph of the American Imagination

Walt Disney: The Triumph of the American Imagination by Neal Gabler (2006).

While I haven’t read every biography of this famous visionary, this book about Walt Disney has to be one of the most comprehensive studies of his life.  The attention to detail and depth of research and investigation are exceptional.  The references, notes and bibliography comprise around 100 pages of the 880 page, 2.8 pound volume.

Animation is creating the illusion or alternate reality of life (see the Wikipedia article Disney Animation: The Illusion of Life).   Gabler describes how Walt had an insatiable desire to bring a perfect alternate reality to life.  This steered his passions and energy throughout his life.  Through animation, Walt could project joy, hope, struggles, persistence and emotion onto the two dimensional world of the silver screen.  His desire for perfection demanded quality and innovation.  From the early shorts where he pioneered new levels of animation and synchronized sound (Steamboat Willie) to the realism of Snow White and the Seven Dwarfs, the first American animated feature film in movie history, Walt wanted to bring a new level of entertainment to the masses.  He was shaping a reality that would stir people, cause them to laugh and to cry, to enjoy and to aspire. 

Walt was never happy with status-quo.  With the success of Snow White fueling his dreams, he built the Burbank studio to bring to life something even greater.  With Walt pushing for greater realism in animation, Pinnochio and Bambi were trying to exceed Snow White.  But his heart was always leaning toward something grander.  Consistently Walt would become bored with what he had mastered and would need to push through some new wall.  After Snow White, that would be Fantasia.  He wanted to bring music to life on the animated screen.  This new feature would pioneer an early stereophonic technology called Fantasound, making Fantasia the first commercial film with multichannel sound.  The film opened to mixed critical reaction and failed to generate a large commercial audience, which left Walt in financial straits, something that characterized most of his life, at least until Disneyland.  Author, Neal Gabler comments about this in a Q&A session on Amazon.com:

It is astonishing that Walt Disney was always–and I do mean always–in dire financial straits until the opening of Disneyland. The primary reason wasn’t that his cartoons weren’t making money, because they were–at least until the war in Europe when the loss of that market meant disaster for the features. But even as they were making money, the studio was losing money because Walt was constitutionally incapable of cutting corners, enforcing economies, laying off staff. The only thing about which Walt Disney cared was quality. He thought that quality was the way to maintain his preeminence, though quality also had the psychological advantage of letting him perfect his world. The problem was that quality was expensive. To cite just one example, Walt spent more than a hundred thousand dollars setting up a training program for would-be animators, though even then the return was small because Walt was so picky that very few of the candidates actually qualified to work at the studio. Money meant very little to Walt Disney. It was only a means to an end, never an end in itself.

After Fantasia, Walt needed something new but instead found himself trying to manage and sustain his studio.  The creative “family” he had created over the years turned on him with a strike and the unrelenting creditors demands soon steered him toward survival mode.  Walt and his brother Roy managed to keep the studio together, but at a cost of quality.  Economically produced features like Dumbo and a long string of government sponsored shorts and educational films helped float the studio through hard financial times.  Walt was unhappy in his new role.  Instead of inventing something new, Walt invested in new hobbies, backyard railroad and minatures (from Wikipedia):

During 1949, Disney and his family moved to a new home on a large piece of property in the Holmby Hills district of Los Angeles, California. With the help of his friends Ward and Betty Kimball, owners of their own backyard railroad, Disney developed blueprints and immediately set to work on creating a miniature live steam railroad for his backyard. The name of the railroad, Carolwood Pacific Railroad, originated from the address of his home that was located on Carolwood Drive.

Walt’s passion for the railroad and building miniatures was intertwined with his next great adventure in creating a new reality:  Disneyland.  To dislocate from the now mundane pressures at the Studio, Walt poured renewed energy into his newly formed WED Enterprises to dream and create Disneyland.  This would occupy his focused interest for several years of planning, financing, constructing and operating (with Walt taking personal attention to details and continually “plussing” the park).   Walt loved to meet a challenge and financing Disneyland was definitely a challenge.  However, he had a solution:  Television.   Walt led the charge to bridge the gap between film studios and television.  He has been fascinated with the new medium and his Disneyland idea propelled his desire to enter this new world.  Using a series called Disneyland  and later after the opening of the park, Walt Disney Presents that aired on ABC, Walt would personally host the show that consisted of cartoons, live-action features, and documentaries.  Much of the material was designed to create awareness for Disneyland but was also used to promote upcoming studio feature films.  The show later moved to NBC and taking advantage of the new color television changed its name to Walt Disney’s Wonderful World of Color.

When he did finally pull away from the operations of the park, it was only to focus his attention on a new form of animation, this time in three-plus dimensions: audio animatronics.  Among other things, Walt was focused on creating a believable moving human model in the “Great Moments with Mr. Lincoln” exhibit for the 1964-1965 New York World’s Fair.   After the success of the Mr. Lincoln exhibit, this and other attractions created for the fair (“It’s a Small World” and “Progressland”) were relocated to Disneyland.

Community planning became the next focus on Walt’s life.  He wanted to take the clean and controlled environment that he had been able to create at Disneyland and expand that to a scale of a city.  He invested time and energy researching city planning.  He wanted to bring an idealized community to life through his Experimental Prototype Community of Tomorrow (EPCOT).  This began his search for land that eventually ended up in Florida and became the plans for Disneyworld, now the largest and most visited theme park in the world.  Sadly, he would die on December 15, 1966, prior to realizing the next step in his dream. The night before Walt died, Roy had visited the hospital room and said that he was staring at the ceiling and pointing to where everything was going to be located at EPCOT, including the entrance and exit roads.   With Roy’s leadership of the company, Disneyworld did open but Walt’s community of tomorrow would not be realized.  Instead, a world’s fair, theme park version of his ideas would open in 1982 and be named EPCOT.

Music and Sound

Sound

I have been looking for good tools to create and edit soundtracks for my projects.  Thanks to a friend, I have a MIDI keyboard and a Roland D110 synth module.  It has that great synth sound!  I haven’t found a good MIDI editor/sequencer yet, but there are a few multi-track recording programs that are worth noting.

Roland D110 (Roland D-110 Manual)

Sound Creation

A friend pointed me to a great tool called SynthEdit that allows you to create your own synthesized sounds.  It takes MIDI input.  I highly recommend but be warned, you will spend too much time with this! 🙂    A good online resource by the author of several great YouTube tutorials on SynthEdit is here: http://www.xoxos.net/  Later we found a similar tool, but with a much better interface and features: SynthMaker.

Here is a good book, “How To Make A Noise – A comprehensive guide to synthesizer programming” located here: http://www.noisesculpture.com/index.html

Sound Recording / Editing Tools

For Mac user: go with GarageBand

For Linux: Rosegarden

For PC:

Cubase Studio 4
Ableton Live LE
Cakewalk Music Creator
MAGIX Music Maker

KVRaudio.com keeps a data base and reviews of all the apps.

MIDI Software Synthesizers / Sequencing / Editing Tools

The KORE player from Native Instruments is a free MIDI software based synthesizer.  It comes with several synthesized and sampled instruments.  You can purchase additional sounds through their website.  These sounds are simply amazing.

Animation

Introduction

I had just started my programming journey into the digital world when TRON appeared in theaters in 1982.  The movie inspired me to pursue my hobby and eventually my career in Computer Science. 

3D Modeling

I have always had a love for 3D modeling.  I assembled my first 3D modeling tool during my Sophomore year in college using C++, X11 Motif and Sun hardware.   Recently I discovered POV-Ray, an open source ray-tracing program that uses a simple Scene Description Language to model primitives.  Naturally, this fits well with the models in TRON so I spent a few hours render various TRON-world objects.   Click Here to see my TRON section.

Tools

Modeling Programs:  Wings3d (freeware), Silo3d (trial-ware), Blender3d (open source)

Converters between 3D formats
Anthony D’Agostino’s Python Scripts for Blender
ExtremeUV

Free renderers
Povray
Yafray
Art of Illusion
Pixie (RIB)
3Delight (RIB) (free for non-commercial use)

Free 3D programs
Anim8or
Art of Illusion
Blender3D
Wings3D

Information about Music and Sound: http://www.jasonacox.com/wordpress/?p=23