Creating Music with Scribbler Robots: A Guide to Notes and Frequencies
Discover how to program music with Scribbler robots using notes and frequencies! This guide explores the physics of sound and how each musical note correlates to a specific frequency. Learn to control notes using functions that convert notes to frequencies, accommodating a full range of eight octaves. We provide examples of how to create songs in Python/Scribbler by specifying notes and their durations. Uncover the challenges and joys of programming music while enabling your robot to play beautiful melodies!
Creating Music with Scribbler Robots: A Guide to Notes and Frequencies
E N D
Presentation Transcript
Scribbler Music Web Design
Notes • 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) • Notes can be controlled by beeping the correct frequency. • beep(1, 440) -- Beep note A4 (That’s an “A” in the 4th octave)
Scribbler Music • Programming music by frequency is difficult! • It’s 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
Scribbler music e .25 d .25 c .25 d .25 e .25 e .25 e .25 d .25 d .25 d .25 e .25 g .25 g .25 e .25 d .25 c .25 d .25 e .25 e .25 e .25 e .25 d .25 d .25 e .25 d .25 c .25 • That is also the default octave which is the 5th octave. • You can create a song in python/scribbler by simply giving the note and length of the note:
Harmony F G .25 F G .25 F G .25 F G .25 F G .25 F G .25 E G .25 E G .25 E G .25 E G .25 E G .25 E G .25 D B .25 D B .25 D B .25 D B .25 D B .25 D B .25 C C6 .5 C C6 .25 C C6 .25 D B .25 E A .25 F G .25 F G .25 F G .25 F G .25 F G .25 F G .25 E G .25 E G .25 E G .25 E G .25 E G .25 E G .25 D B .25 D B .25 D B .25 D B .25 E A .35 D B .25 C C6 .25 F G .25 C C6 .25 C1 .25 C1 .25 C6 E6 .25 B D6 .50 A C6 .25 G B .50 F A .25 E G .25 E G .25 E G .25 E G .25 F A .25 E G .25 D F .25 D F .25 D F .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 E G .25 E G .25 E G .25 F A .25 E G .25 D F .25 D F .25 D F .25 D F .25 E G .25 D F .25 C E .25 F G .25 F G .25 F G .25 F G .25 F G .25 F G .25 E G .25 E G .25 E G .25 E G .25 E G .25 E G .25 D B .25 D B .25 D B .25 D B .25 D B .25 D B .25 C C6 .5 C C6 .5 C C6 .5 D B .25 E A .25 F G .25 F G .25 F G .25 F G .25 F G .25 F G .25 E G .25 E G .25 E G .25 E G .25 E G .25 E G .25 D B .25 D B .25 D B .25 D B .25 E A .35 D B .25 C C6 .25 F G .25 C C6 .50 Scribbler Robots can play 2 notes simultaneously. Simply list the 2 notes on the line.
Songs… • 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…
Chariots of Fire Db 0.25 Db Gb 0.25 Ab 0.25 Bb 0.25 DbAb 0.5 Db F 0.5 Db 0.25 Db Gb 0.25 Ab 0.25 Bb 0.25 DbAb 1 Db 0.25 Db Gb 0.25 Ab 0.25 Bb 0.25 DbAb 0.5 Db F 0.5 F 0.25 Db Gb 0.25 F 0.25 Db 0.25 Gb4 Db 1 Db 0.25 Db Gb 0.25 Ab 0.25 Bb 0.25 DbAb 0.5 Db F 0.5 Db 0.25 Db Gb 0.25 Ab 0.25 Bb 0.25 DbAb 0.5 Db F 0.5 Db 0.25 Db Gb 0.25 Ab 0.25 Bb 0.25 DbAb 0.5 Db F 0.5 F 0.25 Db Gb 0.25 F 0.25 Db 0.25 Gb4 Db 1 Db6 .25 C6 .25 Bb .25 Ab .25 F C6 .375 Ab .125 Db Bb .375 Gb .125 DbAb .375 Db Db6 .125 Db C6 .25 Db Bb .25 DbAb .25 F C6 1 C Gb 1 F 2 Db6 .25 C6 .25 Bb .25 Ab .25 F C6 .375 F Ab .125 Db Bb .375 Db Gb .125 DbAb .375 Db F .125 Db Gb .25 Db F .25 Db .25 Db 1
Playing a song from myro import * robot=Scribbler() s=readSong("chariots of fire.txt") robot.playSong(s)
Your Project • 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.
Notes of the scale… • If you don’t understand K’s andH’s, talk to me and I’ll try and explain!