Unit 3 Loops, Arrays, Media
How can sounds, images, and fonts can be combined and manipulated with code?

Mini-Project: Musical Keyboard


Suggested Duration

45 minutes

Student Outcomes

Abstraction:

  • Explain characteristics or patterns that informed a function or an interface I created.

Prototype:

  • Experiment with the commands of a programming language.
  • Explain why I chose specific commands to communicate my instructions.

Prompt

Requirements:

Create a musical keyboard using p5! You can stick to classic piano or change it up to any genre you want, which beats can you make?:

  1. Create a piano in your canvas
  2. Use at least different 5 sound files
  3. Keys should play a sound
  4. When keys are pressed corresponding rectangles change color
  5. Add 1 silly sound

Writing Prompt:

  1. Which is your favorite genre of music? Why?
  2. If you can code any music app what would it do? Explain.

Sample Output

Extension

Clicking Keys

  • Use the mousePressed() function or mouseIsPressed to make your piano keys clickable