Homework 5: Due Midnight on Tuesday November 3rd.

Making Music

Write a Matlab script to play 'Twinkle Twinkle Little Star'. You can use parts of the program provided in the Lessons on sound to calculate the frequencies on the eight notes on the musical scale (C,D,E,F,G,A,B,C), or you can hard-code the numbers from this list:

C 278.4375 (Hz)
D 312.5355
E 350.8093
F 371.6695
G 417.1849
A 468.2742
B 525.6200
C 556.8750

The notes on the musical scale, starting with C, are denoted like this:

The notes for twinkle twinkle little star are shown below. By comparing the positions of the notes below with the scale above, you can see that the song starts with the note 'C'. And starts like this: C-C-G-G-A-A-G, and so on. The open notes mean that the note should be played twice as long.

You can play it at any pace you like, and put any sort of pauses between the notes (or not). If you want to get fancy, 'ramp' the beginning and ends of the notes so have a more gentle onset and offset.

OPTIONAL ASSIGNMENT: If you're tired of 'twinkle twinkle' choose a different song instead, or at least part of one.