New Song format

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

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.

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

1 Like

@UnsignedArduino here you go:

4 Likes

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:

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

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!?!?

1 Like

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

1 Like

@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:

  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:

  - 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:

// 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 :broken_heart: 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

1 Like

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

2 Likes

@UnsignedArduino see

2 Likes

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)

1 Like

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

2 Likes

@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)

Any ideas why :rofl:

3 Likes

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

1 Like

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

1 Like

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

2 Likes

(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)

1 Like

Wait is this what the sequencer looks like now


Or is this a suggestion for how it should look

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

3 Likes

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.

2 Likes

@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 :slight_smile:

1 Like