~presto-developers/presto/trunk

« back to all changes in this revision

Viewing changes to src/Language/Presto/Tests/LilypondMuInternNotes.hs

  • Committer: Joao Paulo Pizani Flor
  • Date: 2011-01-09 18:11:28 UTC
  • Revision ID: joaopizani@gmail.com-20110109181128-56nh94wtczzi809x
Introduction to the programmer guide written; Rests are now completely handled and muifyed correctly

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
                    testSimpleNoteNonWholeTime, testComplexNote, testLittleTimedMelody,
17
17
                    testComplexMelody, testOneSimpleChord, testEMajorOneOctAbove,
18
18
                    testAComplexChord, testASimpleTimedChord, testASimpleChordWithComplexTime,
19
 
                    testModerateChordModerateTime, testMelodicModerateChord ]
 
19
                    testModerateChordModerateTime, testMelodicModerateChord, testOneSingleRest,
 
20
                    testSequenceOfPitchesWithRest, testTimedRestCommonTime, testComplexMelodyWithRest ]
20
21
 
21
22
 
22
23
-- The absolute BASS is the lowest possible note to be played.
52
53
        expected = muMelodicUntimed [39]
53
54
        actual   = muify $ octavated [('c',"",1)]
54
55
 
 
56
testOneSingleRest = "testOneSingleRest" ~: expected @=? actual
 
57
    where
 
58
        expected = muMelodicUntimed [-1]
 
59
        actual   = muify $ simpleNotes "r"
 
60
 
55
61
testSequenceOfPitches = "SequenceOfPitches" ~: expected @=? actual
56
62
    where
57
63
        expected = muMelodicUntimed [50,50,51,53,53]
58
64
        actual   = muify $ octavated [('b',"",1),('b',"",1),('c',"",2),('d',"",2),('d',"",2)]
59
65
 
 
66
testSequenceOfPitchesWithRest = "SequenceOfPitchesWithRest" ~: expected @=? actual
 
67
    where
 
68
        expected = muMelodicUntimed [50,50,51,53,-1,53]
 
69
        actual   = muify $ octavated [('b',"",1),('b',"",1),('c',"",2),('d',"",2),('r',"",0),('d',"",2)]
 
70
 
60
71
testExhaustiveSequence = "ExhaustiveSequence" ~: expected @=? actual
61
72
    where
62
73
        expected = muMelodicUntimed [0, 1, 1, 2, 3, 2, 3, 4, 4, 5, 6, 6, 7, 8, 7, 8, 9, 9, 10, 11,
63
 
                        11, 12, 13, 13, 14, 15, 14, 15, 16, 16, 17, 18, 18, 19, 20 ]
 
74
                        11, 12, 13, 13, 14, 15, 14, 15, 16, 16, 17, 18, 18, 19, 20, -1 ]
64
75
        actual   = muify $ octavated noteList
65
76
        noteList = [('a',"",-3), ('a',"#",-3), ('b',"b",-3), ('b',"",-3), ('b',"#",-3),
66
77
                ('c',"b",-2), ('c',"",-2), ('c',"#",-2),
72
83
                ('b',"b",-2), ('b',"",-2), ('b',"#",-2),
73
84
                ('c',"b",-1), ('c',"",-1), ('c',"#",-1),
74
85
                ('d',"b",-1), ('d',"",-1), ('d',"#",-1),
75
 
                ('e',"b",-1), ('e',"",-1), ('e',"#",-1) ] 
 
86
                ('e',"b",-1), ('e',"",-1), ('e',"#",-1),
 
87
                ('r',"",0) ] 
76
88
 
77
89
testSimpleNoteCommonTime = "SimpleNotesCommonTime" ~: expected @=? actual
78
90
    where
79
91
        expected = muMelodicTimed [(1.0, 41)]
80
92
        actual   = muify $ timed [('d',"",1, Just (1 % 4))]
81
93
 
 
94
testTimedRestCommonTime = "testTimedRestCommonTime" ~: expected @=? actual
 
95
    where
 
96
        expected = muMelodicTimed [(0.5, -1)]
 
97
        actual   = muify $ timed [('r',"",0, Just (1 % 8))]
 
98
 
82
99
testSimpleNoteComplexTime = "SimpleNoteComplexTime" ~: expected @=? actual
83
100
    where
84
101
        expected = muMelodicTimed [(1.0, 7)]
107
124
                        ('f',"#",1, Just (1 % 4)), ('g',"b",1, Just (1 % 4)),
108
125
                        ('a',"#",0, Just (1 % 4)) ]
109
126
 
 
127
testComplexMelodyWithRest = "ComplexMelodyWithRest" ~: expected @=? actual
 
128
    where
 
129
        expected = muMelodicTimed [(1.0,28), (1.0,55), (1.0,45), (1.0,45), (1.0,-1), (1.0,37)]
 
130
        actual   = muify $ timed [('c',"#",0, Just (1 % 4)), ('e',"",2, Just (1 % 4)),
 
131
                        ('f',"#",1, Just (1 % 4)), ('g',"b",1, Just (1 % 4)),
 
132
                        ('r',"",0, Just (1 % 4)), ('a',"#",0, Just (1 % 4)) ]
 
133
 
110
134
testOneSimpleChord = "OneSimpleChord" ~: expected @=? actual
111
135
    where
112
136
        expected = muChordUntimed [ [39,43,46] ]