00001 #include "MusimatTutorial.h" 00002 MusimatTutorialSection(B0201c) { 00003 Print("*** Natural Chromatic Scale ***"); 00004 /***************************************************************************** 00005 00006 Natural Chromatic Scale 00007 00008 To create the natural chromatic scale, all we need now is to establish 00009 the frequency reference for natural chromatic middle C and tabulate the ratios of the scale. 00010 *****************************************************************************/ 00011 para1(); // Step into this function to continue the tutorial 00012 } 00013 00014 Real R = 440.0; 00015 Real cNat4 = R * 3.0/5.0; //264.00 Hz 00016 00017 RealList naturalChromatic( 00018 1.0/1.0, 16.0/15.0, 9.0/8.0, 6.0/5.0, 00019 5.0/4.0, 4.0/3.0, 64.0/45.0, 3.0/2.0, 00020 8.0/5.0, 5.0/3.0, 16.0/9.0, 15.0/8.0 00021 ); 00022 00023 Static Void para1() { 00024 /***************************************************************************** 00025 Then 00026 *****************************************************************************/ 00027 00028 Print("A4=", pitchToHz(A4 , cNat4, naturalChromatic)); 00029 00030 /***************************************************************************** 00031 prints A4=440.0, and 00032 *****************************************************************************/ 00033 00034 Print("C4=", pitchToHz(C4 , cNat4, naturalChromatic)); 00035 00036 /***************************************************************************** 00037 prints C4=264.00. 00038 00039 *****************************************************************************/ 00040 }} 00041 00043 /* $Revision: 1.4 $ $Date: 2006/09/12 17:38:02 $ $Author: dgl $ $Name: $ $Id: _b0201c_8cpp-source.html,v 1.4 2006/09/12 17:38:02 dgl Exp $ */ 00044 // The Musimat Tutorial © 2006 Gareth Loy 00045 // Derived from Chapter 9 and Appendix B of "Musimathics Vol. 1" © 2006 Gareth Loy 00046 // and published exclusively by The MIT Press. 00047 // This program is released WITHOUT ANY WARRANTY; without even the implied 00048 // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00049 // For information on usage and redistribution, and for a DISCLAIMER OF ALL 00050 // WARRANTIES, see the file, "LICENSE.txt," in this distribution. 00051 // "Musimathics" is available here: http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=10916 00052 // Gareth Loy's Musimathics website: http://www.musimathics.com/ 00053 // The Musimat website: http://www.musimat.com/ 00054 // This program is released under the terms of the GNU General Public License 00055 // available here: http://www.gnu.org/licenses/gpl.txt 00056
1.4.7