コード例 #1
0
ファイル: Tests.cs プロジェクト: codyclay88/music-note-helper
        public void EMajorChordConsistOfCorrectNotes()
        {
            var eMajorChord = MajorChord.For(Note.E).ToList();

            Assert.Equal(eMajorChord[0], Note.E);
            Assert.Equal(eMajorChord[1], Note.GSharp);
            Assert.Equal(eMajorChord[2], Note.B);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var strNote = String.Empty;

            while (strNote.ToLower() != "exit")
            {
                Console.Write("Enter a note: ");
                strNote = Console.ReadLine();
                var note = Note.For(strNote.ToUpper());
                if (note == Note.Rest)
                {
                    Console.WriteLine("Invalid Note.");
                    continue;
                }

                var intervals = Interval.For(note);
                Console.WriteLine("\n=== INTERVALS ===");
                PrintIntervals(intervals);

                Console.WriteLine("\n=== NOTES IN MAJOR SCALE ===");
                var notesOfMajorScale = MajorScale.For(note);
                Console.WriteLine(String.Join <Note>(" - ", notesOfMajorScale));

                Console.WriteLine("\n=== NOTES IN MAJOR CHORD ===");
                var notesOfMajorChord = MajorChord.For(note);
                Console.WriteLine(String.Join <Note>(" - ", notesOfMajorChord));

                Console.WriteLine("\n=== MAJOR CHORD NOTES ON GUITAR ===");
                PrintChordNotesOnInstrument(StringedInstrument.Guitar, notesOfMajorChord);

                Console.WriteLine("\n=== NOTES IN MINOR SCALE ===");
                var notesOfMinorScale = MinorScale.For(note);
                Console.WriteLine(String.Join <Note>(" - ", notesOfMinorScale));

                Console.WriteLine("\n=== NOTES IN MINOR CHORD ===");
                var notesOfMinorChord = MinorChord.For(note);
                Console.WriteLine(String.Join <Note>(" - ", notesOfMinorChord));

                Console.WriteLine("\n=== MINOR CHORD NOTES ON GUITAR ===");
                PrintChordNotesOnInstrument(StringedInstrument.Guitar, notesOfMinorChord);

                Console.WriteLine("=======================\n");
            }
        }