Muziek-Project

See also:

In this project, you will use the Snap! play note block to create music while you review abstract data types and higher order functions.

  1. "U3-MusicProject"Geen Afbeelding
  2. Geen Afbeelding
  3. Geen Afbeelding

Reviewing Higher Order Functions with Sound

  1. 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.
    1. Geen Afbeelding
    2. Geen Afbeelding
    3. Geen Afbeelding
    4. Geen Afbeelding

Need to Review?

Creating an Abstract Data Type to Organize Musical Data

  1. 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.
    1. Create the constructor:
      Geen Afbeelding
    2. Create two selectors:
      Geen Afbeelding Geen Afbeelding
Geen Afbeelding

Creating Blocks to Play Music

  1. Use for each together with your selectors to build a Geen Afbeelding block that takes a list of notes as input and plays each pitch for the specified number length of time.
    Geen Afbeelding
  2. Create a reporter to reports the notes for a song of your choosing. Here's an example:
    Geen Afbeelding Geen Afbeelding
  3. Test your song with your play song block, and debug any problems.
    Geen Afbeelding
  4. Geen Afbeelding
    BPM stands for "beats per minute."
  1. Use the Geen Afbeelding 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.

Transposing Music

  1. Geen Afbeelding Compare the output of these two scripts that you created above. Discuss what map + 5 does to the sounds you hear:
    Geen Afbeelding
    Geen Afbeelding
  2. 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:
    Geen Afbeelding
  3. Try playing your song using your transpose block with several different shift numbers so that you can hear the impact of map.
Doesn't work in Snap! but would have been a nice way to tie the page together... :/

Creating a Round

If kept, include an explanation of what rounds are like on this draft page.
Geen Afbeelding GitHub Issue #1807
Boring? Maybe not for A/V kids...

Using a Frequency Cutoff

  1. Geen Afbeelding Compare the output of these two scripts that you created above. Discuss what keep < 65 does to the sounds you hear:
    Geen Afbeelding
    Geen Afbeelding
  2. ...
Terug Volgende