Chapter 4. Color, Music, and Pizazz



Similar documents
Chapter 2. Making Shapes

California Treasures High-Frequency Words Scope and Sequence K-3

MSW LOGO 2. MSW LOGO is a programming language that lets you store a series of instructions on the computer.

Logo PROGRAMMING WITH MSW Logo

Ten easy steps to creating great MicroWorlds EX projects. Steve Robson

Organizing image files in Lightroom part 2

Phonics. High Frequency Words P.008. Objective The student will read high frequency words.

H ello, I ll be demonstrating

FREE CHORD BOOK Introduction

Xylophone. What You ll Build

A Note to Parents. 1. As you study the list, vary the order of the words.

Getting Started with WebSite Tonight

Preschool March Lessons. Dr. Seuss Day. One Day Free Sample

PUSD High Frequency Word List

Getting Started in Tinkercad

OA3-10 Patterns in Addition Tables

Ummmm! Definitely interested. She took the pen and pad out of my hand and constructed a third one for herself:

Chapter 2 How To Cheat A Barre Chord

What you should know about: Windows 7. What s changed? Why does it matter to me? Do I have to upgrade? Tim Wakeling

The Fruit of the Spirit is Love

Fry Phrases Set 1. TeacherHelpForParents.com help for all areas of your child s education

GarageBand 2.0 Getting Started

Self-Acceptance. A Frog Thing by E. Drachman (2005) California: Kidwick Books LLC. ISBN Grade Level: Third grade

How to Use the Drawing Toolbar in Microsoft Word

Interview with David Bouthiette [at AMHI 3 times] September 4, Interviewer: Karen Evans

I Miss My Pet: A workbook for children about pet loss

Beginners Guide to the Walkingbass

family games Taking the kids swimming is a great way of making sure they re moving around and having fun. And to help you get them into

The Sonometer The Resonant String and Timbre Change after plucking

SMART BOARD USER GUIDE FOR PC TABLE OF CONTENTS I. BEFORE YOU USE THE SMART BOARD. What is it?

Table of Contents. Creating Simple Solos Dan Denley's

Homework Activities for Kindergarten

Lesson 26: Reflection & Mirror Diagrams

SALE TODAY All toys half price

Jesus Chooses His Disciples

Song Writing. Main Goal: Learn how to define and call functions. OVERVIEW: PREPARATION: VOCABULARY: OBJECTIVE: MATERIALS: LESSON NAME:

Introduction to U-verse Easy Remote

Tapescript. B Listen and write the words. C Help the baby spider. Draw a red line. D Help the baby frog. Listen and draw a green line.

Hello Purr. What You ll Learn

How to Win Against Sin Lesson One: Our Enemy, Our Hero

Using sentence fragments

Microsoft PowerPoint 2010 Handout

Female Child s date of birth: Last name: State/ Province: Home telephone number:

