Date: Tue, 17 Nov 2009 17:53:22 -0600 (CST) From: Mark Jacobson To: 810-025-01-fall@uni.edu Subject: Followup to NetLogo music group exercise (Oh Susanna)... Hi 025 students, Here is an example useful to utilize to do what we did today as a group exercise, or started to do. First see the Happy Birthday song at: http://www.8notes.com/scores/1110.asp Then see the NetLogo turtle graphics code to "sing" that song or rather to "play" that song with the Trumpet. http://www.cs.uni.edu/~jacobson/025/logo/happyBirthday.txt to playNote [ theNote theLength ] sound:start-note "TRUMPET" theNote 65 wait theLength sound:stop-note "TRUMPET" theNote end playNote 60 2 would play the middle C note on the trumpet for a length of 2 seconds. 60 = middle C 60 + 12 = 72 which is one octave above middle C 60 62 64 65 67 69 71 72 C D E F G A B C is the C major scale --- --- From C to shining C --- --- sea sea 60 62 64 65 67 69 71 72 -- -- -- -- -- -- -- -- C D E F G A B C is the C major scale See you (C you or sea you) on Thursday in the classroom (322 ITT). --------- Just copy and paste the code into NetLogo procedures area and then type: happyBirthday to hear the "song' or type playNote 60 3 to hear a 3 second long middle C or playNote 72 1 to hear a higher C, in honor of Hi-C, the famous fruit drink. Mark