# SFX in MakeCode Arcade?

**URL:** https://forum.makecode.com/t/sfx-in-makecode-arcade/76
**Category:** Arcade
**Created:** [March 6, 2019, 8:18am UTC](https://forum.makecode.com/t/sfx-in-makecode-arcade/76 "2019-03-06T08:18:19Z")
**Posts on this page:** 1
**Showing post:** 16

<div class="post-metadata">

### Author: ![kwx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kwx/32/1545_2.png) [@kwx](https://forum.makecode.com/u/kwx)
#### Post date: [October 31, 2020, 12:50am UTC](https://forum.makecode.com/t/sfx-in-makecode-arcade/76/16 "2020-10-31T00:50:06Z")

</div>

> [@AlexK](#):
>
> It’ll make building melodies a lot easier for those of us who know musical notation. Plus, being able to store melodies in variables will give advanced coders a lot more flexibility.

FYI, you can do that already, MakeCode has its own [string-based notation](https://arcade.makecode.com/developer/sound#melodies). peli@'s extension converts RTTL format into the MakeCode syntax which makes it possible to use pre-existing melodies in that format, but if you’re making melodies from scratch I think the existing MakeCode format may be a bit more powerful since it’s more closely tied to the way the underlying sound engine works.

Here’s an example from a test I was working on. FWIW, it doesn’t currently work great since the different instruments quickly get out of sync, it would need a different approach and not just simple repeated loops.

```auto
const hihat = new music.Melody("@0,50,0,0 ~5 c8-240 c8 c c c c c @0,250,0,0 c")
const snare = new music.Melody("@10,75,0,0 ~5 r-240 r g5 r r r g r")
const bass = new music.Melody("@10,120,80,0 ~15 c2-120 d# f f# g f# f d#")
const guitar = new music.Melody("@100,100,160,0 ~15 c4-240 g r r c5 g r r c5 b4 g4 f# e d#-120 e-240")

```

> **[simple loops](https://arcade.makecode.com/95583-89423-34314-49963)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

_[View the full topic](https://forum.makecode.com/t/sfx-in-makecode-arcade/76)._
