4
<title>A Denemo Keymap</title>
5
<author>AT, JRR, RTS</author>
9
<action>ReadingNoteNamesSolfege</action>
10
<scheme>;;;;;;;;;;;;;;;
11
;;ReadingNoteNamesSolfege NEW VERSION
12
;; tests solfege note name recognition.
15
(define ReadingNoteNamesSolfege::score 0)
16
(define ReadingNoteNamesSolfege::interval 8)
17
(define ReadingNoteNamesSolfege::start (current-time))
18
(define ReadingNoteNamesSolfege::end (current-time))
19
(define ReadingNoteNamesSolfege::note_position 0)
20
(define ReadingNoteNamesSolfege::notewas #f)
21
(define ReadingNoteNamesSolfege::LastNoteCorrect? #t)
22
(define ReadingNoteNamesSolfege::ExtraChances 2)
24
(define (ReadingNoteNamesSolfege::showscore)
25
(d-DirectivePut-score-display "ReadingNoteNamesSolfege::GameScore" (string-append "<b>Score: " (object->string ReadingNoteNamesSolfege::score) "</b> in " (object->string (- ReadingNoteNamesSolfege::end ReadingNoteNamesSolfege::start)) " Secs.")))
27
;#t give differnt note
28
(define (ReadingNoteNamesSolfege::AnotherChance?)
30
(not ReadingNoteNamesSolfege::LastNoteCorrect?)
31
(>= ReadingNoteNamesSolfege::ExtraChances 0)))
33
;;;;;;;;; callback when user chooses a note
34
(define (ReadingNoteNamesSolfege::notechosen usernote)
36
(set! ReadingNoteNamesSolfege::end (current-time))
37
;(let gotoEnd () (if (d-NextObject) (gotoEnd)))
38
(EducationGames::gotoEnd)
39
(if (string=? ReadingNoteNamesSolfege::notewas usernote)
41
(set! ReadingNoteNamesSolfege::score (+ ReadingNoteNamesSolfege::score 1))
42
(set! ReadingNoteNamesSolfege::LastNoteCorrect? #t)
43
(EducationGames::PlaceAnswerStatus "CheckMark"))
45
(set! ReadingNoteNamesSolfege::score (- ReadingNoteNamesSolfege::score 1))
46
(set! ReadingNoteNamesSolfege::LastNoteCorrect? #f)
47
(set! ReadingNoteNamesSolfege::ExtraChances (- ReadingNoteNamesSolfege::ExtraChances 1))
48
(EducationGames::PlaceAnswerStatus "CrossSign"))
50
(ReadingNoteNamesSolfege::offerNote)))
53
(define (ReadingNoteNamesSolfege::print)
54
(d-DeletePreviousObject)
55
(SetHeaderField "title" "Note Naming Game")
56
(SetHeaderField "subtitle" (string-append "Score was: " (object->string ReadingNoteNamesSolfege::score)
57
" in " (object->string (- ReadingNoteNamesSolfege::end ReadingNoteNamesSolfege::start)) " Seconds"))
58
(SetHeaderField "piece" "user: anonymous")
59
(DenemoPrintAllHeaders)
61
(d-DirectiveDelete-header "Movement-title")
62
(d-DirectiveDelete-header "Movement-subtitle")
63
(d-DirectiveDelete-header "Movement-piece")
64
(ReadingNoteNamesSolfege::offerNote)
66
(define (ReadingNoteNamesSolfege::quit)
68
(define (ReadingNoteNamesSolfege::help)
69
(d-InfoDialog "Click on the bottom of the range of notes you want to learn.
70
Use the Interval button to choose how many notes above that you want to try.
71
Print out your score when you have finished.")
74
(define (ReadingNoteNamesSolfege::plus)
75
(set! ReadingNoteNamesSolfege::interval (+ ReadingNoteNamesSolfege::interval 1))
76
(if (> ReadingNoteNamesSolfege::interval 32)
77
(set! ReadingNoteNamesSolfege::interval 32))
78
(d-DirectivePut-score-display "ReadingNoteNamesSolfege::GameInterval"
79
(string-append "<span font_desc=\"12\">Interval: " (object->string ReadingNoteNamesSolfege::interval) "</span>")))
81
(define (ReadingNoteNamesSolfege::minus)
82
(set! ReadingNoteNamesSolfege::interval (- ReadingNoteNamesSolfege::interval 1))
83
(if (< ReadingNoteNamesSolfege::interval 2)
84
(set! ReadingNoteNamesSolfege::interval 2))
85
(d-DirectivePut-score-display "ReadingNoteNamesSolfege::GameInterval"
86
(string-append "<span font_desc=\"12\">Interval: " (object->string ReadingNoteNamesSolfege::interval) "</span>")))
88
(define (ReadingNoteNamesSolfege::setInterval)
89
(set! ReadingNoteNamesSolfege::interval (string->number (d-GetUserInput "Interval" "Give number of steps you want to name note over" (object->string ReadingNoteNamesSolfege::interval))))
90
(if (boolean? ReadingNoteNamesSolfege::interval)
91
(set! ReadingNoteNamesSolfege::interval 8))
92
(if (< ReadingNoteNamesSolfege::interval 2)
93
(set! ReadingNoteNamesSolfege::interval 2))
94
(if (> ReadingNoteNamesSolfege::interval 32)
95
(set! ReadingNoteNamesSolfege::interval 32))
96
(d-DirectivePut-score-display "ReadingNoteNamesSolfege::GameInterval"
97
(string-append "<span font_desc=\"12\">Interval: " (object->string ReadingNoteNamesSolfege::interval) "</span>")))
101
(define (ReadingNoteNamesSolfege::go)
102
(if (not (zero? ReadingNoteNamesSolfege::score))
104
(set! response (d-GetUserInput "Reset Score" "Do you want to reset your score" "y"))
105
(if (equal? response "y")
107
(set! ReadingNoteNamesSolfege::start (current-time))
108
(set! ReadingNoteNamesSolfege::end (current-time))
110
(set! ReadingNoteNamesSolfege::score 0)))))
111
(d-DeletePreviousObject)
112
(ReadingNoteNamesSolfege::offerNote))
116
;;;;;;;; the main function to run the test - just goes to end and places a note at a random height above the cursor, returning the cursor to where it was.
117
(define (ReadingNoteNamesSolfege::offerNote)
125
;(let gotoEnd () (if (d-NextObject) (gotoEnd)))
126
(EducationGames::gotoEnd)
127
(if (ReadingNoteNamesSolfege::AnotherChance?)
129
;(d-CursorToNote (EducationalGames::middle_c_offset->lily ReadingNoteNamesSolfege::note_position))
132
(set! steps (+ 1 (random ReadingNoteNamesSolfege::interval)))
133
;(EducationGames::shiftup steps)
134
(set! ReadingNoteNamesSolfege::note_position (+ ReadingNoteNamesSolfege::note_position steps))
135
(d-CursorToNote (EducationalGames::middle_c_offset->lily ReadingNoteNamesSolfege::note_position))
137
(set! ReadingNoteNamesSolfege::ExtraChances 2)))
138
(set! ReadingNoteNamesSolfege::notewas (d-GetNoteName))
139
(ReadingNoteNamesSolfege::showscore)
140
;(EducationGames::shiftdown steps)
141
(if ReadingNoteNamesSolfege::LastNoteCorrect?
142
(set! ReadingNoteNamesSolfege::note_position (- ReadingNoteNamesSolfege::note_position steps)))
145
(EducationGames::Chime)
149
(CreateButton "ReadingNoteNamesSolfege::GameScore" "<span font_desc=\"24\">Click to start</span>")
150
(CreateButton "ReadingNoteNamesSolfege::GameHelp" "<b>Help</b>")
151
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::GameHelp" "(ReadingNoteNamesSolfege::help)")
155
(CreateButton "ReadingNoteNamesSolfege::GamePlus" "<b>+</b>")
156
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::GamePlus" "(ReadingNoteNamesSolfege::plus)")
157
(CreateButton "ReadingNoteNamesSolfege::GameInterval" (string-append "<span font_desc=\"12\">Interval: " (object->string ReadingNoteNamesSolfege::interval) "</span>"))
158
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::GameInterval" "(ReadingNoteNamesSolfege::setInterval)")
159
(CreateButton "ReadingNoteNamesSolfege::GameMinus" "<b>-</b>")
160
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::GameMinus" "(ReadingNoteNamesSolfege::minus)")
165
(CreateButton "ReadingNoteNamesSolfege::GameGo" "<span font_desc=\"24\">start</span>")
166
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::GameGo" "(ReadingNoteNamesSolfege::go)")
167
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::GameScore" "(ReadingNoteNamesSolfege::go)")
170
(CreateButton "ReadingNoteNamesSolfege::GamePrint" "<span font_desc=\"24\">Print</span>")
171
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::GamePrint" "(ReadingNoteNamesSolfege::print)")
174
(CreateButton "ReadingNoteNamesSolfege::Close" "<span font_desc=\"24\">Quit</span>")
175
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::Close" "(ReadingNoteNamesSolfege::quit)")
180
(define (ReadingNoteNamesSolfege::createbuttons solfege note)
181
(CreateButton (string-append "ReadingNoteNamesSolfege::" solfege) (string-append " <span font_desc=\"24\" foreground=\"blue\">" solfege "</span>"))
182
(d-SetDirectiveTagActionScript (string-append "ReadingNoteNamesSolfege::" solfege) (string-append "(ReadingNoteNamesSolfege::notechosen \"" note "\")")))
185
(CreateButton "ReadingNoteNamesSolfege::spacer1" "<span font_desc=\"28\"> </span>")
186
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::spacer1" "(d-PlayMidiKey #xF03001)")
188
(ReadingNoteNamesSolfege::createbuttons "do" "c")
189
(ReadingNoteNamesSolfege::createbuttons "re" "d")
190
(ReadingNoteNamesSolfege::createbuttons "me" "e")
191
(ReadingNoteNamesSolfege::createbuttons "fa" "f")
192
(ReadingNoteNamesSolfege::createbuttons "so" "g")
193
(ReadingNoteNamesSolfege::createbuttons "la" "a")
194
(ReadingNoteNamesSolfege::createbuttons "si" "b")
196
(CreateButton "ReadingNoteNamesSolfege::spacer2" "<span font_desc=\"28\"> </span>")
197
(d-SetDirectiveTagActionScript "ReadingNoteNamesSolfege::spacer2" "(d-PlayMidiKey #xF03001)")
199
(EducationGames::Chime)
201
<label>Solfege Note Name Recognition</label>
202
<tooltip>%tests your ability to name the notes of the scale</tooltip>