A new way to create music in Makecode

It seems that recently there was an update to Makecode Arcade, allowing for sounds to be made using different waveforms. I’m certain this will be excellent for creating custom sound effects, but I wanted to see how far I could push this. And so I decided to use the new blocks to create an entire song! I did have a little trouble trying to figure out how to get more than one “channel” of notes playing, but by using Makecode’s timer extension and the “separately do” block, I was able to get it working. This was by no means an easy feat, as the song itself consists of 207 lines of code! And there was a lot of math involved trying to figure out the correct note lengths.

And while UnsignedArduino has made a MIDI extension for a, much easier way of implementing music, I still wanted to see if it was possible to create songs this way. Plus, because of the different waveforms, you can technically have different instruments for your music. I’m sure this is just the surface of what you can do with the new blocks, but I’m proud of what I’ve got done, so please, take a listen!

The music used is the Kremlantis theme from Donkey Kong Land, composed by the excellent David Wise.

8 Likes

With the sinewaves and PRAAT audio software, i’ve been able to make (low quality) human speech- I might be working on a text to speech game :shushing_face:

7 Likes

Nice work, @Spaghetti_Coder! Have you checked out @kwx “Simple loops” method?
https://forum.makecode.com/t/song-gallery/5471/30

Really cool, @randomuser!!! Do you have a small demo for us?

I’ve been looking some time now for a way to bring back to life something like the old SAM speak synthesizer from the C64 in MCA!!!
https://forum.makecode.com/t/arcademidi-extension/15079/34

3 Likes

Here, a test i did a few months back. It was supposed to be the roblox ‘Hello!’ but as it was my first time in the program, it turned into this monster! In my current demo I’m making the phonemes of english so you could build words, with 3 sine wave tracks instead of the just 1 you hear in this clip. There will also be volume variation- this is important because as you hear in the demo the hello has an odd high note at the end that is actually supposed to be quieter than the rest. Once I’m done with Unique-A-Thon, this will be my top priority again!

4 Likes

(Thats a great idea, using the timer extension. In my usage of sinewaves they always end with an odd few-milisecond beep, so the timers should eliminate that!)

2 Likes