#include "MusimatTutorial.h"Go to the source code of this file.
Functions | |
| MusimatTutorialSection (B0201d) | |
| RealList | srutiScale (1.0/1.0, 256.0/243.0, 16.0/15.0, 10.0/9.0, 9.0/8.0, 32.0/27.0, 6.0/5.0, 5.0/4.0, 81.0/64.0, 4.0/3.0, 27.0/20.0, 45.0/32.0, 729.0/512.0, 3.0/2.0, 128.0/81.0, 8.0/5.0, 5.0/3.0, 27.0/16.0, 16.0/9.0, 9.0/5.0, 15.0/8.0, 243.0/128.0) |
| Static Void | para1 () |
| MusimatTutorialSection | ( | B0201d | ) |
Definition at line 2 of file B0201d.cpp.
References para1().
00002 { 00003 Print("*** Sruti Scale ***"); 00004 /***************************************************************************** 00005 00006 Sruti Scale 00007 00008 As a final example, we adapt Pitch to handle nondodecaphonic scales by demon- 00009 strating the sruti scale (see figure 3.25). There are 22 degrees in this scale. We start by defining 00010 the ratios of the sruti scale: 00011 *****************************************************************************/ 00012 para1(); // Step into this function to continue the tutorial 00013 }
| Static Void para1 | ( | ) |
Definition at line 22 of file B0201d.cpp.
References pitchToHz(), R, srutiScale(), and x.
00022 { 00023 /***************************************************************************** 00024 We want to preserve the reference A440 Hz and use it to find the frequency of the lowest degree 00025 of the scale, as we’ve done for Pythagorean and natural scales. But which of the 22 degrees should 00026 correspond to A440? The sruti scale contains both the Pythagorean major sixth (27/16) and the 00027 natural major sixth (5/3). Let’s choose the simpler 5/3 ratio at degree 17 to correspond to A440. 00028 Then the lowest degree of the sruti scale has the same frequency as the natural chromatic middle 00029 C, 264.0 Hz. 00030 *****************************************************************************/ 00031 00032 Real R = 440.0; 00033 Real srutiRef = R * 3.0/5.0; // 264.00 Hz 00034 00035 /***************************************************************************** 00036 Next, we must inform Pitch of how many degrees there are per octave, which we can do by 00037 finding the length of the list of ratios: 00038 *****************************************************************************/ 00039 00040 SetDegrees(Length(srutiScale)); // set number of degrees in scale 00041 00042 /***************************************************************************** 00043 The built-in SetDegrees( ) function adjusts the internal calculations of Pitch to the spec- 00044 ified number of degrees in the scale. To keep things simple, the degrees of the sruti scale are indi- 00045 cated only by their degree numbers, rather than by trying to extend the Western pitch-naming 00046 system. Then the frequencies of particular sruti degrees are computed as follows: 00047 *****************************************************************************/ 00048 00049 For (Integer i = 0; i < Length(srutiScale); i = i + 1) { 00050 Pitch x( i, 0, 4 ); // pitch, accidental, octave 00051 Real f = pitchToHz(x, srutiRef, srutiScale); 00052 Print(f); 00053 } 00054 00055 /***************************************************************************** 00056 which prints the frequencies of the sruti scale from middle C as follows: 00057 00058 1 2 3 4 5 6 7 8 9 10 11 00059 264.00 278.12 281.60 293.33 297.00 312.89 316.80 330.00 334.13 352.00 356.40 00060 00061 12 13 14 15 16 17 18 19 20 21 22 00062 371.25 375.89 396.00 417.19 422.40 440.00 445.50 469.33 475.20 495.00 501.19 00063 00064 Other scales, such as Partch’s scale and the quarter-tone scale, can be constructed in the same 00065 manner. The Bohlen-Pierce scale can also be constructed this way because the SetDegrees() 00066 function only specifies the number of degrees in the scale and makes no assumptions about octave 00067 equivalence. 00068 00069 *****************************************************************************/ 00070 }}
| RealList srutiScale | ( | 1.0/1. | 0, | |
| 256.0/243. | 0, | |||
| 16.0/15. | 0, | |||
| 10.0/9. | 0, | |||
| 9.0/8. | 0, | |||
| 32.0/27. | 0, | |||
| 6.0/5. | 0, | |||
| 5.0/4. | 0, | |||
| 81.0/64. | 0, | |||
| 4.0/3. | 0, | |||
| 27.0/20. | 0, | |||
| 45.0/32. | 0, | |||
| 729.0/512. | 0, | |||
| 3.0/2. | 0, | |||
| 128.0/81. | 0, | |||
| 8.0/5. | 0, | |||
| 5.0/3. | 0, | |||
| 27.0/16. | 0, | |||
| 16.0/9. | 0, | |||
| 9.0/5. | 0, | |||
| 15.0/8. | 0, | |||
| 243.0/128. | 0 | |||
| ) |
Referenced by para1().
1.4.7