コード例 #1
0
 public Key CreateKey(string keySignature)
 {
     // If the key signature starts with K, it is expected to contain a set of flat or sharp characters equal to the number of flats
     // or sharps one would see on the staff for the corresponding key. Defaults to MAJOR key.
     if (keySignature[0] == 'K' && (keySignature.IndexOf(SharpChar) == 1 || (keySignature.ToUpper().IndexOf(FlatChar) == 1)))
     {
         return(CreateKeyFromAccidentals(keySignature));
     }
     // Otherwise, pass the string value - something like "Cmaj" - to createChord and generate a Key from the intervals in that chord
     return(new Key(ChordProviderFactory.GetChordProvider().CreateChord(keySignature)));
 }
コード例 #2
0
 public Chord(string s)
     : this(ChordProviderFactory.GetChordProvider().CreateChord(s))
 {
 }