# How do I get Makecode to play multiple music notes at a time?

**URL:** <https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461>\
**Category:** Help\
**Created:** [June 1, 2021, 9:48pm UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461 "2021-06-01T21:48:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![GoMustangs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gomustangs/32/4323_2.png) [@GoMustangs](https://forum.makecode.com/u/GoMustangs)\
**Post date:** [June 1, 2021, 9:48pm UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/1 "2021-06-01T21:48:33Z")

</div>

I’ve been trying to figure out how to get Makecode to play multiple music notes at a time. I know how to put in the play melody block, and then go into Javascript to make longer songs with multiple pitches of notes, but how do I get Makecode to play two (or three) different notes at the same time?

For example, if I write a bass line for the melody and something higher to play over it, Makecode will just play one one group of coded notes and then play the next set of notes when it’s over. How do I get them to play at the same time?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [June 1, 2021, 10:12pm UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/2 "2021-06-01T22:12:36Z")

</div>

If you import the timers extension you can play multiple notes with the separately do block:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f5337019a2ee8a1a71f17eca13f27fb1d6ffc0f5.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/4a4a0585c80496eee946c9625a54363f01105e97.png)  
Note that you can only play 5 notes at a time

---

<div class="post-metadata">

**Author:** ![GoMustangs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gomustangs/32/4323_2.png) [@GoMustangs](https://forum.makecode.com/u/GoMustangs)\
**Post date:** [June 2, 2021, 3:28pm UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/3 "2021-06-02T15:28:56Z")

</div>

Thanks! I appreciate the tips!

---

<div class="post-metadata">

**Author:** ![WoodysWorkshop](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@WoodysWorkshop](https://forum.makecode.com/u/WoodysWorkshop)\
**Post date:** [June 6, 2021, 5:09pm UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/4 "2021-06-06T17:09:12Z")

</div>

There’s also this chords extension:

> **[chords](https://shiven121s.github.io/chords/)**
>
> A MakeCode project

Copy that into the extension bar like so… then press enter… then click on the extension block that appears to install it into your game.

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

---

<div class="post-metadata">

**Author:** ![GoMustangs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gomustangs/32/4323_2.png) [@GoMustangs](https://forum.makecode.com/u/GoMustangs)\
**Post date:** [June 8, 2021, 4:02am UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/5 "2021-06-08T04:02:24Z")

</div>

Thanks! I’ll check it out!

---

<div class="post-metadata">

**Author:** ![biscuit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/biscuit/32/4404_2.png) [@biscuit](https://forum.makecode.com/u/biscuit)\
**Post date:** [June 13, 2021, 5:21am UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/6 "2021-06-13T05:21:29Z")

</div>

One way to do multiple notes at once without an extension is to have a “On game update every \_ ms” block that increments a variable each time it happens. This variable can be used in a forever loop as "if (variable) = (value) " then it can run code at that time with two of these if statements.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [June 14, 2021, 4:34pm UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/7 "2021-06-14T16:34:47Z")

</div>

(So you need 2 forever loops I’m guessing?)

---

<div class="post-metadata">

**Author:** ![biscuit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/biscuit/32/4404_2.png) [@biscuit](https://forum.makecode.com/u/biscuit)\
**Post date:** [June 18, 2021, 4:01pm UTC](https://forum.makecode.com/t/how-do-i-get-makecode-to-play-multiple-music-notes-at-a-time/8461/8 "2021-06-18T16:01:28Z")

</div>

Yes, the variable is used so that you can have them both in separate forever loops but have them go at the same time.
