RTTTL tunes extension

Testing… https://github.com/pelikhan/pxt-rtttl

Does anyone know how to turn a song into rtttl?

There are various MIDI to RTTTL converters online…a quick Google search turns up this. Also many music scoring programs will export to MIDI as well…

1 Like

My google search gives a bunch of unrelated junk :unamused:

2 Likes

Im confused on how I Increase the bpm… Please help…!!

Take a look at this quick snippet of Beethoven’s Ode to Joy:

There are two tempo indicators. You can ignore the tempo indicator (b=140) in the RTTTL. To change the tempo at which the music is played, change the value at the end of the play melody block. To play the RTTTL at its intended speed, just double the tempo indicated in the RTTTL. (That’s why I’m playing this one at 280 beats per minute.)

Here’s the RTTTL text, so that you can copy it and paste it without retyping it.

ode:d=4,o=5,b=140:b,b,b,c6,d6,d6,c6,b,a,g,g,a,b,b.,8a,2a

Just holler if you have any other questions.

Thank you!

1 Like

I know this is off topic but I don’t know why I am getting an error in this project. I am making this for a school project btw.

It looks like your overlap container calls Bad_projectile (and other projectiles) by name, but they may not exist yet (depending on whether the left or up buttons have been pressed.)

To get rid of this issue, use the red ‘sprite’ and ‘otherSprite’ variables from inside the overlap container to refer to the two items that collide.

Hope that helps!

2 Likes

That worked, (thanks btw), but now when the projectile is shot from ‘PLayer_1’, the ‘PLayer_1’ is losing health. Same for the other sprite
Updated code: https://arcade.makecode.com/#editor

My song is like this: # Super Mario - Main Theme:d=4,o=5,b=125:a,8f.,16c,16d,16f,16p,f,16d,16c,16p,16f,16p,16f,16p,8c6,8a.,g,16c,a,8f.,16c,16d,16f,16p,f,16d,16c,16p,16f,16p,16a#,16a,16g,2f,16p,8a.,8f.,8c,8a.,f,16g#,16f,16c,16p,8g#.,2g,8a.,8f.,8c,8a.,f,16g#,16f,8c,2c6,16p,8a.,8f.,8c,8a.,f,16g#,16f,16c,16p,8g#.,2g,8a.,8f.,8c,8a.,f,16g#,16f,8c,2c6,a,8f.,16c,16d,16f,16p,f,16d,16c,16p,16f,16p,16f,16p,8c6,8a.,g,16c,a,8f.,16c,16d,16f,16p,f,16d,16c,16p,16f,16p,16a#,16a,16g,2f
But the pauses wont work
Can you help me?

Welcome, @zacharytam0411 !

Good catch! The RTTTL spec uses a p to indicate a rest. MakeCode uses an r instead.

For now, if you change your rest notes to use r, your RTTTL melody will work with this extension. I’ll also make a pull request to correct the bug and allow both notations to indicate a rest.

So I’m trying to add songs, but I don’t know how, plz help.

Hi @TZG ! Do you mean in general, or RTTTL in specific?

If you’re asking about RTTTL specifically, then jump back a few posts. I show you how to add a snippet of Ode to Joy in Blocks. It’s post #26 from November 2021. RTTTL tunes extension - #26 by AlexK You’ll need to add the extension first to you project; that’s in post #7 from November 2020. RTTTL tunes extension - #7 by AlexK

If you’re asking about melodies in general, then take a look at the melody editor. It’s a good place to start if you’re not familiar with music notation. Add a play melody block to your workspace, and then click on the melody block (the white block with notes) to open the melody editor. See screenshot below.

If you have any questions, then feel free to ask. RTTTL questions can go here; you should ask questions about the melody editor in a new thread.

Thanks. I hope it helps!

How do i add things like music samples? I have… admittedly way too many samples. But I want to make something like one of the Past mixes of Sonic CD music with my samples in makecode, to enhance the Zune project with samples. Any suggestions?

1 Like