Functions | |
| void | B0100 () |
| void | B0101 () |
| void | B0102 () |
| void | B0103 () |
| void | B0104 () |
| void | B0105 () |
| void | B0106 () |
| void | B0107 () |
| void | B0108 () |
| void | B0109 () |
| void | B0110 () |
| void | B0111 () |
| void | B0112 () |
| void | B0113 () |
| void | B0114 () |
| void | B0115 () |
| void | B0116 () |
| void | B0117 () |
| void | B0118 () |
| void | B0119 () |
| void | B0120 () |
| void | B0121 () |
| void | B0122 () |
| void | B0123 () |
| void | B0124 () |
| void | B0125 () |
| void | B0126 () |
| void | B0127 () |
| void | B0128 () |
| void | B0129 () |
| void | B0200 () |
| void | B0201 () |
| void | B0201a () |
| void | B0201b () |
| void | B0201c () |
| void | B0201d () |
| void | B0202 () |
| void | B0203 () |
| void | B0204 () |
| void | B0300 () |
| void | B0400 () |
| void | testEuclid () |
| Real | pitchToHz (Pitch, Real, RealList) |
| void MusimatTutorial::B0100 | ( | ) |
| void MusimatTutorial::B0101 | ( | ) |
| void MusimatTutorial::B0102 | ( | ) |
| void MusimatTutorial::B0103 | ( | ) |
| void MusimatTutorial::B0104 | ( | ) |
| void MusimatTutorial::B0105 | ( | ) |
| void MusimatTutorial::B0106 | ( | ) |
| void MusimatTutorial::B0107 | ( | ) |
| void MusimatTutorial::B0108 | ( | ) |
| void MusimatTutorial::B0109 | ( | ) |
| void MusimatTutorial::B0110 | ( | ) |
| void MusimatTutorial::B0111 | ( | ) |
| void MusimatTutorial::B0112 | ( | ) |
| void MusimatTutorial::B0113 | ( | ) |
| void MusimatTutorial::B0114 | ( | ) |
| void MusimatTutorial::B0115 | ( | ) |
| void MusimatTutorial::B0116 | ( | ) |
| void MusimatTutorial::B0117 | ( | ) |
| void MusimatTutorial::B0118 | ( | ) |
| void MusimatTutorial::B0119 | ( | ) |
| void MusimatTutorial::B0120 | ( | ) |
| void MusimatTutorial::B0121 | ( | ) |
| void MusimatTutorial::B0122 | ( | ) |
| void MusimatTutorial::B0123 | ( | ) |
| void MusimatTutorial::B0124 | ( | ) |
| void MusimatTutorial::B0125 | ( | ) |
| void MusimatTutorial::B0126 | ( | ) |
| void MusimatTutorial::B0127 | ( | ) |
| void MusimatTutorial::B0128 | ( | ) |
| void MusimatTutorial::B0129 | ( | ) |
| void MusimatTutorial::B0200 | ( | ) |
| void MusimatTutorial::B0201 | ( | ) |
| void MusimatTutorial::B0201a | ( | ) |
| void MusimatTutorial::B0201b | ( | ) |
| void MusimatTutorial::B0201c | ( | ) |
| void MusimatTutorial::B0201d | ( | ) |
| void MusimatTutorial::B0202 | ( | ) |
| void MusimatTutorial::B0203 | ( | ) |
| void MusimatTutorial::B0204 | ( | ) |
| void MusimatTutorial::B0300 | ( | ) |
| void MusimatTutorial::B0400 | ( | ) |
| void MusimatTutorial::testEuclid | ( | ) |
Definition at line 28 of file B0119.cpp.
00028 { 00029 /***************************************************************************** 00030 The function euclid() is declared to be of type Integer because it will return an Integer result. 00031 00032 Note that Return(n) has been substituted for the Halt(n) function shown previously. Instead 00033 of halting execution altogether, the Return(n) statement only exits the current function, carrying 00034 with it the value of its argument back to the context that invoked it. The program can then continue 00035 executing from there, if there are statements following its invocation. Here’s an example of invok- 00036 ing the euclid() function: 00037 *****************************************************************************/ 00038 00039 Integer x = euclid(91, 416); 00040 Print(x); 00041 00042 /***************************************************************************** 00043 which will print 13. If we had used Halt() in euclid(), we’d never reach the Print statement 00044 because the program would stop. 00045 00046 Here’s another way to compute the same thing: 00047 *****************************************************************************/ 00048 00049 Print(euclid(91, 416)); 00050 00051 /***************************************************************************** 00052 This way we can eliminate the “middleman” variable x, which only existed to carry the value from 00053 the euclid() function to the Print() function. In this example, the call to the euclid() func- 00054 tion is nested within the Print() function. Musimat invokes the nested function first, and the 00055 value that euclid() returns is supplied automatically as an argument to the enclosing function, 00056 Print(). Functions can be nested to an arbitrary extent. The most deeply nested function is 00057 always called first. 00058 00059 *****************************************************************************/ 00060 }}
| Real MusimatTutorial::pitchToHz | ( | Pitch | , | |
| Real | , | |||
| RealList | ||||
| ) |
Definition at line 37 of file B0201b.cpp.
References key().
00041 { 00042 Integer key = PitchClass(p) + Accidental(p); // get key from pitch 00043 Real oct = Octave(p); // get octave from pitch 00044 Return(refC * scale[key] * Pow(2.0, (oct - 4)));// compute frequency 00045 }
1.4.7