The Map Block & Music

Import Tools
  1. Try these:
    map (( )-(1)) over (list (96) (-100) (4.7)) reporting
    map (join ( ) (s)) over (list (cat) (dog) (bird)) reporting
    map (round ( )) over (list (3.14159) (87) (5.4)) reporting

Transformations of Music

    Set Up Your Headphones or Speakers
    1. 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. (Click on one of them.)
    2. You may wish to set the tempo to something like 240.
    3. Try this (note the empty input slot in the play block; you have to erase the 60 you'll find there):
      for each (item) of (twinkle twinkle little star) [play note ( ) for (0.5) beats]
    4. Also try this:
      for each (item) of (twinkle twinkle little star) [play note (item) for (0.5) beats]
    An empty input slot in the script inside a for each block means the same thing as dragging the item variable into that slot.
  1. To transpose a melody, you shift each note up or down in pitch by the same amount.
    1. Create a transpose reporter that takes a list of note pitches and a shift number as input, and uses map to report a list with each note shifted up (or down if the shift number is negative) as many pitches as the input indicates. For example, this block will report the notes {65, 69, 72, 77, 65}:
      transpose (list (60) (64) (67) (72) (60)) by (5)
    2. Try playing the result reported by your transpose by block with several different shift numbers.
    3. Use your transpose by block to hear what it does to each of the two scales and the song. For example, try:
      for each (item) of (transpose (twinkle twinkle little star) by (7)) [play note ( ) for (0.5) beats]
  2. To invert a melody means to make a new melody in which each increase in pitch becomes a decrease, and vice versa. So, the result of inverting the notes {60, 64, 67, 72, 60} would be {60, 56, 53, 48, 60}. (From 60 to 64 is a move up by 4, so in the result we move down by 4 to get 56, and so on.)
  1. Can you tell what this block of code does? Build it and listen to the inverted version of the song "Twinkle Twinkle Little Star".

  2. Wikipedia defines a round (also called a perpetual canon) as " a musical composition, in which a minimum of three voices sing exactly the same melody at the unison (and may continue repeating it indefinitely), but with each voice beginning at different times so that different parts of the melody coincide in the different voices, but nevertheless fit harmoniously together". Study the following block of code and identify what each part of the code does. Then build this block and try it on the song "Twinkle Twinkle Little Star" with an appropriate delay value.

  3. A song like "Row Row Row Your Boat" might be more suitable for a round. Open this file, study it and create a version of the round block that will accomodate the pitch and length parameters of each note of the song.