extensions [sound] globals [ qn dotted8th hn dottedHalf sixteenth ] ; notes needed for birthday song ; Twinkle Twinkle Little Star only ; has two different notes: ; quarterNote and halfNote ; or qn and hn if you prefer. to playNote [ theNote theLength ] sound:start-note "TRUMPET" theNote 65 wait theLength sound:stop-note "TRUMPET" theNote end to happyBirthday ; http://www.8notes.com/scores/1110.asp set qn tempo ; qn means quarter note here set dotted8th tempo * 0.75 set sixteenth tempo * 0.25 set hn 2 * qn ; hn means half note set dottedHalf 3 * qn playNote 60 dotted8th ; hap playNote 60 sixteenth ; py 60 = C playNote 62 qn ; birth 62 = D playNote 60 qn ; day 64 = E playNote 65 qn ; to 65 = F playNote 64 hn ; you 67 = G ; 69 = A playNote 60 dotted8th ; hap 70 = B flat playNote 60 sixteenth ; py ; 16th = 0.1 seconds playNote 62 qn ; birth ; 8th = 0.2 seconds playNote 60 qn ; day ; Quarter note = 0.4 seconds playNote 67 qn ; to ; Half note = 0.8 seconds playNote 65 hn ; you playNote 60 tempo * 0.75 ; hap playNote 60 tempo * 0.25 ; py playNote 72 tempo ; birth playNote 69 tempo ; day playNote 65 tempo ; dear playNote 64 tempo ; stu playNote 62 tempo ; dent playNote 70 dotted8th ; hap playNote 70 sixteenth ; py playNote 69 qn ; birth playNote 65 qn ; day playNote 67 qn ; to playNote 65 dottedHalf ; you end ; playScalePattern example was NOT shown in class. ; This is easier of the two approaches shown, and does NOT require ; all the GLOBALS like qn, hn and so on. --- ; Twinkle Twinkle Little Star only has TWO NOTE LENGTHS ; ; quarter note gets 1 unit of time or 1 count ; half note gets 2 units of time or 2 counts ; This is the EASIEST and most straightforward approach: ; tempo is a SLIDER that is set to whatever amount ; of time you want to allow for a quarter note. TO playScalePattern playNote 60 1 * tempo ; quarter note is 1 * tempo playNote 64 1 * tempo playNote 62 1 * tempo playNote 65 1 * tempo playNote 64 0.5 * tempo ; eigth note is 0.5 * tempo playNote 64 0.5 * tempo playNote 67 1 * tempo playNote 65 0.25 * tempo ; sixteenth note is 0.25 * tempo playNote 65 0.25 * tempo playNote 65 0.25 * tempo playNote 65 0.25 * tempo playNote 69 1 * tempo playNote 67 2 * tempo ; half note is two quarter notes playNote 71 1 * tempo ; and is thus 2 * tempo playNote 69 1 * tempo playNote 72 1 * tempo playNote 71 1 * tempo playNote 74 1 * tempo playNote 72 2 * tempo ; half note = 2 * tempo END