Reuse Musical Patterns with Code!
Why do more work when you can do less?
Check out how you can reuse musical patterns to add interest and organization to your music while saving time!
- What types of patterns do you hear in the music you like to listen to?
- Can you hear patterns that repeat throughout music you like?
- How can we repeat patterns with code?
- Choose whether you would like to work with Scratch or Sonic Pi
- Follow the directions for using Scratch or Sonic Pi to reuse musical patterns below
Reuse Musical Patterns with Scratch
- Take a look at the following project in Scratch
- Look at the blocks for each part of the song. Each part is called a phrase.
- You can drag one block to play the entire musical phrase rather than having to type it many times
- Read the comments in the code to see how the code works
- You can also watch this video that explains how the code works:
- Experiment with the blocks
- Create something different
Not sure what a block does?
- When you are looking at the Scratch project, click on the question mark on the top of the screen
- Then click on a block for an explanation of what the block does
Reuse Musical Patterns with Sonic Pi
- Try tutorial 5.5 in Sonic Pi to learn how to use functions to reuse blocks of code to make music
- After trying the tutorial, experiment with creating your own functions and “call” them to create a melody, harmony, or beat.
- If you’d like an example to customize, use one of the examples in the “Help” section of Sonic Pi
- OR follow these steps to code Hot Cross Buns
Learn more about reusing musical patterns with functions.
Share What You Learned
Post a link to a shared Scratch project you created or sample code from Sonic Pi and explain how you used functions to reuse blocks of code to make music or sound.