Welcome to MIDI Player for SansGUI


MIDI Player for SansGUI has been created to demonstrate a couple of new SansGUI version 1.1 features, which 1) allow an external process simulator to work in concert with an in-process simulator, and 2) allow the users to chart data dynamically. In this example, the external process simulator is a console-based Musical Instrument Digital Interface, or MIDI, player that feeds MIDI streams into the Windows multimedia facility and displays MIDI events in the console. While processing the MIDI events, it also writes the MIDI channel numbers and data to a shared memory area (as two integers) for the in-process simulator to read. Acting as a monitor, the in-process simulator distributes the data to the corresponding channel components (parts), based on the user selected channel numbers associated with these components. The data in the channel components are then plotted using the dynamic charting feature in SansGUI without any extra programming effort from the simulation developer's side.

Communication between the external MIDI player and the in-process monitor is asynchronous, meaning that the former keeps pumping out data (a producer) while the latter reads the data (a consumer) with a user-definable interval, without the knowledge of the former. You can implement synchronous inter-process communication if the nature of your application requires it. While you are enjoying the MIDI music and the dynamic display, please be reminded that the external process simulator can be a control process or a simulated process of a real system, an existing application with its own GUI, or a legacy program of any kind, written in any programming language or environment.

System Requirements

This program requires the SansGUI Run-Time Environment version 1.1 or later. The demonstration version of SansGUI (SGdemo, available from ProtoDesign's web site) can be used to run the pre-built project or create new ones of your own. With the SGdemo edtion, however, you cannot save your work for future access. Optionally, the SansGUI Development Environment in the Professional Edition and the Student Edition can be used to modify the Schema Definition and extend the MIDI Player's capability.


Before installing MIDI Player for SansGUI, you need to have the SansGUI Run-Time Environment installed on your computer. The MIDI Player utility program is distributed in a self-extracting archive executable file in the SansGUI software distribution CD and from ProtoDesign's web site. To install it, simply run the executable file and follow the instructions. An important note is that the files should be installed into the SansGUI directory structure. That is, during the installation process, it will ask you where to install MIDI Player for SansGUI in an Unzip to folder: field. You need to indicate where your SansGUI installation directory is. If the shown directory matches the one you chose when you installed SansGUI, you can simply use the default value here; otherwise, click on the Browse... button to locate the SansGUI installation directory. The SansGUI installation directory is the one containing SansGUI Release.txt and License.txt files. Using this MIDI Player utility program with a SansGUI version earlier than 1.1 is not supported.

MIDI Player for SansGUI Files




MIDI Player Object Library


MIDI Player in-process simulator


MIDI Player external process simulator


On-line documentation files


Picture files for on-line documentation


Schema Definition of MIDI Player


Icon files for MIDI Player classes


MIDI Player (in-process) project for MSVC++


MIDI Player (in-process) project for CVF


C/C++ and Fortran (in-process) source files


MIDI Player external process project and code


Example to play 2 channel MIDI files


Example to play 16 channel MIDI files


Sample MIDI file of Scott Joplin's The Entertainer

Getting Started

Please go to the next section, titled Introduction, of this manual.

More MIDI Files

We have included SGent.mid, Scott Joplin's The Entertainer for testing. The sequencer of this MIDI file is unknown. To download more MIDI music for playing and enjoyment, you can visit:

Please be aware of the copyright ownership of the MIDI music.

Technical Support

In order to obtain your permanent license key, you need to register your computer. Please check the section on Permanent License Key in the Getting Started guide and visit the following web page:


For technical assistance on SansGUI, please contact:


http://sansgui.com/support.htm or


Phone: (630) 759-9930

Fax: (630)759-4759

For other services offered by ProtoDesign, Inc., please contact:



Phone: (630) 759-9930

Fax: (630) 759-4759

Copyright and License

Copyright 2002-2003 ProtoDesign, Inc. All rights reserved.

Portion Copyright 1998 Jrg Knig. All rights reserved.

The external process MIDI Player program uses a modified CMIDI class library, which was originally created and copyrighted by Jrg Knig. We thank him for giving us the permission to use and distribute a modified version of his MIDI.h and MIDI.cpp files. The original code sample was posted at: http://codeguru.earthweb.com/multimedia/midi.shtml. You can contact him at Joerg.Koenig@rhein-neckar.de or J.Koenig@adg.de.

The MIDI Player for SansGUI utility program and its documentation are copyrighted by ProtoDesign, Inc. and are provided "AS-IS" without warranty of any kind, express or implied. Neither ProtoDesign, Inc. nor its distributors will be held liable for any damage caused or alleged to be caused either directly or indirectly by this software.

Redistribution of the utility program in its original form without modification is permitted. In addition, you are encouraged to create full-feature MIDI Players based upon this demonstration program, using the SansGUI Modeling and Simulation Environment. You can distribute, commercially or non-commercially, your extended work provided that:

The SansGUI Software and its documentation, on-line and printed, are copyrighted by ProtoDesign, Inc. The use of these materials are restricted by the license agreement accepted by the user during the software installation process.


SansGUI and its logo is a registered trademark and ProtoDesign and its logo is a registered service mark of ProtoDesign, Inc. Microsoft Windows is a trademark of Microsoft Corporation. All other trademarks are owned by the respective companies.



MIDI Player for SansGUI Version 1.0

Copyright 2002-2003 ProtoDesign, Inc. All rights reserved.