Exemplo n.º 1
0
        public void ChordFactoryTest_getChordRecomendationsByDegree()
        {
            Note         key            = NoteFactory.getNoteByName("C");
            Note         degree         = NoteFactory.getNoteByName("G");
            Mode         mode           = ModeFactory.getModeByName("Ionian");
            List <Chord> recomendations = ChordFactory.getChordRecomendationsByTonic(key, degree, mode);

            Assert.IsTrue(recomendations.Count() > 1);
        }
Exemplo n.º 2
0
        public void ChordFactoryTest_getChordRecomendationsByLast()
        {
            Note         key            = NoteFactory.getNoteByName("C");
            Mode         mode           = ModeFactory.getModeByName("Ionian");
            Chord        chord          = ChordFactory.getChordByName("C");
            List <Chord> recomendations = ChordFactory.getChordRecomendationsByLast(key, chord, mode);

            Assert.AreEqual("G", recomendations.ElementAt(0).getName());
        }
 public Song()
 {
     name            = "";
     key             = NoteFactory.getNoteByName("C");
     lyrics          = new Lyric();
     rhythm          = new Rhythm(4, 4);
     mode            = ModeFactory.getModeByName("Major");
     musicalElements = new List <IMusicalElement>();
 }
Exemplo n.º 4
0
        public void Mode_containsIntervalTest()
        {
            Mode mode = ModeFactory.getModeByName("Ionian");

            Assert.IsTrue(mode.containsInterval("R"));
            Assert.IsTrue(mode.containsInterval("M2"));
            Assert.IsTrue(mode.containsInterval("M3"));
            Assert.IsTrue(mode.containsInterval("P4"));
            Assert.IsTrue(mode.containsInterval("P5"));
            Assert.IsTrue(mode.containsInterval("M6"));
            Assert.IsTrue(mode.containsInterval("M7"));
            Assert.IsFalse(mode.containsInterval("m7"));
        }
Exemplo n.º 5
0
        public void Mode_containsNoteTest()
        {
            Mode mode = ModeFactory.getModeByName("Ionian");
            Note key  = NoteFactory.getNoteByName("C");

            Assert.IsTrue(mode.containsNote(NoteFactory.getNoteByName("C"), key));
            Assert.IsTrue(mode.containsNote(NoteFactory.getNoteByName("D"), key));
            Assert.IsTrue(mode.containsNote(NoteFactory.getNoteByName("E"), key));
            Assert.IsTrue(mode.containsNote(NoteFactory.getNoteByName("F"), key));
            Assert.IsTrue(mode.containsNote(NoteFactory.getNoteByName("G"), key));
            Assert.IsTrue(mode.containsNote(NoteFactory.getNoteByName("A"), key));
            Assert.IsTrue(mode.containsNote(NoteFactory.getNoteByName("B"), key));
            Assert.IsFalse(mode.containsNote(NoteFactory.getNoteByName("F#"), key));
        }
 public static void changeMode(string mode)
 {
     _mode = ModeFactory.getModeByName(mode);
 }
