PowerMac G4 Recording Studio

Introduction

My wife is an amazing piano player, and for the past several years she’s enjoyed playing from books or by ear on our Yamaha YDP-223 digital piano.  Back when she was in high school, she owned a Yamaha Clavinova CVP-98, which she used to record a number of original songs.  For as long as we’ve been together she hasn’t had much of an opportunity to record herself or share her playing with others online: a major problem was that we just didn’t have the equipment around to hook up to a keyboard or sequence anything, and the one time she tried using a cell phone to record herself the quality was awful (though the playing was great).

After listening to a number of her recordings salvaged by MIDI Carver, I hit upon the idea of building a surprise recording studio for her as a Christmas gift so she could produce and share some new music.  Originally I had intended to use my Mac Mini but she pointed out that it would be much more reasonable to use some less powerful machine and keep my existing computer for myself : )  Like most of my projects it took much longer than expected and in fact is still not 100 percent complete, but it’s just awaiting a couple of parts and is ready for use if I want to drag out a monitor.

Big thanks to the residents of the G-List group at Low End Mac, who patiently answered all my numerous Mac-impaired questions.

Hardware

This is an Apple PowerMac G4 “Digital Audio” computer.  I snagged it for free off Freecycle some time last year, and promptly set it in the garage and forgot about it.  This particular machine was already equipped with 640MB of RAM, a 40GB hard drive, and dual 533ghz G4 processors.  I ended up replacing the CD-RW drive with a DVD-RAM and adding a second 40GB drive to it.

This machine is from mid-2001 and is definitely showing its age.  However by using some older software and carefully trimming unused features from the OS, it serves its single purpose without any problems.

I have connected the YDP-223 to the Mac through an M-Audio MidiSport Uno USB<->MIDI interface.  This cable is great and can both send and receive to/from the keyboard without issue, so it can be used for recording or playback.  Speaker output from the Mac is also routed through the keyboard using a 1/8″ stereo to 2×1/4″ mono cable, so no extra speakers were needed.

I did attempt to add a Soundblaster Live! card to the machine but without any success.  There are no first-party OS X drivers, and those provided by the kX project either didn’t work or didn’t recognize the card.  Unfortunately, there is no on-board Line In jack on the machine, so I will need to find some external hardware solution later if I want to sample back from the YDP or record my violin, microphone input, guitar etc.

Software

Getting the software working was a major pain.  I originally intended to use OS X 10.3 “Panther” and installed that, thinking it would be the best fit for this combination of CPU speed and RAM.  However I discovered that most audio interfaces, including the kX drivers and the iMic, rely on Core Audio.  This wasn’t introduced until 10.4 “Tiger”.  Additionally I couldn’t use the DVD-RAM under 10.3 – a deal-breaker for sure.

Next I attempted to roll back as far as Mac OS 9.2, but discovered that the MIDI interface I was using was not supported on OS 9 any more (although the package says it is), and the first-party Sound Blaster drivers didn’t work for me either.  Fortunately I was able to take the opportunity to update the firmware on the machine to 4.2.8, which I couldn’t do under OS X.

Finally I gave in and, fearing the worst as far as performance was concerned, I installed 10.4 “Tiger”.  Many system updates later, I still couldn’t get the kX drivers to work, but at least I had a solid system.  In fact it seems my fears were unfounded: Tiger appears to be just as quick as Panther if not more so.  I also get the benefit of more recent hardware and software support.  I did disable Spotlight Indexing and the Dashboard, hoping to cut down on some CPU activity / RAM usage.

The available music software on the machine is either GarageBand 3 (from iLife ’06) or Logic Express 7.2.  Both programs run great, GarageBand can handle up to 8+ tracks without an issue.  I haven’t put Logic through its paces yet.  Checking the Activity Monitor shows that both apps really take advantage of both CPUs in the machine, which is excellent.

To-Do (Shopping) List

There are still some outstanding issues here.  This project is not really complete until I have added these items:

  • Small USB hub – the machine only has 2 USB ports.  Keyboard, mouse, and MIDI interface makes three plugs.
  • Original Mac AirPort card – these go by on eBay for $15-20 now.  I would like to get one so the Mac can join our network, post to the NAS shared folder, upload music to the Internet, etc.
  • External line-in box – for recording the keyboard and external instruments.  The Griffin iMic 2 seems like it would do the job nicely, and for just $25.
  • Small (15″ or so) LCD panel – obviously the machine isn’t much use without a display.  A small panel would be both functional and unobtrusive.  It would also be handy for displaying downloaded sheet music.
  • More RAM – is always be a nice addition : )  2×512 low-density PC133 would max out the machine.  This is a low-priority update.

