Maximum MIDI
Music Applications in C++
Paul Messick

1997 | 450 pages
ISBN: 1884777449

$49.95 Softbound print book  

RESOURCES

DESCRIPTION

Maximum MIDI shows you how to build world-class MIDI programs that can play music using computer sound cards or external keyboard instruments, teach music theory and technique, add music to games and allow musicians to record, edit, play and print compositions. Maximum MIDI gives programmers two ways to add MIDI to their programs. A flexible toolkit of C and C++ routines makes developing Windows 95 MIDI programs a breeze, and rock-solid algorithms and tons of field-tested source code allow advanced users to quickly "roll their own"--on any platform. Over a dozen example programs show how it's done.

NEW! The Maximum MIDI Programmer's ToolKit now supports both Windows 95 and Windows NT. Popular demand, insomnia, and caffeine have finally convinced Paul to port the ToolKit to NT. Your copy of Maximum MIDI: Music Applications in C++ entitles you to download the updated 95/NT DLLs (including source code) from the Maximum MIDI website. The new code--and ToolKit support via the book's Author Online forum--is only available to owners of the book.


Important note: the current printing of the book does not contain a CDROM. If you see the book advertised with a CDROM, the listing may be out of date so please verify with the vendor if you require the CDROM edition of the book. The book source code and supporting libraries are available for download from the Maximum Midi book web page. The original HTML copy of the book on the CDROM is NOT included with the current book or it's downloads.

WHAT THE EXPERTS SAY ABOUT THIS BOOK...

"The author knows his stuff... he has hard industry experience."
--Phil Sours, Director of Development, Cakewalk Music Software

"It is the only book I know that really explains Windows MIDI ... I recommend it!"
--Bret Costin, Chief Engineer, Midiman

"... the organization is excellent, proceeding in a natural progression from introductory material to Toolkit basics to useful examples and extensions."
--David Rowe, Director of Hardware, Opcode Systems, Inc.

ABOUT THE AUTHOR...

Paul Messick, a long-time MIDI user, hardware developer and programmer, was Director of Engineering for Music Quest, where he designed MIDI interfaces and wrote Windows device drivers. He has extensive experience in the music software industry writing MIDI programs for a wide range of clients. Paul Messick maintains a Maximum Midi web page at .

Sample Chapters

Two sample chapters are available for download.

Chapter 7
Chapter 10

Guide to the book

Maximum MIDI is intended as a thorough sourcebook that programmers can use when writing MIDI applications. It uses a set of routines, written in C and C++, as a working, concrete example of how to handle MIDI in a wide range of applications. While these routines, called the Maximum MIDI Programmer's ToolKit, are designed to work in Windows 95, they can be easily adapted to other systems. The book includes all of the algorithms used in the ToolKit, along with the ToolKit source. So, programmers are free to use the ToolKit routines as they are, modify the source to add new features, or strike out into uncharted territory by writing new routines from scratch.

The book is organized in three parts. The first section (chapters 1 through 8) covers how MIDI is used in Windows 95, including the MIDI protocol, algorithms to carry out all the basic tasks, the DLLs that implement those algorithms, and examples to use those routines in C. The second section (chapters 9 through 15) covers the MaxMidi C++ classes, including Microsoft MFC-based example programs using these classes. The third section encompasses four appendices that document the ToolKit C-language API and C++ classes, along with the complete source code for the classes, source code for the two MaxMidi DLLs, and three of the larger example programs.

It's not necessary to read every chapter, or even to read them in order. For example, if you are most interested in how Standard MIDI Files work, jump ahead to chapter 13 where they are discussed. A glossary is included to help with terms that might be defined in as-yet-unread chapters. But, of course, the most complete understanding comes to those who read everything and experiment thoroughly. To best understand everything about MIDI in Windows 95, study the book and pore over the code.

Chapter 1 covers some basic MIDI information, explaining simple interconnections and how the Windows 95 MIDI implementation is organized. Start with this chapter for a MIDI refresher, and a quick subterranean peak at how MIDI works in Windows 95.

The MIDI protocol is dissected in detail in chapter 2. While this chapter is not intended to replace the MIDI specification, it does provide enough detail for programmers to intelligently use the MIDI protocol. Topics such as Channel Voice messages, System Exclusive messages, MIDI Time Code, and General MIDI are thoroughly explored.

Chapter 3 delves into the internal workings of Windows 95, DLLs, Timers, and the MMSYSTEM API. This technically advanced chapter sets the stage for the low-level MIDI routines used in the ToolKit. Look here when trying to understand why MIDI is implemented the way it is in Windows 95.

The first half of chapter 4 introduces the ToolKit's C-language API for sending MIDI events, while the second half provides a map of these functions as implemented in the MaxMidi DLL internals.

Chapter 5 covers MIDI input much as chapter 4 covers MIDI output. The first half of the chapter covers the C-language API and a guide to the DLL's internal workings consumes the second half.

System Exclusive Messages are the topic of chapter 6. It is built on the foundation laid by the previous two chapters, and covers how these messages are handled using the ToolKit. Like the earlier chapters, it includes a guide to the inner workings of the ToolKit sysex-handling code, and explains how the DLL code has been extended to support sysexes.

The fundamental algorithms for musical timing are covered in chapter 7. Timestamps, ticks, SMPTE/MTC sync, and MIDI sync are all covered. Be sure to at least skim this chapter before moving on to chapter 8, where ToolKit-based synchronization is introduced.

The sync functions that are implemented in the MaxMidi DLLs (using the algorithms introduced in chapter 7) are shown in chapter 8. Recording and playing MIDI events is covered, along with an explanation of the internals of the ToolKit sync engine.

C++ finally rears its head in chapter 9. The three essential ToolKit classes, CMaxMidiIn, CMaxMidiOut, and CMaxMidiSync are introduced and examined. These classes enable C++ applications to easily support MIDI input and output, with and without synchronization.

Chapter 10 documents how MIDI support is added to an MFC-based application and uses two simple example programs to illustrate the process.

Chapter 11 explores sysex message handling using the ToolKit. A simple System Exclusive librarian program is the end result of these explorations.

Tracks make their first appearance in chapter 12. The CMaxMidiTrack class explored in this chapter makes writing sequencers a breeze. A quick and easy one-track sequencer example program illustrates the point.

Standard MIDI Files are the topic of chapter 13 where this popular file format is examined from soup to nuts. The file organization, C routines for reading and writing SMFs, and a C++ class to handle these files are all explained.

Chapter 14 expands our simple one-track sequencer by adding multiple tracks and support for reading and writing Standard MIDI Files. Along the way, a track merging algorithm is introduced that allows ToolKit-based applications to play back any number of tracks without hassle.

Chapter 15 encourages readers to strike out on their own by using the ToolKit--possibly adding features and modifying it along the way--in their own MIDI creations.

A glossary provides answers to those all important "huh?" questions that sometimes arise. This section is especially useful when reading chapters out of order, since normally each chapter builds on the last. When in doubt, look it up here.

Finally, four appendixes completely document the ToolKit source, the C-language API, and the C++ classes. Appendix A provides detailed documentation for the ToolKit's C-language API and C++ classes. This documentation is also included in two help files that are on the accompanying CDROM. Appendix B is the complete source code for the two MaxMidi DLLs, while appendix C provides a source code listing of all of the ToolKit C++ classes. And, appendix D includes the source code for three of the example programs: MidiSpy, SxLib, and MaxSeq. Of course, all of the source code is also supplied on the CDROM.

Source Code

Source code for Maximum MIDI is contained in a single ZIP file.

Free unzip programs can be found at www.download.com.

Source Code -- 4.5 MB