00001 /* $Revision: 1.4 $ $Date: 2006/09/12 17:38:03 $ $Author: dgl $ $Name: $ $Id: _musimat_tutorial_8cpp-source.html,v 1.4 2006/09/12 17:38:03 dgl Exp $ */ 00002 00046 // The Musimat Tutorial © 2006 Gareth Loy 00047 // Derived from Chapter 9 and Appendix B of "Musimathics Vol. 1" © 2006 Gareth Loy 00048 // and published exclusively by The MIT Press. 00049 // This program is released WITHOUT ANY WARRANTY; without even the implied 00050 // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00051 // For information on usage and redistribution, and for a DISCLAIMER OF ALL 00052 // WARRANTIES, see the file, "LICENSE.txt," in this distribution. 00053 // "Musimathics" is available here: http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=10916 00054 // Gareth Loy's Musimathics website: http://www.musimathics.com/ 00055 // The Musimat website: http://www.musimat.com/ 00056 // This program is released under the terms of the GNU General Public License 00057 // available here: http://www.gnu.org/licenses/gpl.txt 00058 00059 #ifndef __GNUC__ 00060 #include "stdafx.h" 00061 #endif 00062 #include <iostream> 00063 using namespace std; 00064 #include "MusimatTutorial.h" 00065 00066 #ifndef __GNUC__ 00067 int _tmain(int argc, _TCHAR* argv[]) 00068 #else 00069 int main(int argc, char* argv[]) 00070 #endif 00071 { 00072 // Plant your first breakpoint on the line below containing 00073 // B0100(). Then run the program, which will stop just 00074 // before executing that function. To start the tutorial, use the 00075 // debugger's "step into" command to step into the function. 00076 MusimatTutorial::B0100(); // Introduction to Musimat — The programming language for "Musimathics" 00077 00078 // When you get here, you've finished stepping through B0100(). 00079 // To continue the tutorial, use the debugger's "step into" command to 00080 // step into the next function. 00081 MusimatTutorial::B0101(); // B.1.1 Basic Elements 00082 00083 // Use the debugger's "step into" command to continue the tutorial 00084 // by stepping into each of the following functions. 00085 // For some sections, there may be additional functions for you 00086 // to visit within each file. 00087 MusimatTutorial::B0102(); // B.1.2 Statements and Expressions 00088 MusimatTutorial::B0103(); // B.1.3 Data Types 00089 MusimatTutorial::B0104(); // B.1.4 Constants 00090 MusimatTutorial::B0105(); // B.1.5 Variables 00091 MusimatTutorial::B0106(); // B.1.6 Reserved Words 00092 MusimatTutorial::B0107(); // B.1.7 Lists 00093 MusimatTutorial::B0108(); // B.1.8 Operators and Operands 00094 MusimatTutorial::B0109(); // B.1.9 Assignment 00095 MusimatTutorial::B0110(); // B.1.10 Relations 00096 MusimatTutorial::B0111(); // B.1.11 Logical Operations 00097 MusimatTutorial::B0112(); // B.1.12 Operator Precedence and Associativity 00098 MusimatTutorial::B0113(); // B.1.13 Type Promotion and Type Coercion 00099 MusimatTutorial::B0114(); // B.1.14 Accessing List Elements 00100 MusimatTutorial::B0115(); // B.1.15 Functions 00101 MusimatTutorial::B0116(); // B.1.16 Conditional Statements 00102 MusimatTutorial::B0117(); // B.1.17 Compound Statements 00103 MusimatTutorial::B0118(); // B.1.18 Iteration 00104 MusimatTutorial::B0119(); // B.1.19 User-Defined Functions 00105 MusimatTutorial::B0120(); // B.1.20 Invoking Functions 00106 MusimatTutorial::B0121(); // B.1.21 Scope of Variables 00107 MusimatTutorial::B0122(); // B.1.22 Pass by Value vs. Pass by Reference 00108 MusimatTutorial::B0123(); // B.1.23 Type Conversion 00109 MusimatTutorial::B0124(); // B.1.24 Recursion 00110 MusimatTutorial::B0125(); // B.1.25 Recursive Factorial 00111 MusimatTutorial::B0126(); // B.1.26 Fibonacci Numbers 00112 MusimatTutorial::B0127(); // B.1.27 Other Built-in Functions 00113 MusimatTutorial::B0128(); // B.1.28 Comments 00114 MusimatTutorial::B0129(); // B.1.29 Representing Text 00115 MusimatTutorial::B0200(); // B.2 Music Datatypes in Musimat 00116 MusimatTutorial::B0201(); // B.2.1 Pitch 00117 MusimatTutorial::B0201a(); // Equal-Tempered Frequency 00118 MusimatTutorial::B0201b(); // Pythagorean Chromatic Scale 00119 MusimatTutorial::B0201c(); // Natural Chromatic Scale 00120 MusimatTutorial::B0201d(); // Sruti Scale 00121 MusimatTutorial::B0202(); // B.2.2 Rhythm 00122 MusimatTutorial::B0203(); // B.2.3 Tempo 00123 MusimatTutorial::B0204(); // B.2.4 Loudness 00124 MusimatTutorial::B0300(); // B.3 Unicode (ASCII) Character Codes 00125 MusimatTutorial::B0400(); // B.4 Operator Associativity and Precedence in Musimat 00126 00127 Return 0; 00128 } 00129 00130
1.4.7