Tynker Toolbox: The Sound Blocks

Last Updated: May 4, 2020 12:10 pm
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: 

A script that sets volume, tempo, and instrument type

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. 

The note selector interface. Middle C is note 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:

This script plays a chord
This script plays an arpeggio

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. 

A looping drumbeat program

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. 

Adding distortion effect to a script

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.

Animation showing how to add a 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:

Music category

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.
  • Text Tricks — Work with speech bubbles and more. Tell your own stories, put on a play, or make a computer write poetry!
  • The Synth Blocks — Create your own sound effects and instruments! You can create crunchy dubstep drops, glitchy chiptunes, or instruments from any style of music you can imagine! 
  • Code Block Tricks — Get top-secret ninja tips for writing code fast in Tynker Workshop. 
  • The Pen Blocks — Make your actors draw as they move. Create patterns, draw geometric shapes, and more.
  • The Physics Blocks — Create games or simulations with gravity, collisions, and more. Think: Angry Birds and Marble Madness.
  • The Augmented Reality (AR) Blocks — Want to use video or photos in your programs? Try the AR Blocks, which let you code your own selfie! 
  • The Artificial Intelligence (AI) Blocks — Take your AR projects to the next level with face-, hand-, and pose-tracking. Explore what makes AI special. 
  • The Debugger — Learn about Tynker’s data debugger and get bug-fixing tips.
  • The Tutorial Builder — Did you ever make a really cool Tynker Block project and wish you could teach the whole world exactly how you did it? Now you can!
  • The Python Editor — Looking for a challenge? Ready for your next step on your coding journey? Learn Python with Tynker too, and take the plunge into text-based coding. 

About Lomit Patel

Lomit Patel is the Chief Growth Officer of Tynker, with 20 years of experience helping startups grow into successful businesses. Lomit has previously played a critical role in scaling growth at startups, including Roku (IPO), TrustedID (acquired by Equifax), Texture (acquired. by Apple), and IMVU (#2 top-grossing gaming app). Lomit is a public speaker, author, and advisor, with numerous accolades and awards throughout his career, including being recognized as a Mobile Hero by Liftoff. Lomit's book Lean AI is part of Eric Ries' best-selling "The Lean Startup" series.