Musical Patterns

The simplest code we did in Scratch makes a playable Xylophone. It has each Xylophone key as a different Sprite. Each sprite has only one line of code, when this Sprite clicked, play note ___. Each sprite just has a different note and different look (size and color).  

 

Here’s our Keyboard using clones. You can play notes by touching keys, in one of several musical instruments.

Also see our interval and chord player in Scratch.

 

The above is the simplest code, for a beginner. It is simple because there so little code, really just one command for each sprite. 

But you also can make clones of sprites, one clone for each note. This has many advantages. Here’s our Keyboard using clones. You can play notes by touching keys, in one of several musical instruments.

Also see our interval and chord player in Scratch.

We also created a playable keyboard using clones. You can change the instrument.

 

Also see our interval and chord player in Scratch. Below is a snapshot of the screen.

 

Here is the code for the interval and chord player. The simple major and minor cords need very little code.  The great bulk of the code is for the key signatures. 

 

Musical patterns include polyphony and polyrhythm. The opening of Jupiter from Holst’s the Planets is an elegant polyrhythm of 3 against 2.

 

Here’s our code for the lead instrument in the introduction.

Below is code for the second instrument.