About the Examples
The following materials in Musimat are excerpted from Chapter 9, "Composition and
Methodology", of "Musimathics Vol. 1", Published by the MIT Press and © 2006 Gareth Loy.
It can be read as HTML text in your favorite web browser, or you can step through the code with your debugger to see it in action.
- To read it as text, click on the "Files" tab. You will see a list of all files that make up the tutorial with a link that says [code] at the end of each line. Click on the [code] link next to the first file, C090400(), which corresponds to "Musimathics V1", Chapter 9, section 4. Continue with the tutorial by clicking the links for subsequent files.
- The best way to go through the Tutorial is using a debugger such as gdb, or the one provided in Microsoft Visual .NET C++. To do so, follow these steps:
- Open the file Musimat'.cpp.
- Plant a breakpoint on the first function call (named C090400()) inside the main() routine at the bottom of the file.
- Run the program from within the debugger.
- The program will halt at the breakpoint you set.
- Step into the function C090400(). You will eventually be returned to the main() subroutine when C090400() returns.
- Step into the next function to continue.
- You can use your debugger to examine data structures and follow the execution of the code. The output of the Print() statements in the program will appear in another window (Windows) or directly on the console (gdb).
In order to follow the flow of Chapter 9 of "Musimathics", the tutorial had to be broken into a set of unique functions. You can follow the narrative by using your debugger to step into the next tutorial function when the previous one returns to main(). See the main() function at the bottom of this file for more details.
The section names in this tutorial are the same as Chapter 9 in "Musimathics" V1. For example, tutorial function C090400() corresponds to the text in section Chapter 9, section 4.