# New Song format

**URL:** <https://forum.makecode.com/t/new-song-format/17763>\
**Category:** Arcade\
**Created:** [February 3, 2023, 6:12pm UTC](https://forum.makecode.com/t/new-song-format/17763 "2023-02-03T18:12:41Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChimbroDaPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chimbrodapro/32/15852_2.png) [@ChimbroDaPro](https://forum.makecode.com/u/ChimbroDaPro)\
**Post date:** [September 18, 2023, 9:35pm UTC](https://forum.makecode.com/t/new-song-format/17763/21 "2023-09-18T21:35:56Z")

</div>

Yeah, sourc code. WITH OVER 900 LINES OF CODE. Seriously, I’m learning HTML and CSS and that _still_ looks utterly impossible to understand.

---

<div class="post-metadata">

**Author:** ![shsyplum3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shsyplum3/32/11796_2.png) [@shsyplum3](https://forum.makecode.com/u/shsyplum3)\
**Post date:** [November 16, 2023, 9:32pm UTC](https://forum.makecode.com/t/new-song-format/17763/22 "2023-11-16T21:32:58Z")

</div>

I am not very familiar with music terminology, but when I used your file to convert a piece of game MIDI music and played it on makecode arcade, it seems like the high notes is missing.The mid file is below.

> <https://github.com/hattismiths/ThinkBox/tree/main/mid>
>
> //github.com/hattismiths/ThinkBox/tree/main/mid

---

<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:** [April 1, 2025, 5:34pm UTC](https://forum.makecode.com/t/new-song-format/17763/23 "2025-04-01T17:34:22Z")

</div>

@richard do you still have your instrument tweaker code where you can individually change the envelopes and LFOs? Can’t find it…

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [April 1, 2025, 5:45pm UTC](https://forum.makecode.com/t/new-song-format/17763/24 "2025-04-01T17:45:26Z")

</div>

@UnsignedArduino here you go:

> **[instrument editor](https://arcade.makecode.com/18336-29202-55655-79439)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<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, 2026, 6:11pm UTC](https://forum.makecode.com/t/new-song-format/17763/25 "2026-06-01T18:11:08Z")

</div>

Can chords overlap within a track, as long as it’s sorted by start tick? I was under the impression that they couldn’t overlap so I wrote code like this:

> <https://github.com/UnsignedArduino/MIDI-to-MakeCode-Arcade/blob/general-midi/src/midi_to_song/ __init__.py#L75-L77>

> <https://github.com/UnsignedArduino/MIDI-to-MakeCode-Arcade/blob/general-midi/src/midi_to_song/timeline/processor.py#L220-L264>

But the new tracker editor you linked shows them overlapping like this:

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

So do I not need to break out overlapping chords into other tracks anymore? (I swear I had to do this before, or maybe I’m going crazy lol) I also just tested it and they sound the same with/without overlapping chords into new tracks!?!?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 1, 2026, 6:12pm UTC](https://forum.makecode.com/t/new-song-format/17763/26 "2026-06-01T18:12:56Z")

</div>

yeah, they can overlap! they just won’t display correctly in the old song editor and they need to be sorted by start tick as you said

---

<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 4, 2026, 10:23pm UTC](https://forum.makecode.com/t/new-song-format/17763/27 "2026-06-04T22:23:55Z")

</div>

@richard do you know of any particular amp envelope combinations that don’t work or are fragile? I’ve been experimenting, and amp envelopes like these:

```auto
  amp_envelope: { attack: 100, decay: 5, sustain: 900, release: 0, amplitude: 400 }
  amp_envelope: { attack: 100, decay: 5, sustain: 0, release: 50, amplitude: 400 }
  amp_envelope: { attack: 100, decay: 5, sustain: 900, release: 50, amplitude: 400 }

```

Causes the simulator to hang on the last couple of chords of my test MIDI song, completely breaking the simulator (it won’t run again) without a full page reload or sometimes closing and opening the page again. I’ll file a bug report eventually once I’m able to repro this better (or maybe figure out I’m screwing something up), but I just wanted to know if you knew of anything related to this.

If it helps, the following instrument definition:

```auto
  - instrument: 22 # WHY IS THIS BROKEN
    _comment: Harmonica
    waveform: square_30
    amp_envelope: { attack: 100, decay: 5, sustain: 900, release: 50, amplitude: 400 }
    pitch_envelope: { attack: 0, decay: 0, sustain: 0, release: 0, amplitude: 0 }
    # amp_lfo: { frequency: 5, amplitude: 50 }
    # pitch_lfo: { frequency: 1, amplitude: 1 }
    amp_lfo: { frequency: 0, amplitude: 0 }
    pitch_lfo: { frequency: 0, amplitude: 0 }

```

results in this program:

```ts
// melodics replaced with MIDI instrument 22
music.play(music.createSong(
    hex`0078000418040100001C000D640005008403320090010000000000000000000000000000000002AA0000002E000325312000003000011930005E000329351948008C00011D60008E00022C386000B40001259000B20001209000BE0002313DB400BF000125C000E2000119C000EE00012CC0001B010120E4000601011DF0001E01012908012A01011920013701011D20014E0101252C014E01011438014F01011B50015101012550015C01012550016701011950017E0103292C315C016801012568017301011968017F01012574017F01011900505050505050505050505050505050505050505050505050505050`
), music.PlaybackMode.UntilDone);

```

which causes the freezing / stuck behavior. (you can see I initially thought it was the amp or pitch LFOs not helping)

* * *

Unrelated, they completely nerfed the GitHub Copilot student plan 💔 literally just went through half a month’s allotment _trying_ to debug this with AI. Maybe this is related to the fact they paused new paid plan sign ups??? Oh well

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 4, 2026, 10:26pm UTC](https://forum.makecode.com/t/new-song-format/17763/28 "2026-06-04T22:26:02Z")

</div>

ha! nope, beats me! i’ll debug this right now.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 4, 2026, 11:34pm UTC](https://forum.makecode.com/t/new-song-format/17763/29 "2026-06-04T23:34:58Z")

</div>

@UnsignedArduino see

> <https://github.com/microsoft/pxt/pull/11352>
>
> fixes three bugs
> 
> the first was reported on the forum here:
> 
> https://forum.m…akecode.com/t/new-song-format/17763/27
> 
> when rendering a sound for an instrument where the attack length is greater than the combined gate length and release time, you get an infinite loop. this was just an oversight in the logic
> 
> the second bug was an incongruity that could happen when the the gate length was less than the attack+decay time. previously the release would always count down from sustain; now it counts down from whatever value the envelope had at the end of the gate length. this should prevent some clipping for short gates
> 
> the third bug had to do with sounds that generated extremely short steps between time points when rendering. previously we just skipped over those points, but that changes the overall duration of the sound. now we keep the duration the same and just don't emit an extra instruction
> 
> i'll be opening a corresponding PR in common packages to fix this on the hardware side

---

<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 5, 2026, 2:25am UTC](https://forum.makecode.com/t/new-song-format/17763/30 "2026-06-05T02:25:16Z")

</div>

Thank you for such a quick reply and fix! Do bug fixes get pushed out somewhat quickly or do you guys group up a bunch of them together to release a hot fix like every couple months? (I will implement a fix in my converter anyways)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 5, 2026, 1:35pm UTC](https://forum.makecode.com/t/new-song-format/17763/31 "2026-06-05T13:35:43Z")

</div>

i’ll try and push it out in beta today, but it’ll probably be a bit before it makes it into the mainline editor. i believe we have a hotfix planned for end of june and i’ll make sure it makes it into that.

or maybe sooner, depends on if anything else hotfixable comes up

---

<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 8, 2026, 5:13pm UTC](https://forum.makecode.com/t/new-song-format/17763/32 "2026-06-08T17:13:01Z")

</div>

@richard sorry to bother you again, and this is definitely low priority, but uh…the sim crashes around the two-minute mark: (LOUDNESS WARNING WATCH OUT)

> **[rush e](https://arcade.makecode.com/95854-01065-34959-01222)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Any ideas why 🤣

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 8, 2026, 5:25pm UTC](https://forum.makecode.com/t/new-song-format/17763/33 "2026-06-08T17:25:49Z")

</div>

uh, well my guess would be that you are overwhelming the webaudio API. any idea how many notes are playing simultaneously at that moment?

---

<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 8, 2026, 7:03pm UTC](https://forum.makecode.com/t/new-song-format/17763/34 "2026-06-08T19:03:38Z")

</div>

I honestly have no idea but I’m pretty sure it played 88 note chords before just fine. The thing is it seems like just after a certain number of notes played or whatever the sim _will_ crash, like if I play a not as complex MIDI file twice (restart the sim with backspace) it doesn’t make it and crashes, or a simpler song I play like 5 times in a row without completely closing out the sim it crashes. I’ll try to repro this better later but I wanted to ask if you knew anything

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 8, 2026, 7:04pm UTC](https://forum.makecode.com/t/new-song-format/17763/35 "2026-06-08T19:04:23Z")

</div>

not off the top of my head, no. could be a memory leak of some kind. if you have a simpler repro that doesn’t take two minutes then i can look into it

---

<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 8, 2026, 7:36pm UTC](https://forum.makecode.com/t/new-song-format/17763/36 "2026-06-08T19:36:19Z")

</div>

(oh i forgot to mention that it doesn’t _crash_ in firefox but it just kind of gives up at that same time point…i don’t really expect this to be fixed anyways without a solid repro)

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [June 8, 2026, 7:36pm UTC](https://forum.makecode.com/t/new-song-format/17763/37 "2026-06-08T19:36:26Z")

</div>

Wait is this what the sequencer looks like now

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/d/fd4234148bef80a90859bf797a5db5b6121efc51.png)  
Or is this a suggestion for how it should look

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 8, 2026, 7:37pm UTC](https://forum.makecode.com/t/new-song-format/17763/38 "2026-06-08T19:37:10Z")

</div>

this is the new piano roll editor, it’s going to exist alongside the current song editor in an extension.

it’s not released yet

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 8, 2026, 10:03pm UTC](https://forum.makecode.com/t/new-song-format/17763/39 "2026-06-08T22:03:53Z")

</div>

hmmm the fact that it’s also happening in firefox is suspicious. could be an exception, but iirc firefox and chrome both actually have the same limit on web audio nodes. my guess is just that we’re leaving web audio nodes dangling somewhere.

---

<div class="post-metadata">

**Author:** ![luxregina](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luxregina/32/32544_2.png) [@luxregina](https://forum.makecode.com/u/luxregina)\
**Post date:** [June 9, 2026, 5:01pm UTC](https://forum.makecode.com/t/new-song-format/17763/40 "2026-06-09T17:01:30Z")

</div>

@richard Hello, I’m new here, but I’ve been very interested by this topic! I developped with many different IDE, mainly Unity now, and I love the simplicity of MakeCode (I use it to teach my students an Intro to Game Design! - I can provide example of their work if need be)

All the tools are very convenient BUT the music editor: I’m super excited to see a more classical piano roll!  
I don’t know if it’s in the card, but I’m old-school: I’ve made music before the DAWs using trackers like FastTracker II (mostly) or Impulse Tracker or ProTracker… Are there any extensions that would bridge Tracker notation to makeCode? I doubt it’s a feature that would be often requested, I assume the audience of MakeCode is way younger to really know trackers, but it doesn’t hurt to ask 🙂

[Previous page](https://forum.makecode.com/t/new-song-format/17763.md?page=1)

[Next page](https://forum.makecode.com/t/new-song-format/17763.md?page=3)
