]> ruin.nu Git - moosique.git/commitdiff
should now draw the text representation.
authorMichael Andreen <harv@ruin.nu>
Tue, 6 May 2003 01:05:48 +0000 (01:05 +0000)
committerMichael Andreen <harv@ruin.nu>
Tue, 6 May 2003 01:05:48 +0000 (01:05 +0000)
MooNoteElement.java

index 40ab0a4fca2ec68e6ac58cc0ca231c749a6928b7..969433fb928eec864372b0a68f23950f4b65d5ad 100644 (file)
@@ -52,6 +52,26 @@ public class MooNoteElement extends JPanel{
                if (!(g instanceof Graphics2D))
                        return;
                Graphics2D g2 = (Graphics2D)g;
+               
+               String note = ""; //TODO: shoudl really change this name..
+               int pitch = this.note.getPitch();
+               switch( pitch % 12)
+               {
+                       case 0: note = "C"; break;
+                       case 1: note = "C#"; break;
+                       case 2: note = "D"; break;
+                       case 3: note = "D#"; break;
+                       case 4: note = "E"; break;
+                       case 5: note = "F"; break;
+                       case 6: note = "F#"; break;
+                       case 7: note = "G"; break;
+                       case 8: note ="G#"; break;
+                       case 9: note = "A"; break;
+                       case 10: note = "A#"; break;
+                       case 11: note = "B"; break;
+               }
+               
+               g2.drawString(note +" "+(pitch/12), 2, 2);
 
        }