jcaas.midi
Class KeySignature

java.lang.Object
  extended by jcaas.midi.StaffProperty
      extended by jcaas.midi.KeySignature

public class KeySignature
extends StaffProperty

KeySignature represents a Key Signature for a Song. Extends Song Property. At present, this class contains no information regarding which sharps and flats are active in the key signature. Nor does it contain information about how a key signature should modify a song as it plays. Someone with more musical knowledge than the author will have to implement it.

Version:
last updated: 6/16/05
Author:
Conrad Hutcheson

Constructor Summary
KeySignature()
          Default construtor, makes a key signature of C-Major (no sharps or flats)
KeySignature(java.lang.String signature)
          Constructor, makes a key signature with the given string.
 
Method Summary
static Note convert(Note n, KeySignature inSig, KeySignature outSig)
          A method to convert a note from one key signature to another.
 java.lang.String getKeySig()
          Returns the key signature description string.
 java.lang.String getName()
          Returns the name for this type of Staff Property
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeySignature

public KeySignature()
Default construtor, makes a key signature of C-Major (no sharps or flats)


KeySignature

public KeySignature(java.lang.String signature)
Constructor, makes a key signature with the given string.

Method Detail

getKeySig

public java.lang.String getKeySig()
Returns the key signature description string.

Returns:
the String name of this key signature.

convert

public static Note convert(Note n,
                           KeySignature inSig,
                           KeySignature outSig)
A method to convert a note from one key signature to another. Presently not implemented, as I (CMH) don't have the musical background to do it.

Parameters:
n - the note to be converted
inSig - the key signature n is given in
outSig - the key signature to convert n to
Returns:
the note n in the key signature outSig

getName

public java.lang.String getName()
Description copied from class: StaffProperty
Returns the name for this type of Staff Property

Specified by:
getName in class StaffProperty
Returns:
a string name