[elo'quia. S 1 / 6. Please mark the correct answer with a X. Example: I must my homework this evening. X. Duration: 45 minutes.

3-D Workshop AT A GLANCE:

Last name: State/ Province: Home telephone number:

SMARTstuff. The first rule for using an interactive whiteboard is very simple and of the utmost importance: Have faith in yourself you can do this!

Introduction. 1 st Reason. Extension of 1 st reason. Elaboration of 1 st reason. 2nd Reason. Extension of 2nd reason. Elaboration of 2nd reason

Lottery Looper. User Manual

Appendix 1: Adaptable Templates

Algebra: Real World Applications and Problems

I CAN DO IT LYRICS. I put my heart and my mind to it And I can do it.

Create A Collage Of Warped Photos

On Your Marks: Under-5s Day 2 Jesus heals Bartimaeus Mark 10: 46-52

HOW TO VIEW AND EDIT PICTURES

mouse (or the option key on Macintosh) and move the mouse. You should see that you are able to zoom into and out of the scene.

DIGITAL MUSIC DAY 1 WHAT IS SOUND? ANALOG AND DIGITAL EARLY RECORDING WAX FOR YOUR EARS ROUND BUT FLAT WIRE AND TAPE PURE SOUND

Banjo Basics For Standard G Tuning

One Day. Helen Naylor. ... Level 2. Series editor: Philip Prowse. Cambridge University Press One Day.

Digital Marketing EasyEditor Guide Dynamic

TeachingEnglish Lesson plans. Kim s blog

Appointments: Calendar Window

Visit the Piano Learning Center of the Piano Technicians Guild at for more fun ways to learn about the piano.

Logo for Kids: An Introduction. by Bob DuCharme

If you know exactly how you want your business forms to look and don t mind

Insights Discovery Profiles. A Tour of Your Insights Discovery Profile. info.seattle@insights.com. Page 1 of 6

LESSON 7: IMPORTING AND VECTORIZING A BITMAP IMAGE

Put Your Song to the Tests

The Keyboard in Black and White

The Promised Land. You will need: Other items depending on the activities chosen

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python

1When I get busy I tend to just start piling stuff in my work area. Pretty

Instructions for Creating a Poster for Arts and Humanities Research Day Using PowerPoint

Last name: State/ Province: Home telephone number:

1. Three-Color Light. Introduction to Three-Color Light. Chapter 1. Adding Color Pigments. Difference Between Pigments and Light. Adding Color Light

Week 2 Practical Objects and Turtles

Ep #19: Thought Management

Christmas Theme: The Greatest Gift

CREATIVE S SKETCHBOOK

Building A Computer: A Beginners Guide

Lowercase Letters Capital Letters Picture Cards

2. Setting Up The Charts

Breathe. Relax. Here Are the Most Commonly Asked Questions and Concerns About Setting Up and Programming the SurroundBar 3000.

3D Drawing. Single Point Perspective with Diminishing Spaces

Banquet with Simon. (Luke 7:36-50) Keep these tips in mind as you welcome kids to the workshop and explore the story together.

Programming LEGO NXT Robots using NXC

BBC Learning English Talk about English Business Language To Go Part 2 - Induction

Waves Trans-X. Software Audio Processor. User s Guide

SMART board 101. SMART board 101 Training

Teaching Children to Praise

Microsoft Office Word 2007 Training

Phonics. P.041 High Frequency Words. Objective The student will read high frequency words.

Scripts. WARM MARKET (someone you know of ) CALL BACK SCRIPT (POSTCARDS, ProSTEP, COLD CALLS) SCHEDULE THE LIVE PRESENTATION CALL

The Instant Impresario Guitar Instruction Guide

Junior Cookie CEO Badge Activity Plan 1

CBA Fractions Student Sheet 1

Offline Files & Sync Center

Jesus is The Way. A copy of the activity sheet for each child A hole-punch Crayons, scissors, yarn, and double-sided tape Duct tape for one activity

GUITAR THEORY REVOLUTION. Part 1: How To Learn All The Notes On The Guitar Fretboard

Avatar: Appearance Changing Your Shape Introduction Instruction Practice LEVEL: 1 MODULE: AVATAR: APPEARANCE MISSION 2

Transcription:

Chapter 4. Color, Music, and Pizazz Drawing thin white lines on a dull white screen gets real boring real fast. So before we go any further, let s add some pizazz to Logo procedures. Add color to your procedures! Add music. Animate the turtle. Change its shape. Make flashing signs. There s all sorts of things you can do too many to describe here. Let s get started. You can discover the rest on your own. Adding Some Color You can change the color of the background, the color used to fill shapes, and the color of the turtle's pen. You can even change the size of the turtle s pen. Setting Colors MSW Logo gives you far more than just the few colors Logy is using. MSW Logo color commands use three numbers to measure the mix of red, green, and blue. 109

SETPENCOLOR [255 255 255] SETPC, for short tells Ernestine what color to use to draw a line. SETFLOODCOLOR [000 000 000] SETFC, for short lets you fill a closed shape with a color. You must go inside the shape to use this command. SETSCREENCOLOR [255 000 000] SETSC, for short sets the background color to whatever you want it to be. Look at the numbers inside the brackets. You can use any number from 0 to 255 for shades of red, green, and blue. With all those choices, you can make just about any color more than 16 million if you want. And, of course, setting all those numbers for all those colors can be a real hassle. So Morf went off and wrote some procedures to make life a bit easier. For example TO PINK OP [255 200 255] OP is the shortcut for OUTPUT. This is a command that must be used with another procedure. It does just what the name says, it outputs something to another command. You ll hear lots more about this in Part 2 of The Turtle s Discovery Book. For now, we ll keep it simple. Before we get started with adding colors, here s a whole bunch of pen color procedures. They re in the COLORS.LGO procedure that was installed with MSW Logo. 110

TO BLACK OP [000 000 000] TO BLUE OP [000 000 255] TO BROWN OP [128 64 0] TO CYAN OP [0 255 255] TO DKGREEN OP [0 128 128] TO GREEN OP [000 255 000] TO GREY OP [128 128 128] TO MAGENTA OP [255 0 255] 111

TO OLIVE OP [128 128 0] TO ORANGE OP [255 128 255] TO PURPLE OP [128 0 128] TO RED OP [255 0 0] TO WHITE OP [255 255 255] TO YELLOW OP [255 255 0] Now make some of your own color procedures TO OP [ ] TO OP [ ] 112

TO OP [ ] TO OP [ ] Now Morf doesn t need to remember all the different codes for colors. He simply adds the color name to his procedures. SETPC BLACK sets the pen color to [000 000 000] or black. SETFC BLUE sets the fill color to [000 000 255] or blue. Use it with the FILL command to fill closed shapes with color. TO FILL.IT SETPC BLACK REPEAT 4 [FD 100 RT 90] PU RT 45 FD 40 PD SETFC RED FILL PU HOME PD The first thing this procedure does is draw a square using a black pen color. Then the turtle picks the pen up, moves inside the square, and puts the pen down. The flood color is set to red, and then the square is filled. 113

SPECIAL NOTE: If FILL didn t work just right on your computer, don t be too surprised. It works differently on different computers. The same goes for setting the screen color. One way to fix the screen is to left-click on the Zoom menu and then select In. The picture gets twice as big as it was. And the square should look filled. If not, another way to fix it is to minimize your screen and then restore it again. You can also move the Commander window over the drawing and then put it back where it belongs. (We talked about moving the Commander window back in chapter 2.) Cyan is a light blue color. Let s set the screen to cyan, set the pen to red, and fill the square with yellow. TO FILL.IT SETSC CYAN SETPC RED REPEAT 4 [FD 100 RT 90] PU RT 45 FD 40 PD SETFC YELLOW FILL PU HOME PD That s not bad. But the red line is sorta thin. 114

Setting the Pen Size Tired of skinny lines? Try colorful fat ones. You can change the size of the lines that are drawn with the SETPENSIZE command. SETPENSIZE takes two inputs representing width and height. There s a long technical reason why there are two numbers. The easy thing is to just remember that both numbers should be the same. The standard or default values are [1 1]. You can make those values just about anything you want. Try this SETPENSIZE [500 500] FD 100 Now that just about fills the screen, doesn t it? So you need to be careful not to get too carried away. Try this TO FILL.IT SETSC CYAN SETPC RED SETPENSIZE [5 5] REPEAT 4 [FD 100 RT 90] PU RT 45 FD 40 PD SETFC YELLOW FILL PU HOME PD There! Now you can see a bold red line. Want to try something really new? How about this one! First, write a simply procedure to send the turtle forward and then back. 115

TO STAR LT 18 REPEAT 5 [FD 200 RT 144] Now let s add some pizazz! TO PIZZAZ SETSC WHITE SETPENSIZE [120 120] SETPC PURPLE STAR SETPENSIZE [100 100] SETPC BLUE STAR SETPENSIZE [80 80] SETPC MAGENTA STAR SETPENSIZE [60 60] SETPC RED STAR SETPENSIZE [40 40] SETPC ORANGE STAR SETPENSIZE [20 20] SETPC YELLOW STAR SETPENSIZE [5 5] SETPC GREEN STAR Now that you have the pizazz, let s add some flash! TO FLASH REPEAT 20 [CS SETSC BLACK PIZZAZ] Wow! Not bad, huh? Of course, what this looks like depends somewhat on the type of computer you are using. A 120 MHz Pentium is a lot faster than a 25 MHz 386 system. Try something like this, maybe TO TRI REPEAT 3 [FD 200 RT 120] 116

TO PIZZAZ SETSC CYAN CS HT PU LT 45 FD 100 RT 45 PD SETPENSIZE [120 120] SETPC PURPLE RT 30 TRI PU HOME LT 45 FD 80 RT 45 PD SETPC BLUE RT 30 TRI PU HOME LT 45 FD 60 RT 45 PD SETPC MAGENTA RT 30 TRI PU HOME LT 45 FD 40 RT 45 PD SETPC RED RT 30 TRI PU HOME LT 45 FD 20 RT 45 PD SETPC ORANGE RT 30 TRI PU HOME PD SETPC YELLOW RT 30 TRI PU HOME RT 135 FD 20 LT 135 PD SETPC GREEN RT 30 TRI This gives you another idea or two of what you can do with the basic color commands. We ll use these more as we go on. But for now, why not explore what you can do with color and the shapes that you know. After that how about some sound? 117

Add Some Sound Effects MSW Logo allows you to do lots of different things with sounds including music. SOUND is the command for making music. It takes two inputs, the frequency of the sound and the length of time it is to play. The length of time, or duration, is based on the speed of your computer. So you ll have to do some experimenting to make it sound the way you want. Frequency is the number of sound waves per second. So what s a sound wave you ask? When you drop a pebble into a pool of water, you see the waves move out from where the pebble hit the water. Sound acts the same way. It travels in waves out in all directions from the source of the sound. 118

Think of that line through the middle as the pond when there are no waves. When you make a wave, part of it rises above the level of the pond. Part of it sinks below the level of the pond. When you make lots of sound waves in each second, the sound is higher fewer waves per second gives a lower sound. For example, when a piano wire vibrates 262 times each second, you get the note Middle C. When it vibrates 440 times each second, you get the note A above middle C at 220 vibrations per second, you get the note A below middle C. Here are two octaves of sounds you can use to play music. FREQUENCY NOTE 220 A (below Middle C) 223 A# 247 B 262 C (Middle C) 277 C# 294 D 311 D# 330 E 349 F 370 F# 392 G 415 G# 440 A 466 A# 494 B 523 C 554 C# 587 D 622 D# 659 E 119

698 F 740 F# 784 G 831 G# Making Music Time to put all this good sound stuff to use. First let s write procedures for the basic scale. Those are for the notes, C D E F G A B CC (that s high C). TO C SOUND [262 100] TO D SOUND [294 100] TO E SOUND [330 100] TO F SOUND [349 100] TO G SOUND [392 100] TO A SOUND [440 100] 120

TO B SOUND [494 100] TO CC SOUND [523 100] Now you can start playing music from the keyboard. Just press the letter for the note you want to hear and press ENTER. There s another way also that s to write a song procedure. TO SAINTS SOUND [262 100] SOUND [330 100] SOUND [349 100] SOUND [392 300] WAIT 50 SOUND [262 100] SOUND [330 100] SOUND [349 100] SOUND [392 300] WAIT 50 SOUND [262 100] SOUND [330 100] SOUND [349 100] SOUND [392 200] SOUND [330 200] SOUND [262 200] SOUND [300 200] SOUND [294 200] 121

Saints is a song popular in New Orleans part of When the Saints Go Marching In. We threw in another command you ll find useful the WAIT command. You ll have to experiment with the numbers you use with WAIT to find what works best on your computer just like duration. You need to find out what duration numbers work best for you. Rabbit Trail 12. Morf s Shoebox Guitar Here s a real simple experiment you can do with sound and sound waves make a shoebox guitar. No it s not Logo. But it s fun anyway. If you want to learn how Logo and the computer can make music, try it out. You ll need a shoebox with a top, three small rubber bands all the same size makes for the best demonstration, small scissors, and some tape. 1. Cut a round hole in your boxtop like this. 2. Tape the top of the box to the bottom. 3. Cut three small tabs on each end of the box as shown below. 122

4. Put the first rubber band under the first tab and stretch it over the top to the tab in the same position on the other end of the box. 5. Put the second rubber band under the middle tab and stretch over the top to the middle tab on the other end of the box. 6. Put the third rubber band under the third tab and stretch that over the top to the third tab on the other end of the box. 7. Slide a pencil under the rubber bands near the hole in the top like the black line in the picture on the previous page. If your rubber bands are not stretched pretty tight, find some smaller rubber bands. Now you re ready for some music. When you strum your guitar, you re not going to sound like the newest country music star. But Morf doesn t sing very well either. Back to business when you strum the guitar, the rubber bands vibrate. This vibration is what makes sounds. Rubber bands that are stretched tighter vibrate faster, which makes them sound higher. Those that are not quite so tight don t vibrate quite so fast. These sound lower. The box picks up the sound and makes it sound a bit louder. The sound goes through the hole and rattles around inside making it sound louder than if the hole wasn t there. Tape a piece of paper over the hole in your box. When you strum your rubber bands, is the sound any different now? OK, how does the computer make music? The simple way is to have the computer turn the power up high and then down low for the frequency (number of times per second) and the duration you set. The sound 123

wave you get from this is more like a square wave than a nice rounded wave. That s why some simple sound effects played through the computer s speaker sound funny. These electronic square waves make the computer s speaker vibrate. And this vibration of the speaker is what lets you hear the sound you programmed. Sounds lots better than a shoe box, doesn t it? There s one more thing we need to talk about and that s loudness or volume. If you turn up the volume, does that change the frequency? No volume changes the height of the sound wave. But you still have the same number of waves per second. 124

What s the difference between this sound wave and the one a few pages back. The wave is as wide as the other one. That means it is the same frequency. But it moves farther away from the center line. That means it is louder than the first sound wave. Get it? Good now go have some fun with MSW Logo sounds. Some More Ideas You ve added color and sound to your procedures. Before you go too far, why not see what you can do with these new commands. What can you do with shapes now? Can you color them? Why not draw a colorful birthday cake and then play Happy Birthday? How about drawing colorful lines that streak across the screen like a rock concert laser show? Remember the FLASH procedure? That gives you an idea on how to get started. There s lots of things you can do to add pizazz to procedures right now. Give it a try. We ve got lots more to do and see after this. 125

126