# Sound effect demo (no extensions)

**URL:** https://forum.makecode.com/t/sound-effect-demo-no-extensions/5833
**Category:** Show & Tell
**Tags:** music
**Created:** [January 28, 2021, 2:37am UTC](https://forum.makecode.com/t/sound-effect-demo-no-extensions/5833 "2021-01-28T02:37:11Z")
**Posts on this page:** 1
**Showing post:** 6

<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: [February 3, 2021, 1:31am UTC](https://forum.makecode.com/t/sound-effect-demo-no-extensions/5833/6 "2021-02-03T01:31:59Z")

</div>

> [@2ndClemens](#):
>
> Is it possible to play a loop like the drum&bass example during a game like your boulders and gems game or is that too complex for the hardware arcade is intended for?

Here’s a quick test - it works in the emulator, but I haven’t tried it on hardware yet. I basically just pasted [simple loops 4](https://makecode.com/_1L9YPY8mgWzr) onto the end of the file, and combined the snare+hi-hat into a single percussion track to avoid sound effect collisions:

> **[Boulders and Gems music hack](https://arcade.makecode.com/84300-33888-67945-01038)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I think you’d need something longer and more interesting than a single bar of music in a loop, otherwise it’s likely to drive the poor players insane :-/ The 12-bar pattern is arguably still too short, and it doesn’t help that I’m kind of tone deaf and am trying to compose songs based on half-understood music theory…

Once you have a longer piece, you’d either end up with a gigantic melody string that would be a pain to edit manually, or you’d need to use multiple distinct parts that you’d then need to synchronize. While the single-string example is easy to use with a single `play()` command, it’s a bit inefficient since it repeatedly switches back and forth between waveforms and envelopes in a way that has a lot of redundant pieces.

Separately, you need to be careful about the overall parallel sound channels being used. You’ll want to keep some available for sound effects, and I think there are also some collision issues when starting new sounds while previous ones are still playing. A new bar of melody might end up cutting off an ongoing sound effect instead of replacing a sustain from the previous bar’s last note.

I think it would be an interesting experiment to see what’s possible. Anyone up for tackling something like [Ballblazer’s algorithmic theme music](https://en.wikipedia.org/wiki/Ballblazer#Soundtrack)?

---

_[View the full topic](https://forum.makecode.com/t/sound-effect-demo-no-extensions/5833)._