midi-carver: A Data Carver for MIDI Files

Overview

MIDI-Carver is a tool for extracting (partial or complete) MIDI files from a binary block of data.  It can be used against a solid data file – e.g. an ISO image – to attempt to retrieve MIDI data into standalone files.  It also can parse images of damaged filesystems and makes some attempt at recovery even when the source has damaged one or more tracks, or obliterated the MIDI header.

If your disk has crashed, and you need your music back, midi-carver may be your best bet.

Introduction

Data recovery is tricky business.  The best solution is not to have to do it at all: MAKE REGULAR BACKUPS.  But if you have not done this – or even if you have and are unlucky enough to have bad backups – then it becomes a much more painful process.

Starting with an image of the damaged source material (create using ddrescue or some other tool), the next best thing is to mount it locally.  If that fails, one should try to somehow rebuild / recover the FAT table, so the disk image may become usable again.  If that fails, the last resort is “data carving”: searching the binary image for some indicators of file types, and then extracting them to disk.  Some popular tools for doing this are foremost, scalpel, and PhotoRec.

midi-carver is a data carver specifically designed to recover MIDI files.  It has a more intelligent extractor, in that it can skip damaged information and create MIDI files with the remaining good stuff.  It can also, if you’re lucky, locate deleted items on the disk and recover them.

Features

  • Attempts extraction of MIDI files from any binary blob
  • Locates “orphaned” MIDI tracks (where the header is missing) and creates a new MIDI header to contain the tracks
  • Copes gracefully with missing tracks by re-writing the header to the correct structure
  • Detects MIDIs which were overwritten by others, and truncates / splits into two separate tracks

Usage

The hardest part of this would be compiling midi-carver.  If you’re on Linux, FreeBSD or OSX this is easy.  Download midi-carver.c, open a terminal and:

gcc -o midi-carver midi-carver.c

This will compile midi-carver into an application which can be run on a block file, like this:

./midi-carver <filename>

midi-carver will create a folder titled “mcut-out” in the same directory as <filename>, and save any MIDIs it finds into that folder.

Of course, you’ll need something to work on.  I highly recommend using ddrescue on your damaged disk to create images.  It’s very effective at getting the most undamaged data off the disk possible.  Once you’ve done that, run midi-carver as described above, and look in the mcut-out to see if anything detected was usable.

Limitations

  • midi-carver does not handle source fragmentation.  This is ordinarily not a problem with iso images, but it is an issue with hard disks (and especially, floppy disk images) where files have been deleted and then added frequently.  In this case the file system may break the files into blocks and rearrange them to effectively use all the disk capacity.  midi-carver cannot read (or recreate) a file allocation table, so it cannot determine how to follow fragments.  There is hope for a “last-block fragmented” recovery feature, but its usefulness would be slim.
  • midi-carver will happily terminate tracks without checking the actual MIDI events in the track.  This produces a MIDI file which is structurally valid, but which media players may choke and die on, if the MIDI events in the track are not of the proper format.
  • There are a few pathological cases which may cause midi-carver to do the wrong thing – e.g. a tiny MIDI file embedded within a huge MIDI track will be missed.

Future Plans

Fix limitations 2 and 3 above!  This would mean adding a real track validator that could follow MIDI events in a track and then terminate it as soon as things appear to go sour.

Download

midi-carver.c – 12.1 kb, version 1.0.

License

It’s just 3-clause BSD.

Copyright (c) 2010, Greg Kennedy

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of midi-carver nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Super Video Modding the Atari 130XE

The Atari 8-bit computer line had some notorious issues with video output. Colors are muddy and dull thanks to poor design on the video circuit. Some years ago I took my 130xe and applied the Super Video mod to try to improve the clarity and color depth. At the same time I built an S-Video interface cable to take full advantage of the machine’s output.

Detailed instructions for the mod are here: http://www.oldcomputers.it/parts/atari/130xe/docs/sv130-1.html

This was a great mod, the parts are cheap and working on the 1980s board was nice. I didn’t even own my solder station at the time and did all the work with a blunt Radio Shack iron, but it still all worked out just fine.

How to Photograph Documents

My brother-in-law had a project recently which involved digitizing some vintage sheet music. Due to its age, the music had to be kept in a special binder and couldn’t be put on a scanner. I thought a bit on how to get the best images and ended up producing a step-by-step YouTube video. This solved his problem nicely.

For the curious, here are the pictures I captured from the camera. First is the unedited “direct from camera” shot.

And here is the image after some PP (rotate, crop, convert to B&W, adjust bright/contrast, sharpen). Actually this is too much sharpening… but then this was just a quick test to see how well things could clean up with a little work. More serious efforts would involve more serious TLC.