Music Project
Unit 3 Optional Project
This page needs KEEP SUCH THAT updated. –MF, 6/22/20
PG: I’d very much want to have a map-onto-scale one. (I have an example somewhere.) Kids who care about music will find the switches interesting, and even kids who claim not to be able to hear the differences will.
BH: This is fine as far as it goes, but it calls out for more, starting with a note-name-to-midi-number reporter, and then making a round.
MF: BH has reviewing to do (see TG)
This page has been renumbered; need to check if this throws off the numbering in the solutions or TG. –MF, 4/26/19
See also:
- Old sound content collected together
- Old Looks and Sound page
-
The
Map
Block & Music (has invert and round)
In this project, you will use the Snap! play note
block to create music while you review abstract data types and higher-order functions.
-
“U3-MusicProject”
Reviewing Higher-Order Functions with Sound
-
Build and compare these
play
scripts. Run each script a few times.The inputs values given to the
play note
block are musical pitches. Higher values create higher notes. You can input any integer from 0 and 127. The number 60 represents middle C.
Need to Review?
These need updating!! –MF, 4/5/19
-
You learned about
for each
in Unit 2 Lab 2: Checking Each Quiz Answer. -
You learned about
keep
in Unit 2 Lab 3. -
You learned about
map
in Unit 3 Lab 2.
Creating an Abstract Data Type to Organize Musical Data
-
Pitch is the amount of highness or lowness of a musical note; the pitch value goes in the first input slot of the
play note
block.The length of a note is the amount of time that the note plays (the number of beats); the length value goes in the second slot of
play note
.Create a
note
ADT to manage the pitch and length of each note in a song.-
Create the constructor:
-
Create two selectors:
-
Create the constructor:
Creating Blocks to Play Music
-
Use
for each
together with your selectors to build a block that takes a list of notes as input and plays each pitch for the specified number length of time.
-
Create a reporter to reports the notes for a song of your choosing. Here’s an example:
-
Test your song with your
play song
block, and debug any problems.
- Use the block to change the pace at which the notes are played. A higher number will make your song play faster; a lower number will make it play slower.
BPM stands for “beats per minute.”
Transposing Music
-
Compare the output of these two scripts that you created above. Discuss what
map + 5
does to the sounds you hear:
-
Use
map
together with your ADT blocks to create a reporter that transposes (shifts) a list of notes. It should take a list of notes and a number indicating how much to transpose (shift) the song as input, and it should report the adjusted song. For example:
-
Try playing your song using your
transpose
block with several different shift numbers so that you can hear the impact ofmap
.
Doesn’t work in Snap! but would have been a nice way to tie the page together… :/
Creating a Round
Boring? Maybe not for A/V kids…
Using a Frequency Cutoff
-
Compare the output of these two scripts that you created above. Discuss what
keep \< 65
does to the sounds you hear:
- …