Exemple #1
0
        /// <summary>
        /// Returns whether this note is an accidental.
        /// </summary>
        /// <param name="includeWeirdAccidentals">
        /// If true, E will be included as "Fb", F will be included as E#, etc.
        /// </param>
        public static bool IsAccidental(this NoteValues note, bool includeWeirdAccidentals)
        {
            switch (note)
            {
            case NoteValues.A:
            case NoteValues.D:
            case NoteValues.G:
                return(false);

            case NoteValues.B:
            case NoteValues.C:
            case NoteValues.E:
            case NoteValues.F:
                return(includeWeirdAccidentals);

            case NoteValues.ASharp:
            case NoteValues.CSharp:
            case NoteValues.DSharp:
            case NoteValues.FSharp:
            case NoteValues.GSharp:
                return(true);

            default: throw new NotImplementedException(note.ToString());
            }
        }
Exemple #2
0
 public override string ToString()
 {
     return(Value.ToString().Replace("Sharp", "#").Replace("Flat", "b") +
            Octave);
 }