Tynker Toolbox: The Sound Blocks

Tynker Toolbox: The Sound Blocks

Tynker Toolbox: The Sound Blocks

There’s no denying a connection between math, computers, and music. Studying these fields requires pattern-seeking, problem solving, logic — and for most of us — a degree of patience, practice, and grit.

Let’s explore the recent upgrades and improvements to Tynker’s Music and Sound system and find out how you can combine coding with music to make your own songs: 

Improved Note Playing and Effects — Choose from over 100 new instruments with our slick new interface keys. Then set the tempo in beats-per-minute with the all-new set tempo block. Plus, you can add pedal effects like Echo, Distortion, and Reverb. 

Upload Songs and Effects — Add your favorite songs by loading any MIDI or MP3 to Tynker for your project. Rock on!  

The Synth Blocks — Create a totally custom instrument or sound effect using code, like a brass band, a retro chiptune, or a dubstep crunch. 

With these new features and tools, you can create dynamic musical performances, animated music videos, and so much more. 

BTW. 🎧 If you can, make sure you’re wearing headphones or earbuds for this tutorial. We’re gonna make some noise! 🎸

Choose an Instrument, Tempo, and Volume

You can set starting values like what instrument to play, the tempo, and more. Give this code to any actor you like: 

This code controls how loud, how fast, and what instrument your music and notes play. 

Improved Note Picker

Did you see the new note picker? When you change what note to play, you’ll see a piano keyboard appear. Middle C is the number 60. 

Click the  arrows ◀  ▶ to reach higher or lower octaves. Choose a note and it will play. 

Play a Happy Song

Next, try using a few more play note blocks. Write these two scripts:

Notice how one uses the play note block, while the other uses the play note until done block. What do you think the difference between them is? 

Try writing these programs yourself and hear the difference. Or you can press Play below. 

The play note until done blocks will play your notes in sequence, while play note blocks play all your notes at once, without waiting! You’ll need to experiment with these blocks to find out what’s right for your project. 

Bang On The Drum

Drum and percussion instruments can do double-duty as sound effects or beat-keeping for your project. Just like the play note blocks, there are two variants that will let you create different rhythms. 

Pedal Effects: Reverb, Echo, and Distortion 

You can add three common types of sound effects using the set effect block: Echo, Reverb, and Distortion. 

These effects only affect the play note and play drum blocks. Here’s an example. 

Try them out yourself. Here’s what each effect sounds like with a series of 3 piano notes:

Add Songs To Projects

It’s kind of tedious to specify every single note to play, isn’t it? Good news, you can also play music and sound effects too.

First, write a short script like this. Then choose Add Sound.

You’ll see a Media Library of music you can use in your project.

To use your own custom song from your computer, choose Upload and then Upload an Asset. Tynker supports MIDI, MP3, and even WAV files.

MIDI is a format that describes a sequence of musical notes. Public domain music, like classical music and folk melodies, are widely available for free in this format. We’ve added a few songs, which you can find in the Media Library—but you can also upload your own MIDI files to your project. 

Need some songs? You can find thousands of public domain and freely available songs and effects at Free Music Archive, FreeSound, and the Library of Congress.

All By Yourself

Want some ideas for your own Music projects? Check out +Create Project > Music to see more Music starter projects. 

Find the category that looks like this:

There’s way more in the Sound Blocks than we’ve covered here. Try exploring the other sound  blocks on your own. And stay tuned for a Synth Blocks tutorial, coming up next. 

Looking for more FREE coding activities? Check out our Tynker Toolbox articles!

  • Tynker Workshop Basics — Learn about coordinates and start coding with Tynker.
  • The Animation Tool — Learn about frame-based animation and other animation tips.
  • The Character Creator — Take control of custom rigs using the Animation blocks.
  • The Physics Blocks — Create games or simulations with gravity, collisions, and more. Think: Angry Birds and Marble Madness.
  • The Pen Blocks — Make your actors draw as they move. Create patterns, draw geometric shapes, and more.
  • Code Block Tricks — Get top-secret ninja tips for writing code fast in Tynker Workshop. 
  • The Debugger — Learn about Tynker’s data debugger and get bug-fixing tips.

Tynker enables children to learn computer programming in a fun and imaginative way. More than 60 million kids worldwide have started learning to code using Tynker.