/Users/lyon/j4p/src/sound/musica/Scales.java

1    package sound.musica; 
2     
3    /* 
4     * Open Source Software by http://www.Docjava.com 
5     * programmer: D. Lyon 
6     * e-mail: lyon@docjava.com 
7     * Date: Apr 29, 2002 
8     * Time: 12:39:06 PM 
9     */ 
10    
11   public class Scales { 
12       //Implicit assumption: Scales span one octave each! (12 MIDI tones) 
13    
14       /** 
15        * 
16        * @param scale Name of the array holidng the scale intervals 
17        * @return string displaying the intervals, and the positions on 12 tone scale 
18        */ 
19       public static String toString(int[] scale) { 
20           String s = "Intervals: \t"; 
21           int j = 1; 
22           for (int i = 0; i < scale.length; i++) 
23               s += "\t" + scale[i]; 
24           s += "\nSequence:\t"; 
25    
26           for (int i = 0; i < scale.length; i++) { 
27               j += scale[i]; 
28               s += "\t" + j; 
29           } 
30           return s; 
31       } 
32    
33       /*********************************************************************** 
34    * All Methods below are preserved for legacy only, not used in package musica. 
35    */ 
36   // This method is preserved for legacy only 
37       public static void testPlayScale() { 
38           System.out.println("Removed reference to Utils.play for standalone capability"); 
39       } 
40    
41       /** 
42           This method is preserved for legacy only, 2nd parameter is not used 
43        */ 
44       public static int[] getScale( 
45               int progression[], int startNote) { 
46           int scale[] = new int[progression.length]; 
47           return scale; 
48       } 
49    
50         /** 
51           This method is preserved for legacy only, 2nd & 3rd parameters not used 
52        */ 
53         public static int[] getScale(int[] scale, int startNote, int stopNote) { 
54           return scale; 
55       } 
56   }