Exemplo n.º 7
0
        public void ChordFactoryTest_getChordRecomendationsTriads()
        {
            Note         key            = NoteFactory.getNoteByName("C");
            Mode         mode           = ModeFactory.getModeByName("Ionian");
            List <Chord> recomendations = ChordFactory.getChordRecomendationsTriads(key, mode);

            Assert.AreEqual("C", recomendations.ElementAt(0).getName());
            Assert.AreEqual("Dm", recomendations.ElementAt(1).getName());
            Assert.AreEqual("Em", recomendations.ElementAt(2).getName());
            Assert.AreEqual("F", recomendations.ElementAt(3).getName());
            Assert.AreEqual("G", recomendations.ElementAt(4).getName());
            Assert.AreEqual("Am", recomendations.ElementAt(5).getName());
            Assert.AreEqual("Bdim", recomendations.ElementAt(6).getName());

            key            = NoteFactory.getNoteByName("F");
            mode           = ModeFactory.getModeByName("Lydian");
            recomendations = ChordFactory.getChordRecomendationsTriads(key, mode);
            Assert.AreEqual("F", recomendations.ElementAt(0).getName());
            Assert.AreEqual("G", recomendations.ElementAt(1).getName());
            Assert.AreEqual("Am", recomendations.ElementAt(2).getName());
            Assert.AreEqual("Bdim", recomendations.ElementAt(3).getName());
            Assert.AreEqual("C", recomendations.ElementAt(4).getName());
            Assert.AreEqual("Dm", recomendations.ElementAt(5).getName());
            Assert.AreEqual("Em", recomendations.ElementAt(6).getName());

            key            = NoteFactory.getNoteByName("G");
            mode           = ModeFactory.getModeByName("Mixolydian");
            recomendations = ChordFactory.getChordRecomendationsTriads(key, mode);
            Assert.AreEqual("G", recomendations.ElementAt(0).getName());
            Assert.AreEqual("Am", recomendations.ElementAt(1).getName());
            Assert.AreEqual("Bdim", recomendations.ElementAt(2).getName());
            Assert.AreEqual("C", recomendations.ElementAt(3).getName());
            Assert.AreEqual("Dm", recomendations.ElementAt(4).getName());
            Assert.AreEqual("Em", recomendations.ElementAt(5).getName());
            Assert.AreEqual("F", recomendations.ElementAt(6).getName());

            key            = NoteFactory.getNoteByName("D");
            mode           = ModeFactory.getModeByName("Dorian");
            recomendations = ChordFactory.getChordRecomendationsTriads(key, mode);
            Assert.AreEqual("Dm", recomendations.ElementAt(0).getName());
            Assert.AreEqual("Em", recomendations.ElementAt(1).getName());
            Assert.AreEqual("F", recomendations.ElementAt(2).getName());
            Assert.AreEqual("G", recomendations.ElementAt(3).getName());
            Assert.AreEqual("Am", recomendations.ElementAt(4).getName());
            Assert.AreEqual("Bdim", recomendations.ElementAt(5).getName());
            Assert.AreEqual("C", recomendations.ElementAt(6).getName());

            key            = NoteFactory.getNoteByName("A");
            mode           = ModeFactory.getModeByName("Aeolian");
            recomendations = ChordFactory.getChordRecomendationsTriads(key, mode);
            Assert.AreEqual("Am", recomendations.ElementAt(0).getName());
            Assert.AreEqual("Bdim", recomendations.ElementAt(1).getName());
            Assert.AreEqual("C", recomendations.ElementAt(2).getName());
            Assert.AreEqual("Dm", recomendations.ElementAt(3).getName());
            Assert.AreEqual("Em", recomendations.ElementAt(4).getName());
            Assert.AreEqual("F", recomendations.ElementAt(5).getName());
            Assert.AreEqual("G", recomendations.ElementAt(6).getName());

            key            = NoteFactory.getNoteByName("E");
            mode           = ModeFactory.getModeByName("Phrygian");
            recomendations = ChordFactory.getChordRecomendationsTriads(key, mode);
            Assert.AreEqual("Em", recomendations.ElementAt(0).getName());
            Assert.AreEqual("F", recomendations.ElementAt(1).getName());
            Assert.AreEqual("G", recomendations.ElementAt(2).getName());
            Assert.AreEqual("Am", recomendations.ElementAt(3).getName());
            Assert.AreEqual("Bdim", recomendations.ElementAt(4).getName());
            Assert.AreEqual("C", recomendations.ElementAt(5).getName());
            Assert.AreEqual("Dm", recomendations.ElementAt(6).getName());

            key            = NoteFactory.getNoteByName("B");
            mode           = ModeFactory.getModeByName("Locrian");
            recomendations = ChordFactory.getChordRecomendationsTriads(key, mode);
            Assert.AreEqual("Bdim", recomendations.ElementAt(0).getName());
            Assert.AreEqual("C", recomendations.ElementAt(1).getName());
            Assert.AreEqual("Dm", recomendations.ElementAt(2).getName());
            Assert.AreEqual("Em", recomendations.ElementAt(3).getName());
            Assert.AreEqual("F", recomendations.ElementAt(4).getName());
            Assert.AreEqual("G", recomendations.ElementAt(5).getName());
            Assert.AreEqual("Am", recomendations.ElementAt(6).getName());
        }