1 Chapter 8: Frequency and Sound Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.

Slides:



Advertisements
Similar presentations
Music Terms & Symbol Review
Advertisements

The length of sound or silence in music reading.
Chapter 2: Rhythm and Pitch
Rest Duration Ms. Delgados Music Class. Rest Duration A Whole Rest receives four full beats.
Bellringer – Day 8 1)What is duration in music? 2)What is pitch in music? 3)What is your favorite color?
Music Terms & Symbol Review
Chapter 6: Digital Display
Chapter 3: Digital Inputs - Pushbuttons
1 Chapter 8: Frequency and Sound Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
T HE M ATHEMATICS OF M USIC Katherine Goulde. O UTLINE Basic tonal theory Sound and Hertz Note values and rhythm Intervals Scales Overtones Harmonics.
1 Chapter 9: Electronic Building Blocks Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
From Sound to Music CSC 161: The Art of Programming Prof. Henry Kautz 11/16/2009.
1 Chapter 2: Light on- Lights off Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
Music and Mathematics are they related?. What is Sound? Sound consists of vibrations of the air. In the air there are a large number of molecules moving.
1 Chapter 7: Measuring Light Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
1 Lecture 1: Your Boe-Bot's Servo Motors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
1 Chapter 7: Navigating with Infrared Headlights Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation developed.
1 Chapter 4: Controlling Motion Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
Beat and Tempo Time Signatures. Beat Beat  is a unit of measurement. The beat is related to the pulse/feel of the music, which is related to the time.
Processor Technology and Architecture
Aspects of Music Rhythm The aspect of music concerned with the organization of time. Primarily the durations of the sounds and silences that make up.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Chapter 6 C Arrays Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc. Arrays are data structures.
1 Chapter 5: Measuring Rotation Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
Games and Simulations O-O Programming in Java The Walker School
3rd Grade Music Book.
A quarter note is a note that, in a 4/4 time signature, receives 1 beat. In the 4/4 time signature, there are 4 beats per measure, so one quarter note.
The Nuts & Bolts of Music
Making music Consider music as structured sound Components include –Pitch –Duration –Instrument –Stereo direction Each attribute has a set of possible.
MIDI and YOU Orchestra in a Box. What is MIDI?  Musical Instrument Digital Interface  MIDI is a protocol - a standard by which two electronic instruments.
Beats = Some Graphs Recall what a single frequency tone sounds like Play on Sound Generator A=440 Hz. The Graph:
TJHSST Computer Systems Lab Senior Research Project Designing a Music Scripting Language Casey Mihaloew Abstract: The problem addressed in this.
Song Pro Retro Alex Harper. Contents of Presentation Inspiration Basic Concept Speaker Module.sng file structure Song Pro Retro: Light Song Pro Retro:
1 Basic Electronics Voltage (V or E): Potential difference between 2 points. Volts. (+) - A lack of electrons (-) – A surplus of electrons When a circuit.
1 A Modification of Chapters 5 & 7 Slides Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by:
Computers Are Your Future Eleventh Edition Chapter 2: Inside the System Unit Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall1.
1 Chapter 6: Light Sensitive Navigation With Photoresistors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation.
1 Chapters 2 And 3 Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel Southern.
Digital Audio IV MIDI Overview. Sending MIDI Information I. Serial Transmission A. Single cable to move data B. Slower than parallel, but is less expensive.
CH. 21 Musical Sounds. Musical Tones have three main characteristics 1)Pitch 2) Loudness 3)Quality.
Vocab. Power Point Randall York. Additive Synthesis A synthesis technique that creates a periodic signal by adding sinusoids together.
1 Lecture 1: Your Boe-Bot's Servo Motors Presentation based on: "Robotics with the Boe-Bot" By Andy Lindsay Parallax, Inc Presentation developed by: Martin.
We call : etc. at the beginning of the music the _____ signatures Question 1.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
ENGR 101: Robotics Lecture 3 – Robot Motion Outline  Robot Motion  FOR Loops  Making Music References 
Quia Tier 3 Quarter 1 Week 1. Pitch Definition: How high or low a note sounds.
Your robot can play a note by “beeping” Every note in music has a “frequency” – Physics of Frequencies: (
 2007 Pearson Education, Inc. All rights reserved C Arrays.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 5A Transforming Data Into Information.
MUSIC ELEMENTS.
TJHSST Computer Systems Lab Senior Research Project Designing a Music Scripting Language Casey Mihaloew Abstract: The problem addressed in this.
Computing with Music: Creating Musical Patterns Campy, 2005 Quinnipiac University Computing with Music: Creating Musical Patterns John Peterson No Longer.
Music Terms & Symbol Review. Measure Clef A symbol that assigns pitches to the staff.
Musical Note Values By: S. Melanie Pierre.
Elements of music All forms of music from all societies and cultures have common characteristics and elements Rhythm - How the beat is broken down Melody.
Quia Tier 3 Quarter 1 Week 1.
SOUND ORGANIZED IN TIME
Pitch.
Chapter 5: Tactile Navigation With Whiskers
Chapter 8: Frequency and Sound
Notation Vocabulary Pitch Catalog – Rhythm Chart
Rhythm Review 8th Grade.
Rhythm Review 8th Grade.
Ms. Delgado’s Music Class
Processing Sound Ranges part 3
Chapter 7: Measuring Light
Chapter 5: Measuring Rotation
Presentation transcript:

1 Chapter 8: Frequency and Sound Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel Southern Illinois University Carbondale College of Applied Sciences and Arts Electronic Systems Technologies Electronic Systems Technologies 9/10/03

2 Use and Copyright This presentation supplements "What's a Microcontroller" by Andy Lindsay. (Link to text at Parallax)Link to text This presentation is not a replacement for the text. Important concepts of the text are highlighted. gold In some cases, additional material has been added to augment the text. Denoted by titles colored gold. Full program listings are generally not provided in the presentation. Distribution: This presentation may be freely distributed without modifications. Modifications are permitted by schools and organizations for internal use only. Credits, use and copyright slides must remain.

3 Electric Beeps From your alarm clock to microwave to automobiles and ATM machines your day is full of devices sounding beeps to alert you or indicate actions to be taken. Microcontrollers produce sounds by sending high/low signals very quickly to a speaker. The speed at which the signal repeats is called frequency and is measured in cycles per second or Hertz (Hz) which produce the desired tone or pitch.

4 Piezoelectric Speaker The piezoelectric speaker is common, small and inexpensive speaker used in many devices though it lacks in audio quality.

5 ACTIVITY #1: Building and Testing the Speaker

6 Programming Speaker Control The FREQOUT command sends high/low signals to the specified pin at the frequency and for the duration defined. FREQOUT Pin, Duration, Freq1, {Freq2} To play a note at 2000Hz which lasts 1.5 seconds:

7 Nested Loop Inner Loop Outer Loop The inner loop is performed fully every repetition of the outer loop. Below a nested loop is used so that FREQOUT cycles through durations from 15 to 1. For each duration it cycles through frequencies from 2000 to 2500 in increments of 20.

8 Example Nested Loop

9 Two Frequencies at Once The FREQOUT command has an optional parameter called Freq2. This allows playing 2 frequencies simultaneously. At times the frequencies will combine to aid and at other times oppose creating a beat frequency at the difference between the two. FREQOUT 9, 5000, 2000, 2005

10 ACTIVITY #3: Musical Notes and Simple Songs Each key on a piano is a specific frequency corresponding to a note. There are 12 groups of notes, each at a higher octave. An octave is a doubling of frequency, so C7 is double the frequency of C6.

11 Storing and Retrieving Data The DATA command is similar to WRITE but stores a list of expressions. {Symbol} DATA {Word} DataItem1,{DataItem2,… } For example: Notes DATA "C","C","G","G","A","A","G" Stores the characters in EEPROM, with the 1 st location called Notes. Each subsequent address is Notes+index value.

12 Notes DATA "C","C","G","G","A","A","G" Check to view ASCII Location Notes+0 Notes +1 Notes +2

13 This code stores a list referenced by Frequencies with each taking 2 bytes because they are greater than 255 and stored as Words. As such, when read, index*2 is used to jump 2 at a time. Frequencies DATA Word 2093, Word 2093, Word 3136, Word 3136, Word 3520,Word 3520, Word 3136

14 TwinkleTwinkle.bs2 – Abbreviated version When index = 0

15 Second pass When index = 1

16 Activity #4: Microcontroller Music Note durations in music are defined as whole, half, quarter, eighth, sixteenth and thirty-second of a whole note. The duration of the whole note depends on the tempo of the music. Some music has a vary fast tempo, others very slow. Rests are durations when no tones are played.

17NotesAndDurations.bs2 This program uses a combination of Data, lookup and lookdown to play a piece of music. The music to be played is stored using DATA. For durations: 1=whole, 2= ½ and so on.

18 Index is used to read each note and duration, the note’s frequency is looked up. For example, for note 3 (index=2). 2 E is Read Offset of E is looked up 7 is offset Offset of 7 is used to lookup freq. Duration is read using same index. Tone is played.

19 Review Questions The command to generate a frequency is _________. The 1 st parameter or argument in the command defines the pin. The 2 nd defines the __________ and the 3 rd the __________. A FOR-NEXT Loop inside another is called a ________ Loop. When using the DATA command, the expressions are stored in __________. Given the code fragment, what would X be? ______ Vals DATA 1,2,3,5 READ Vals+2,X FREQOUT DURATION FREQUENCY NESTED EEPROM 3