Ejemplo n.º 1
0
        def test_temperament_dict(self):
            """ Like test_seq_dict, but checks dictionary in WestTemp. """
            self.assertTrue(WestTemp.check_nseqby_subdict(NSEQ_CHORD))
            self.assertTrue(WestTemp.check_nseqby_subdict(NSEQ_SCALE))
            self.assertFalse(WestTemp.check_nseqby_subdict(666))
            self.assertTrue(WestTemp.check_nseqby_name(NSEQ_SCALE, "Major"))
            self.assertFalse(WestTemp.check_nseqby_name(NSEQ_CHORD, "Minor"))
            self.assertFalse(WestTemp.check_nseqby_name(NSEQ_SCALE, "Minor"))
            self.assertFalse(WestTemp.check_nseqby_abbrv(NSEQ_SCALE, "maj"))
            self.assertFalse(WestTemp.check_nseqby_abbrv(NSEQ_CHORD, "min"))
            self.assertFalse(WestTemp.check_nseqby_abbrv(NSEQ_SCALE, "min"))
            self.assertFalse(
                WestTemp.check_nseqby_seqpos(NSEQ_CHORD, CHROM_NAT_NOTE_POS))
            self.assertTrue(
                WestTemp.check_nseqby_seqpos(NSEQ_SCALE, CHROM_NAT_NOTE_POS))
            self.assertEqual(WestTemp.get_nseqby_name("Major", NSEQ_SCALE),
                             self.majorscale)
            self.assertEqual(WestTemp.get_nseqby_name("Ionian", NSEQ_SCALE),
                             self.majorscale)
            self.assertEqual(
                WestTemp.get_nseqby_name("Melodic Minor", NSEQ_SCALE),
                self.melminscale)
            self.assertEqual(
                WestTemp.get_nseqby_name("Jazz Minor", NSEQ_SCALE),
                self.melminscale)
            self.assertEqual(
                WestTemp.get_nseqby_name("Harmonic Minor", NSEQ_SCALE),
                self.harmminscale)
            self.assertEqual(
                WestTemp.get_nseqby_name("Harmonic Major", NSEQ_SCALE),
                self.harmmajscale)
            self.assertEqual(WestTemp.get_nseqby_name("Dorian", NSEQ_SCALE),
                             self.dorianscale)
            self.assertEqual(WestTemp.get_nseqby_name("Locrian", NSEQ_SCALE),
                             self.locrianscale)
            self.assertEqual(
                WestTemp.get_nseqby_name("Superlocrian", NSEQ_SCALE),
                self.superlocrianscale)
            self.assertEqual(
                WestTemp.get_nseqby_name("Ultralocrian", NSEQ_SCALE),
                self.ultralocrianscale)
            self.assertEqual(WestTemp.get_nseqby_name("Locrian " + M_FLAT \
                + M_FLAT + "7", NSEQ_SCALE), self.dubflat7locrianscale)

            self.assertEqual(
                WestTemp.get_nseqby_seqpos(CHROM_NAT_NOTE_POS, NSEQ_SCALE),
                self.majorscale)

            self.assertEqual(
                WestTemp.get_nseqby_seqpos(MEL_MIN_NOTE_POS, NSEQ_SCALE),
                self.melminscale)
            self.assertEqual(
                WestTemp.get_nseqby_seqpos(HARM_MIN_NOTE_POS, NSEQ_SCALE),
                self.harmminscale)
            self.assertEqual(
                WestTemp.get_nseqby_seqpos(HARM_MAJ_NOTE_POS, NSEQ_SCALE),
                self.harmmajscale)
