midi music import- SMG
Game Introduction
This plays a song from Super Mario Galaxy using the "play note" block. *Works when downloaded!* *press green flag to start* I made this to test importing a midi file into scratch. Let me know how it works for you, and if it does work online for you. Supports most basic midi features: *multiple notes at once *variable instrument per note. (user changeable too.) *variable volume per note. *tempo change (note warp not possible) Problems: Slow/broken online. (I think limiting the number of array hits would help but would make the code harder to read.) Does not play drum sets yet. The file is imported from: 27500_Comet-Observatory.mid The music is by Nintendo. the midi was created by "usatraveler" www.hamienet.com/midi27500_Comet">http://www.hamienet.com/midi27500_Comet … atory.html How it works: A sprite can play only one midi note at a time. So, this works by having a bunch of "player" sprites. The "player feeder" assigns a note to play to the 1st player listed on the "available-players" list, then removes it from that list. (It keeps feeding till the "available players" is empty, then it waits till it's not.) Each "player" sets its volume and instrument that was assigned it and waits till the timer is greater than its time to play then plays. It then re-ads itself to the "available-players" list and waits for another note to be assigned to it. The midi file was converted to the Cmedia file format (using Rose Garden (a Linux only program- there is likely Windows programs that can do this too), which is a text document that lists all the notes and when they play... I used a spreadsheet to convert the notes to note number and sort them by time. (They're grouped by instrument originally.) Feel free to do whatever you like with this.
How To Play
Author
AddZero
Category
Game Information
Game Popularity
3.6k views
Collection Count
86 favorites





