/* Melody
* (cleft) 2005 D. Cuartielles for K3
*
* This example uses a piezo speaker to play melodies. It sends
* a square wave of the appropriate frequency to the piezo, generating
* the corresponding tone.
*
* The calculation of the tones is made following the mathematical
* operation:
*
* timeHigh = period / 2 = 1 / (2 * toneFrequency)
*
* where the different tones are described as in the table:
*
* note frequency period timeHigh
* c 261 Hz 3830 1915
* d 294 Hz 3400 1700
* e 329 Hz 3038 1519
* f 349 Hz 2864 1432
* g 392 Hz 2550 1275
* a 440 Hz 2272 1136
* b 493 Hz 2028 1014
* C 523 Hz 1912 956
*
* http://www.arduino.cc/en/Tutorial/Melody
*/
int speakerPin = 9;
int button1 = 3;
int button2 = 4;
int button3 = 5;
int val1 = 0;
int val2 = 0;
int val3 = 0;
int length = 15; // the number of notes
char notes[] = "ccggaagffeeddc "; // a space represents a rest
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tone);
digitalWrite(speakerPin, LOW);
delayMicroseconds(tone);
}
}
void playNote(char note, int duration) {
char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };
// play the tone corresponding to the note name
for (int i = 0; i < 8; i++) {
if (names[i] == note) {
playTone(tones[i], duration);
}
}
}
void setup() {
pinMode(speakerPin, OUTPUT);
pinMode(button1, INPUT);
pinMode(button2, INPUT);
pinMode(button3, INPUT);
}
void loop() {
val1 = digitalRead(button1);
val2 = digitalRead(button2);
val3 = digitalRead(button3);
if (val1 == LOW) {
playNote('c', 1 * tempo);
// } else {
// playNote(notes[i], beats[i] * tempo);
}
if (val2 == LOW) {
playNote('e', 1 * tempo);
}
if (val3 == LOW) {
playNote('g', 1 * tempo);
}
}
Drew's Day
May 22, 2013
World's silliest arduino-based electronic musical instrument
This is the world's silliest arduino-based electronic musical instrument. It is a mashup of the "Melody" tutorial and the "Button" tutorial. The code I modified (see below) strips out the part where the tune is actually played and instead plays a single note when each button is pressed.
Hoop jumping
INCIDENTAL COMICS: Message to a Graduate
By the end of high school, all I could see was the hoop jumping. I was so sick of it: every class was predetermined for me with only my extracurriculars to numb the boredom of the required classes. I looked forward to college knowing that while I would have to take general education classes, at least I would have options to choose from.
By the end of college, I saw that while the hoops were fewer and further between, I still detested them. I put off some general education classes until the last year I was in school. I looked forward to going to grad school where there would be no hoops to jump through.
By the end of grad school, I realized that I was wrong about the hoops. They were still there, they were just disguised. I grudgingly jumped through them and looked forward to getting out of grad school so I could be free of the hoops.
By now I've come to understand that the hoops never truly go away. But what this comic says to me is that I can choose my own goals which are interesting to me. That makes all the difference in the world.
(Thanks to @rjallain for pointing the comic out to me on twitter.)
![]() |
| Image credit: Grant Snider, Incidental Comics |
By the end of high school, all I could see was the hoop jumping. I was so sick of it: every class was predetermined for me with only my extracurriculars to numb the boredom of the required classes. I looked forward to college knowing that while I would have to take general education classes, at least I would have options to choose from.
By the end of college, I saw that while the hoops were fewer and further between, I still detested them. I put off some general education classes until the last year I was in school. I looked forward to going to grad school where there would be no hoops to jump through.
By the end of grad school, I realized that I was wrong about the hoops. They were still there, they were just disguised. I grudgingly jumped through them and looked forward to getting out of grad school so I could be free of the hoops.
By now I've come to understand that the hoops never truly go away. But what this comic says to me is that I can choose my own goals which are interesting to me. That makes all the difference in the world.
(Thanks to @rjallain for pointing the comic out to me on twitter.)
May 08, 2013
New rules for screencast assignments
I tend to really hate rules in the classes I teach. I like the formats to be free flowing so that students are empowered to learn in their own way and in their own style.
I like screencasts as assessments, especially when I'm able to get them watched and responded to rapidly as intended. But anyone who makes blanket statements about students today being "digital natives" who grew up online creating and sharing content have not been in the same classrooms I've been in.
For next year I have some new rules for submitting screencasts:
1.) I will only accept URLs as screencast submissions. I don't want a file as an attachment to an email in whatever crazy format came out of the camera. I don't want an audio file with a snapshot of the work done. I don't want a thumbdrive with each screencast file sized over 300 MB. I want a link to your screencast which is on youtube, screencast.com, vimeo or similar.
2.) All students will be shown this Public Service Announcement on the first day. If I can't see the work done on the page while I'm in full screen mode, then what is the point of getting the visuals? Not that it is much better sometimes when the camera is held close to the page. My head hurts after watching videos where less than half a page of work is shown in video and so the camera is constantly panning back and forth. The same goes for videos sent to me in landscape orientation but with the page rotated...or upside down. Students will be told to watch their videos before sending me the link.
3.) All phones must have notifications turned off while recording screencasts. I'm listening to screencasts when the volume explodes with some random buzzing and I jump out of my skin. It is five freaking minutes that the text messages, facebook updates, tweets, emails, phone calls and instagrams can just be shut down.
Most of the complaints I have are about screencasts done using cell phone cameras. I don't mind the use of the cell phone camera, it just seems more prone to the problem videos that I get.
I like screencasts as assessments, especially when I'm able to get them watched and responded to rapidly as intended. But anyone who makes blanket statements about students today being "digital natives" who grew up online creating and sharing content have not been in the same classrooms I've been in.
For next year I have some new rules for submitting screencasts:
1.) I will only accept URLs as screencast submissions. I don't want a file as an attachment to an email in whatever crazy format came out of the camera. I don't want an audio file with a snapshot of the work done. I don't want a thumbdrive with each screencast file sized over 300 MB. I want a link to your screencast which is on youtube, screencast.com, vimeo or similar.
2.) All students will be shown this Public Service Announcement on the first day. If I can't see the work done on the page while I'm in full screen mode, then what is the point of getting the visuals? Not that it is much better sometimes when the camera is held close to the page. My head hurts after watching videos where less than half a page of work is shown in video and so the camera is constantly panning back and forth. The same goes for videos sent to me in landscape orientation but with the page rotated...or upside down. Students will be told to watch their videos before sending me the link.
3.) All phones must have notifications turned off while recording screencasts. I'm listening to screencasts when the volume explodes with some random buzzing and I jump out of my skin. It is five freaking minutes that the text messages, facebook updates, tweets, emails, phone calls and instagrams can just be shut down.
Most of the complaints I have are about screencasts done using cell phone cameras. I don't mind the use of the cell phone camera, it just seems more prone to the problem videos that I get.
Labels:
screencasts,
teaching
March 30, 2013
On gender stereotypes, rocket science and the f-bomb
Rocket scientist dies. NYT obit leads with her cooking skills, husband and kids. Oh just fuck off. nyti.ms/13GUqax HT @stevesilbermanThe above was retweeted by someone I follow this afternoon, and I was interested enough to follow the link to see what the minor uproar was about.
— Ed Yong(@edyong209) March 30, 2013
Reading the obituary, I learned a great deal about the contributions to engineering of rocket systems used in satellites and space missions made by an engineer who happened to be a woman. As so often happens when I read obituaries, I was a little sad that I did not know more about Yvonne Brill's accomplishments during her lifetime, but I do feel enriched by having learned something about her life and work.
Of course, the reason that the obituary was pointed out by Ed Yong was because it leads (lede? I'm not a journalist.) off with a stereotype of a women as a cook and mother. I take Yong's outrage to be that because this was first in the article, it must be assumed that we are to think that Brill was foremost a mother and wife and secondarily, therefore lesser, a scientist or engineer.
When people I respect link to other people that I don't follow on twitter, I do want to take them seriously. On the other hand, I have hesitations about engaging with people dropping f-bombs. The chance that the issue raised is too likely to be emotionally charged that I have a hard time judging rationally the actual content of the article. In this case, I had to reread the article three times so that I felt I could honestly evaluate the problems with this article.
Here's the introduction to the obituary:
She made a mean beef stroganoff, followed her husband from job to job and took eight years off from work to raise three children. “The world’s best mom,” her son Matthew said.
But Yvonne Brill, who died on Wednesday at 88 in Princeton, N.J., was also a brilliant rocket scientist, who in the early 1970s invented a propulsion system to help keep communications satellites from slipping out of their orbits.Is there a way that it could have been written to be less offensive? Let's try this:
She made a mean beef stroganoff, followed her husband from job to job and took eight years off from work to raise three children. “The world’s best mom,” her son Matthew said.
Yvonne Brill, who died on Wednesday at 88 in Princeton, N.J., was a brilliant rocket scientist, who in the early 1970s invented a propulsion system to help keep communications satellites from slipping out of their orbits.That's better. There's no need to include words like "but" and "also" when we're talking about people's career versus personal life. The distinction should be obvious to any reader.
Can we make any other improvements? What if the order of the first two paragraphs were switched?
Yvonne Brill, who died on Wednesday at 88 in Princeton, N.J., was a brilliant rocket scientist, who in the early 1970s invented a propulsion system to help keep communications satellites from slipping out of their orbits
She made a mean beef stroganoff, followed her husband from job to job and took eight years off from work to raise three children. “The world’s best mom,” her son Matthew said.I personally feel the argument that starting with the cooking and family life details is implicitly misogynistic to be a little weak. I had to read the article multiple times to make sure I wasn't missing something more than the opening paragraphs. By my count, 16 of the 22 paragraphs were about Brill's work, including being a woman in a male-dominated field. Is she not also entitled to be remembered for what she was like away from the office? By simply reversing the order of the two first paragraphs, the implicit framing of Brill as woman first, scientist second is removed, no doubt. For me, that's enough to justify a claim that the obituary could have been better written.
But, can we take the outrage down a few notches? Reading through the conversation following Yong's tweet, it seems that there is a "you're either with us, or you're against us" mentality. No doubt, there are some who just don't get what the outrage is about. Are we trying to raise awareness about how profiles of scientists can be framed in potentially harmful ways, or are we just looking to have outrage for the sake of outrage?
For me, I learned about the life work of a person I had never heard of, and I am grateful I now know a bit about her. But, it was also a reminder why I'm skeptical of emotionally charged tweets. In this case, I clicked through, and was please to learn about Brill. I might have just as easily decided to skip the article because of the language in Yong's tweet. Frustrated or not with gender stereotypes, I don't believe that the science community is necessarily always better off with outrage as the default reaction.
March 04, 2013
Why I don't like the "Doppler Rocket"
It's time for me to rethink how we look at the Doppler effect in class.
When I'm working with a class on the physics of sound, whether it is a general physics class or a physics of music class, the Doppler effect is always one of the topics in whatever textbook we are using. Time permitting, we will look at the Doppler effect. I think it's an interesting topic, and it certainly has important and useful applications in other fields of science: astronomy, medicine, weather, etc.
What I can't stand, though, is the terrible quality of the standard acoustic Doppler effect demos. I'm talking about the demonstrations where you take a sound source and tie a string to it, then whirl the string around your head with the sound source making a circle around you. The class is supposed to hear the change in pitch alternating between getting higher (while the source is moving toward them) and going lower (while moving away from them).
Unfortunately, the demo often has two major flaws with it:
1.) The change is pitch is often within the just noticeable difference (jnd) for non-ear trained musicians.
and,
b.) The change in pitches is almost always overwhelmed by the observation of the relative change in AMPLITUDE. As the source moves away from the class, it seems to be less loud, and louder as it is approaching the class.
The situation is not much better when the demo is using a "Doppler Rocket" or "Doppler Ball" where a sound source is embedded in a soft ball then thrown or slid along a guide string across the room. While it is usually the case that the frequency change can be more noticeable with these demos, since the speed of the ball can be high enough to make the frequency be outside the average jnd, my experience has been that the change in amplitude is even more dramatic with the Doppler Rockets.
What to do? For me, it's interesting. I mean, one of the main ideas in science is that we only want to test one thing at a time. But in this experiment, we seemingly have two inextricably linked quantities that are changing.
I don't have a real good answer for what I want to do to get around these conceptual challenges. I've tried an Interactive Lecture Demo style presentation on the Doppler effect without the success I was hoping for. I may try that approach again, but I'm sort of leaning towards making the Doppler effect a lab activity where students have to confront the two aspects of the experiment (frequency and amplitude) and tease them out separately. I'm not sure if that will work at the introductory level, but I'm willing to try.
When I'm working with a class on the physics of sound, whether it is a general physics class or a physics of music class, the Doppler effect is always one of the topics in whatever textbook we are using. Time permitting, we will look at the Doppler effect. I think it's an interesting topic, and it certainly has important and useful applications in other fields of science: astronomy, medicine, weather, etc.
What I can't stand, though, is the terrible quality of the standard acoustic Doppler effect demos. I'm talking about the demonstrations where you take a sound source and tie a string to it, then whirl the string around your head with the sound source making a circle around you. The class is supposed to hear the change in pitch alternating between getting higher (while the source is moving toward them) and going lower (while moving away from them).
Unfortunately, the demo often has two major flaws with it:
1.) The change is pitch is often within the just noticeable difference (jnd) for non-ear trained musicians.
and,
b.) The change in pitches is almost always overwhelmed by the observation of the relative change in AMPLITUDE. As the source moves away from the class, it seems to be less loud, and louder as it is approaching the class.
The situation is not much better when the demo is using a "Doppler Rocket" or "Doppler Ball" where a sound source is embedded in a soft ball then thrown or slid along a guide string across the room. While it is usually the case that the frequency change can be more noticeable with these demos, since the speed of the ball can be high enough to make the frequency be outside the average jnd, my experience has been that the change in amplitude is even more dramatic with the Doppler Rockets.
What to do? For me, it's interesting. I mean, one of the main ideas in science is that we only want to test one thing at a time. But in this experiment, we seemingly have two inextricably linked quantities that are changing.
I don't have a real good answer for what I want to do to get around these conceptual challenges. I've tried an Interactive Lecture Demo style presentation on the Doppler effect without the success I was hoping for. I may try that approach again, but I'm sort of leaning towards making the Doppler effect a lab activity where students have to confront the two aspects of the experiment (frequency and amplitude) and tease them out separately. I'm not sure if that will work at the introductory level, but I'm willing to try.
March 02, 2013
Weekend book review: The Radioactive Boy Scout
One of the first magazine articles I ever remember reading on the internet was the story of a teenager who wanted to build a nuclear reactor at his home. This was probably in 1998, during the thick of my time in college majoring in physics. That time, as I recall, was before it was common to have magazine articles online. But Harpers Magazine was forward thinking, and the article was linked to from several nerdy websites that I read daily back then.
I learned about the concept of a breeder reactor, I learned that smoke detectors often used radioactive sources for their operation, and I learned that I wanted to know more about this story. I was happy to hear that the author of the book had written a full-length book on the topic.
It took me awhile, but I finally got around to reading the book "The Radioactive Boy Scout" a few years ago. I was not disappointed in the fleshing out of the story, although I was also not surprised that in parts of the book it felt like it was being padded to fill space.
The book was definitely a quick read, and it was worth going back to after years of first hearing the story.
The Radioactive Boy Scout: The Frightening True Story of a Whiz Kid and His Homemade Nuclear Reactor by Ken Silverstein
My rating: 4 of 5 stars
View all my reviews
I learned about the concept of a breeder reactor, I learned that smoke detectors often used radioactive sources for their operation, and I learned that I wanted to know more about this story. I was happy to hear that the author of the book had written a full-length book on the topic.
It took me awhile, but I finally got around to reading the book "The Radioactive Boy Scout" a few years ago. I was not disappointed in the fleshing out of the story, although I was also not surprised that in parts of the book it felt like it was being padded to fill space.
The book was definitely a quick read, and it was worth going back to after years of first hearing the story.
The Radioactive Boy Scout: The Frightening True Story of a Whiz Kid and His Homemade Nuclear Reactor by Ken SilversteinMy rating: 4 of 5 stars
View all my reviews
Labels:
bookreview
March 01, 2013
Is Marcus right? (Physics of the Funnies)
Here's another comic that I think could be used to spark discussion in a physics class. Some questions that I would want to elicit from my class:
How long is Marcus watching Jason fall?
What forces are on Jason?
How would we characterize Jason's motion? (constant velocity vs. accelerating)
Then, to go Mythbuster's style on the discussion: is the scenario plausible? Of course, it is a comic strip; it does not have to be plausible. But, if it is not plausible, what conditions would have to be met to get the motion depicted in the comic?
Finally (for this post, at least): is Marcus right in what he says at the end? Would using less helium make a difference?
February 28, 2013
Ancient astronomy
The above image is the first slide that I use to introduce the topic of ancient astronomy in my introductory astronomy course. It's something I put together a few years ago, and although I still sort of like it, I have a hard time remembering exactly what all the thumbnails are supposed to be representing. As best as I can remember, the points I was trying to illustrate when I first put this slide together were:
1.) Many cultures around the world had at least rudimentary knowledge of the night sky, and in many cases had knowledge of astronomical alignments related to the calendar.
2.) We don't have time in class to talk about all of the interesting things that these cultures knew about. There is a LOT of interesting material that we could go into, but in the interest of getting to some modern astronomy topics, we have to pick and choose some ancient astronomy topics and leave the rest mostly untouched. That's not to say that non-Western cultures did not know about or explore the cosmos.
From left to right in the above image, then:
The pyramid is El Castillo, also known as the Temple of Kukulkan located at Chichen Itza (not Chicken Pizza, as my tour guide told me when I went there a few years ago). The temple is aligned such that on the equinoxes the sun casts a shadow over the steps of the pyramids which connects to the heads of serpents carved into the base of the steps. It's a pretty neat effect, and shows the Mesoamericans knew when the equinox would arrive and how to align the structure to accomplish the effect. The Chichen Itza site also has what is thought to be an astronomical observatory on it. The tour I went on did not allow for a very close approach to the building, nor did the guide we have know much about that particular structure.
The middle image is (I THINK) a photo of the ruins of Babylon. I do not believe that the particular image had any astronomical significance. Rather, I think I was trying to point out that many cultures in the middle east (Babylonians, Sumerians, Assyrians) at least attempted to understand the night sky. Clearly, I am not a historian, anthropologist, or archeology expert. I would like to know more about the ancient astronomical knowledge of the middle east.
On the right is a photo of a an armillary sphere at the Purple Mountain Observatory in China. This type of sphere was used by ancient astronomers to measure the position of stars in the night sky. What is not clear from the article that I linked to is whether or not the pictured instrument is an original or a replica. I seem to recall that the armillary sphere at the Purple Mountain Observatory is actually a replica of the ancient instrument. I think that the replica is itself relatively old, but again, it's not clear from the page I linked to.
Maybe in the future I can dig up the original references I was using to piece together this slide. For now, I'm happy with what I have.
1.) Many cultures around the world had at least rudimentary knowledge of the night sky, and in many cases had knowledge of astronomical alignments related to the calendar.
2.) We don't have time in class to talk about all of the interesting things that these cultures knew about. There is a LOT of interesting material that we could go into, but in the interest of getting to some modern astronomy topics, we have to pick and choose some ancient astronomy topics and leave the rest mostly untouched. That's not to say that non-Western cultures did not know about or explore the cosmos.
From left to right in the above image, then:
The pyramid is El Castillo, also known as the Temple of Kukulkan located at Chichen Itza (not Chicken Pizza, as my tour guide told me when I went there a few years ago). The temple is aligned such that on the equinoxes the sun casts a shadow over the steps of the pyramids which connects to the heads of serpents carved into the base of the steps. It's a pretty neat effect, and shows the Mesoamericans knew when the equinox would arrive and how to align the structure to accomplish the effect. The Chichen Itza site also has what is thought to be an astronomical observatory on it. The tour I went on did not allow for a very close approach to the building, nor did the guide we have know much about that particular structure.
The middle image is (I THINK) a photo of the ruins of Babylon. I do not believe that the particular image had any astronomical significance. Rather, I think I was trying to point out that many cultures in the middle east (Babylonians, Sumerians, Assyrians) at least attempted to understand the night sky. Clearly, I am not a historian, anthropologist, or archeology expert. I would like to know more about the ancient astronomical knowledge of the middle east.
On the right is a photo of a an armillary sphere at the Purple Mountain Observatory in China. This type of sphere was used by ancient astronomers to measure the position of stars in the night sky. What is not clear from the article that I linked to is whether or not the pictured instrument is an original or a replica. I seem to recall that the armillary sphere at the Purple Mountain Observatory is actually a replica of the ancient instrument. I think that the replica is itself relatively old, but again, it's not clear from the page I linked to.
Maybe in the future I can dig up the original references I was using to piece together this slide. For now, I'm happy with what I have.
Subscribe to:
Posts (Atom)
