Sound Ideas

Piano 1 - A piano synthesizer

In this series of articles, I'm going to talk about how I wrote a piano synthesizer.

I chose this project for a few reasons. Firstly, my eventual aim is to write a 64K demo, and I'll be needing some music for it. I'm getting tired of hearing the same old FM synths and MOD-tracked music, and so I decided to try and create a "real" instrument, to make something that sounds a bit different to all the other demos out there.

Additionally, despite having a career as an audio programmer I'll be the first to admit that I've never been the world's foremost expert on Digital Signal Processing (DSP) and so I chose a project which would force me to learn more about it.

Demos have to run in realtime on ordinary PCs. That means drawing at least thirty frames (images) per second, and preferably more than sixty. Most of the processor time is going to be needed for the graphics, and so the music synthesizer must be capable of generating one frame of music in considerably less time than one frame. I am aiming to get it under 10%, leaving the other 90+% of the processing time available for graphics.

64KB is not much room. The entire demo, code and data, must fit into this tiny space. Even the music alone causes problems. For example, MP3s are quite well compressed, you may agree. You can fit about eleven full albums onto a single CD if you compress them with MP3. However that still means that the music takes up about one megabyte per minute. Obviously, something else is needed, and I'll go into detail about the solution I picked.

So briefly, there were three main goals for my piano synthesizer:

  1. It must sound as realistic as possible.
  2. It must run as quickly as possible.
  3. The total size of the code and music must be as small as possible.
The posts that follow will be a kind of tidied-up development diary of the project as it progresses.

No comments: