upper left corner
upper right corner
header end left header end right Flash Audio
Martin Wilde

Build a MIDI Synth with Flash

page 1 2 3 4 5

Conclusion

The current version of this Flash MIDI synthesizer implements the volume, expression and pan continuous controllers.  You can hear these volume and pan effects in the supplied SWF.

A critical part of the sound design for any digital audio synthesizer is the loudness balance of the sounds.  The lengths of the sounds also have to match the durations of the notes in the score.

There is, at present, no sound layering in this implementation.  That is, we specify only one sound per note, and that sound has to suffice for all note durations in the music.  Layering is a technique that can add quite a bit of richness to your music.  But in the context of Flash, this may not be desirable, as each element of the layered sound would take up another playback channel.

So now you have an outline and demonstration of the steps necessary to make and use a software MIDI synthesizer within Flash.  At its core is a MIDI interpreter, written in ActionScript.  It steps through the SMF using the setInterval timer, and starts and stops sounds attached to individual movie clips to play back the score.  We compensate for timer inaccuracies by padding each sound with 10 mS of silence and playing catch up in the MIDI score.  We map sounds from the library onto specific MIDI channel and note locations in an array of note objects, and perform note stealing to keep the number of simultaneous notes within the 8-channel constraint of Flash.

Play it, Schroeder!

About the author:
Martin Wilde has immersed himself in the field of audio programming for almost two decades. His formal training in computer music and psychoacoustics has uniquely prepared him for the challenges of delivering audio across the wide spectrum of today's audio technologies. Martin is a musician who brings a wealth of technical understanding and experience to bear in all his professional endeavors. He has designed, developed and shipped sound and music software engines for computer game titles on a multitude of platforms. Martin holds two U.S. patents, a Masters degree in Computer Studies in Music and a Bachelors degree in Music, Acoustics and Audio Science. Martin is an active member of the Interactive Audio Special Interest Group (IASIG) and the Audio Engineering Society (AES), and over the years has made numerous presentations to the Game Developers Conference, AES, Interactive Multimedia Association, and the International Computer Music Association. Email Martin Wilde

page 1 2 3 4 5

upper left corner
upper right corner
header end left
header end right
Sponsors
 
header end left
header end right
Contribute
  • Contribute an Article
    Demonstrate your professional skills and knowledge to the community.
  • Become a Sponsor
    Promote your service to Sonify's community of professional content and application developers.
  • Submit News
    Help keep the community informed about industry developments.
header end left
header end right
About Sonify.org

Sonify.org is a community resource where Developers can unite with the common goals of adding interactive audio to the Web, Wireless and Digital Devices as well as advancing the development of the underlying interactive audio technologies. Read more.