Music Project

This is not a draft; so far, it's just a dumping ground for all the U3 usic stuff I can find. --MF, 6/1/17

In this project, you will...

From Exploring List Processing

    Set Up Your Headphones or Speakers
  1. Build and compare these play scripts. Run each script a few times.
    1. play note (item (any) of (list (60) (64) (67) (72) (60))) for (1) beats
    2. for each (note) of (list (60) (64) (67) (72) (60)) (play note (note) for (1) beats)
    3. for each (note) of (map (_ + 5) over (list (60) (64) (67) (72) (60))) (play note (note) for (1) beats)
    4. for each (note) of (keep items such that (_ < 65) from (list (60) (64) (67) (72) (60))) (play note (note) for (1) beats)
    5. join (C major: ) (combine with (join () (, ) ()) items of (list (60) (64) (67)))

From Lists Review and Self Check

  1. "U3L2-PlaySong"Create a new project called U3L2-PlaySong
  2. BH: Why not spell out the keywords? The kids don't have to type them. :)
    • Aha! Because if we do, Snap! breaks the datatypes after every two (instead of 3), and that leaves the reader to look at two columns and try to read them horizontally, which is hard to do... --MF
    Create a data type note (constructor and selectors) to manage the pitch and number of beats for each note in a song.
    Set Up Your Headphones or Speakers note pch: () bts: ()
    get pitch from {}
    get beats from {}
  3. Import Tools Use for each to create a play song {} block that takes a list of notes and plays each pitch for the specified number of beats.
    Play Song data type definition
    Save Your Work You can change the notes the play song list to play a song you like or make up.
  4. Use set tempo to (240) bpm to change the pace at which the note are played.

From The Map Block: Transposing Music

The simplest bits of a scales project could also work. Two scales (I'd recommend major and double-harmonic only because they give cool variety and, btw, validate an interesting group of kids), a transposer (map), and something that plays them (for-each). --PG
    Set Up Your Headphones or Speakers
  1. Talk with Your Partner Discuss what map does in this script: for each (note) of (map (_ + 5) over (list (60) (64) (67) (72) (60))) (play note (note) for (1) beats)
  2. Open this project. It contains two musical scales (a major scale and an Egyptian scale) and a song (Twinkle Twinkle Little Star). Each is just a sound reporter that reports a list of notes.
  3. Why isn't transpose a reporter?
  4. Create a block that takes a list of note pitches and a shift number as input and plays each note on the list mapped up or down as many pitches as the input indicates. For example, this script will play the notes {65, 69, 72, 77, 65}:
    You may wish to set the tempo to something like 240.
  5. Try your transpose by block with several different shift numbers so that you can hear the impact of map.
  6. Use your transpose by block to hear the impact of map on each of the two scales and the song. For example, try:
    transpose(twinkle twinkle little star) by (-2) and play
Could pull ideas from Old Looks and Sound Page
I think this cannot be done with map... -MF

Now, you'll transpose songs, which have lists of lists of note pitches and beats.

  1. Open your U3L1-PlaySong project from Lab 1.
  2. Create a reporter block that transposes a list of sounds, where each list item is a list with the sound's note and duration. Your block should take as input a list with the song data and a number indicating how much to transpose the song.
    map will be helpful here.
    transpose {} by ()

  3. Musical scales are sets of notes ordered by pitch. For example, this is the C Major scale and the Snap! note numbers:
    CDEFGAB
    60626465676971
  4. Create a block that plays a scale.
  5. Create a reporter that generates an arpeggio of a scale...

From The Keep Block

    Set Up Your Headphones or Speakers
  1. Talk with Your Partner Discuss what keep does in this script: