# RTTTL tunes extension

**URL:** <https://forum.makecode.com/t/rtttl-tunes-extension/4193>\
**Category:** Arcade\
**Tags:** extension\
**Created:** [October 30, 2020, 11:52pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193 "2020-10-30T23:52:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [October 30, 2020, 11:52pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/1 "2020-10-30T23:52:05Z")

</div>

Ring Tone Transfer Language… is a popular format for tunes. With this library, you can play existing RTTL tunes in Arcade.

- RTTL [https://en.wikipedia.org/wiki/Ring\_Tone\_Transfer\_Language](https://en.wikipedia.org/wiki/Ring_Tone_Transfer_Language)

> **[pelikhan/pxt-rtttl](https://github.com/pelikhan/pxt-rtttl)**
>
> Convert RTTL tunes to MakeCode melodies. Contribute to pelikhan/pxt-rtttl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 31, 2020, 8:54pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/2 "2020-10-31T20:54:29Z")

</div>

This is fantastic! Thank you very much for sharing this. I hope they make this part of the main code.  
Using a timer to separately play a melody during a game just got easier. I was so excited by this extension that I just had to put it in my game:

> **[Frogging Fun 0.9.5](https://arcade.makecode.com/79860-17604-90029-90900)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [November 1, 2020, 11:48am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/3 "2020-11-01T11:48:38Z")

</div>

It took me a few tries to get the correct amount of Ts in that name.

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [November 1, 2020, 11:50am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/4 "2020-11-01T11:50:08Z")

</div>

For people interrested by finding tunes, this forum post has a bunch [https://forum.arduino.cc/index.php?topic=510297.0](https://forum.arduino.cc/index.php?topic=510297.0)

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [November 1, 2020, 9:21pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/5 "2020-11-01T21:21:24Z")

</div>

0.6 is also microbit compatible.

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [November 2, 2020, 2:22am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/6 "2020-11-02T02:22:26Z")

</div>

> [@peli](#):
>
> pelikhan/arcade-rttl

How does this work? I cannot add the extension to my game.

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [November 2, 2020, 6:07am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/7 "2020-11-02T06:07:13Z")

</div>

Add an extension as usual. In the search bar, use the following URL: [https://github.com/pelikhan/pxt-rtttl.git](https://github.com/pelikhan/pxt-rtttl.git)

---

<div class="post-metadata">

**Author:** ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)\
**Post date:** [November 2, 2020, 1:48pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/8 "2020-11-02T13:48:33Z")

</div>

I don’t know why it didn’t work before, but thanks! What do I do now? Is it a ts extension?

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [November 2, 2020, 2:09pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/9 "2020-11-02T14:09:42Z")

</div>

It adds one block to the **Music** category in the toolbox:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a4c33b40a55a2adc979960e39cc9dc50f34c25ed.png)

Use the links mentioned earlier in this thread to find some RTTTL tunes, or craft your own!

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [November 20, 2020, 4:52pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/10 "2020-11-20T16:52:44Z")

</div>

I have noticed that some RTTTL tunes are not playing as expected.

Using this site:

> **[Play RTTTL Online](https://adamonsoon.github.io/rtttl-play/)**

and the ‘Leisure suit Larry’ theme:  
LeisureSuit:d=16,o=6,b=56:f.5,f#.5,g.5,g#5,32a#5,f5,g#.5,a#.5,32f5,g#5,32a#5,g#5,8c#.,a#5,32c#,a5,a#.5,c#.,32a5,a#5,32c#,d#,8e,c#.,f.,f.,f.,f.,f,32e,d#,8d,a#.5,e,32f,e,32f,c#,d#.,c#

sounds a lot different using the extension. Could it be that I don’t have the correct BPM?

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [November 20, 2020, 11:19pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/11 "2020-11-20T23:19:00Z")

</div>

Oh man … that tune! Fond memories.

It doesn’t seem to like the 32nd notes. I replaced them with 16th notes, and it was … happier? At least the melody seemed much more familiar.

Anyway, try this one. I shifted the time signature to avoid the 32nd notes. The half-notes still seem to play a little long, but other than that, it sounds accurate. Play it at half the suggested speed (i.e. play it at 112 bpm instead of 224).

LeisureSuit:d=4,o=6,b=224:f.5,f#.5,g.5,g#5,8a#5,f5,g#.5,a#.5,8f5,g#5,8a#5,g#5,2c#.,a#5,8c#,a5,a#.5,c#.,8a5,a#5,8c#,d#,2e,c#.,f.,f.,f.,f.,f,8e,d#,2d,a#.5,e,8f,e,8f,c#,d#.,c#

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [November 21, 2020, 1:31am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/12 "2020-11-21T01:31:20Z")

</div>

Hi, @peli !

I sent a PR your way. Feel free to gimme a holler via GitHub if you have any questions.

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [November 21, 2020, 8:35am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/13 "2020-11-21T08:35:08Z")

</div>

🙏 I’ll bump later today. For the trim issue, trim before splitting

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [November 21, 2020, 8:37am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/14 "2020-11-21T08:37:16Z")

</div>

We’ll have to figure a way to share those melodies somewhere.

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [November 22, 2020, 1:23am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/15 "2020-11-22T01:23:36Z")

</div>

> [@peli](#):
>
> For the trim issue, trim before splitting

I tried a handful of variations and couldn’t get it to work. I’m not comfortable enough with lambda functions in JS to make the compiler happy. I eventually threw my hands in the air and left it for you. 😄

Thanks for this extension, @peli ! I’m more comfortable with traditional music notation, so I feel right at home with RTTL notation.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [November 22, 2020, 11:49pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/16 "2020-11-22T23:49:40Z")

</div>

Since you changed the notation I had to find out how the RTTTL format works. 🤷‍♂️ Wikipedia explains the notation quite well. I see that you have changed the default duration from ‘d=16’ to ‘d=4’, which means also having to divide the notes that do specify a duration by 4.

Thank you Alex for helping me with this, it does sound much better now.

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [November 23, 2020, 8:49am UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/17 "2020-11-23T08:49:35Z")

</div>

Alex fixes + white space issue bundled in v0.0.9!

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [November 23, 2020, 9:25pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/18 "2020-11-23T21:25:01Z")

</div>

I will update the library and try some different tunes.

---

<div class="post-metadata">

**Author:** ![brandodon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brandodon/32/3625_2.png) [@brandodon](https://forum.makecode.com/u/brandodon)\
**Post date:** [April 22, 2021, 3:27pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/19 "2021-04-22T15:27:12Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/68fc76878729e092891d7186eacd1679cf2868fe.png)

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [April 23, 2021, 6:05pm UTC](https://forum.makecode.com/t/rtttl-tunes-extension/4193/20 "2021-04-23T18:05:09Z")

</div>

Is github blocked on your domain?

[Next page](https://forum.makecode.com/t/rtttl-tunes-extension/4193.md?page=2)