Ejemplo n.º 2
0
        def test_temperament_dict(self):
            """ Like test_seq_dict, but checks dictionary in WestTemp. """
            self.assertTrue(WestTemp.check_nseqby_subdict(NSEQ_CHORD));
            self.assertTrue(WestTemp.check_nseqby_subdict(NSEQ_SCALE));
            self.assertFalse(WestTemp.check_nseqby_subdict(666));
            self.assertTrue(WestTemp.check_nseqby_name(NSEQ_SCALE, "Major"));
            self.assertFalse(WestTemp.check_nseqby_name(NSEQ_CHORD, "Minor"));
            self.assertFalse(WestTemp.check_nseqby_name(NSEQ_SCALE, "Minor"));
            self.assertFalse(WestTemp.check_nseqby_abbrv(NSEQ_SCALE, 
                "maj"));
            self.assertFalse(WestTemp.check_nseqby_abbrv(NSEQ_CHORD, 
                "min"));
            self.assertFalse(WestTemp.check_nseqby_abbrv(NSEQ_SCALE, 
                "min"));
            self.assertFalse(WestTemp.check_nseqby_seqpos(NSEQ_CHORD, 
                CHROM_NAT_NOTE_POS));
            self.assertTrue(WestTemp.check_nseqby_seqpos(NSEQ_SCALE, 
                CHROM_NAT_NOTE_POS));
            self.assertEqual(WestTemp.get_nseqby_name("Major", NSEQ_SCALE), 
                self.majorscale);
            self.assertEqual(WestTemp.get_nseqby_name("Ionian", NSEQ_SCALE), 
                self.majorscale);
            self.assertEqual(WestTemp.get_nseqby_name("Melodic Minor", 
                NSEQ_SCALE), self.melminscale);
            self.assertEqual(WestTemp.get_nseqby_name("Jazz Minor", 
                NSEQ_SCALE), self.melminscale);
            self.assertEqual(WestTemp.get_nseqby_name("Harmonic Minor", 
                NSEQ_SCALE), self.harmminscale);
            self.assertEqual(WestTemp.get_nseqby_name("Harmonic Major", 
                NSEQ_SCALE), self.harmmajscale); 
            self.assertEqual(WestTemp.get_nseqby_name("Dorian", 
                NSEQ_SCALE), self.dorianscale);
            self.assertEqual(WestTemp.get_nseqby_name("Locrian", 
                NSEQ_SCALE), self.locrianscale);  
            self.assertEqual(WestTemp.get_nseqby_name("Superlocrian", 
                NSEQ_SCALE), self.superlocrianscale);  
            self.assertEqual(WestTemp.get_nseqby_name("Ultralocrian", 
                NSEQ_SCALE), self.ultralocrianscale);                  
            self.assertEqual(WestTemp.get_nseqby_name("Locrian " + M_FLAT \
                + M_FLAT + "7", NSEQ_SCALE), self.dubflat7locrianscale);

            self.assertEqual(WestTemp.get_nseqby_seqpos(
                CHROM_NAT_NOTE_POS, NSEQ_SCALE), self.majorscale);

            self.assertEqual(WestTemp.get_nseqby_seqpos(
                MEL_MIN_NOTE_POS, NSEQ_SCALE), self.melminscale);
            self.assertEqual(WestTemp.get_nseqby_seqpos(
                HARM_MIN_NOTE_POS, NSEQ_SCALE), self.harmminscale);
            self.assertEqual(WestTemp.get_nseqby_seqpos(
                HARM_MAJ_NOTE_POS, NSEQ_SCALE), self.harmmajscale);                
Ejemplo n.º 3
0
 def test_temperament_dict(self):
     """ Like test_seq_dict, but checks dictionary in WestTemp. """
     self.assertTrue(WestTemp.check_nseqby_subdict(NSEQ_CHORD));
     self.assertTrue(WestTemp.check_nseqby_name(NSEQ_CHORD, "Major"));
     self.assertTrue(WestTemp.check_nseqby_name(NSEQ_CHORD, "Minor"));
     self.assertFalse(WestTemp.check_nseqby_name(NSEQ_CHORD, "Chord"));
     self.assertTrue(WestTemp.check_nseqby_abbrv(NSEQ_CHORD, 
         "maj"));
     self.assertTrue(WestTemp.check_nseqby_abbrv(NSEQ_CHORD, 
         "min"));
     self.assertFalse(WestTemp.check_nseqby_abbrv(NSEQ_SCALE, 
         "chd"));
     self.assertTrue(WestTemp.check_nseqby_seqpos(NSEQ_CHORD, 
         [0, 4, 7]));
     self.assertEqual(WestTemp.get_nseqby_name("Major", NSEQ_CHORD), 
         self.majorchord);