your robot can play a note by “beeping” every note in music has a “frequency” – physics of...

12
Scribbler Music Web Design

Upload: mark-keeton

Post on 14-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

  • Slide 1

Slide 2 Slide 3 Your robot can play a note by beeping Every note in music has a frequency Physics of Frequencies: (http://www.phy.mtu.edu/~suits/notefreqs.html)http://www.phy.mtu.edu/~suits/notefreqs.html Notes can be controlled by beeping the correct frequency. beep(1, 440) -- Beep note A4 (Thats an A in the 4 th octave) Slide 4 Programming music by frequency is difficult! Its a lot of numbers! Scribbler has set of functions that help go from notes to frequencies. Scribbler has a range of 8 octaves (same as a piano) Scribbler has all the notes. They are denoted: C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B Slide 5 That is also the default octave which is the 5 th octave. You can create a song in python/scribbler by simply giving the note and length of the note: e.25 d.25 c.25 d.25 e.25 d.25 e.25 g.25 e.25 d.25 c.25 d.25 e.25 d.25 e.25 d.25 c.25 Slide 6 Scribbler Robots can play 2 notes simultaneously. Simply list the 2 notes on the line. F G.25 E G.25 D B.25 C C6.5 C C6.25 D B.25 E A.25 F G.25 E G.25 D B.25 E A.35 D B.25 C C6.25 F G.25 C C6.25 C1.25 C6 E6.25 B D6.50 A C6.25 G B.50 F A.25 E G.25 F A.25 E G.25 D F.25 E G.25 D F.25 C E.25 D F.25 E G.25 REST.50 C6 E6.25 B D6.50 A C6.25 G B.50 F A.25 E G.25 F A.25 E G.25 D F.25 E G.25 D F.25 C E.25 F G.25 E G.25 D B.25 C C6.5 D B.25 E A.25 F G.25 E G.25 D B.25 E A.35 D B.25 C C6.25 F G.25 C C6.50 Slide 7 Once you have the notes you need to add the timing. A whole note is 1 and half note is.5, etc. Normally a whole note is about.5 secs. You can change the tempo but sending a parameter in playSong() function. Now take the notes and the timing and you create a song! Listen Slide 8 Slide 9 Slide 10 from myro import * robot=Scribbler() s=readSong("chariots of fire.txt") robot.playSong(s) Slide 11 Find a song. You need the music to the song! Code a minute of the song correctly in scribbler music Everyone needs to do their own song! There are enough robots for everyone. Slide 12 Whole note/rest Half note/rest Quarter note/rest Eighth note/rest Slide 13 If you dont understand Ks and Hs, talk to me and Ill try and explain!