Skip to content
Turbo Scratch
8-Bit Music Maker + WAV Export

8-Bit Music Maker + WAV Export

by gilbert_given_189

  • 👁 43
  • ❤️ 0
  • ⭐ 0
  • 🔄 0
  • Created: Dec 24, 2018
  • Last modified: Mar 15, 2025
  • Shared: Dec 25, 2018

Description

The only thing I added is just the WAV export. Update Log: 15 Mar 2025: The tempo bug seems to be fixed (and all I did is replace a block...) 25 Oct 2024: Rewritten the instructions. 22 Dec 2023 (yes, I've revisited this project): The generation loop is now run without screen refresh, which sped up the generation by A LOT. Though I understand why I didn't do it in Scratch 2 since that would essentially grind Flash Player to a halt. I also changed the code for generating noise to not depend on the sampling rate. The triangle waves are also quantized to make them sound like the NES. 31 Dec 2018: Now the sound generation can take more than 15 minutes... :D I forget to put a broadcast block in a repeat loop on the play head.. :P Midnight New Year 2019 Just random tweaks. 2 Jan 2019: - Fixed the ETA - Noise will be a little bit quieter 25-26 Jan 2019 - Improved WAV export (btw it is now officially released! yay) 9 Feb 2019 - Adding a way to export longer song by exporting every time the list maxed out. 23 Apr 2019 - Adding a bit of mute on the triangle note 30 Nov 2019 - Fixes timing on playback 1 Dec 2019 - Added Raw Import (.wav without headers) 16 Mar 2020 - WIP real .wav export 17 Mar 2020 - Real .wav export (finally)

Instructions

Warning! Because this is based of the old version of this project, many bug-fixes and features will not be present here. Update Dec 5 2017: A new, fourth sample song has been added! New: - Slight change to the import feature. Previously it would refuse to load the song if the code appeared corrupt, but now you can force it to load anyway. Hopefully this'll make the import/export process less headache-inducing. - Pressing the green flag no longer clears the song data, due to the risk of accidentally deleting your work. Instead, press the 9 key on your keyboard to clear everything. - The volume is no longer painfully loud! - The slight pause that occured when the playhead moves to another page should now be gone entirely, or at least reduced. ======================= Featured! Thank you all so much! (nah it didn't) To celebrate, here are answers to some questions you may have: Q: How do I do <x>? A: Click the "help" button. It will probably be explained there. Q: Can you erase notes? A: Yes, use the eraser tool (the blue icon in the bottom-left corner). Q: Can I export as .WAV or .MP3? A: This remix is designed to do just that, the results were also decent. However, if you want some very fine details, like audio compression, or if you don't have the time to render it, you should better record it from the computer. Q: Can I use songs I've made in my own project? A: Yes! Absolutely! It would be cool if you linked back to this project, but you don't have to. Q: Can I use one of the example songs in my own project? A: Yes! Although, if that's the case I'd really like it if you gave credit. Q: Did you write the example songs yourself? A: Yes. I tried to keep them simple, like how they would be on an actual NES. Q: Sample song 2 sounds like Ghostbusters. A: You're right, it kinda does. I should probably change that... hmm..... nahh.............. Q: I just made an awesome song, how do I share it? A: Click the "Get Code" button and follow the directions. This will generate a .txt file. Unfortunately, these are too long to post in the comments, so put them on a website that allows you to upload text, such as textuploader.com. Then, post the link in the comments. (If your code is too long for that website, you may need to find something else.) Q: How do I import a code I found online? A: Copy the code, paste it into a .txt file, save it. Then click the "Import Code" button and follow the instructions. Just be careful: if you copy too much or don't copy the entire thing, it won't work. Q: The sound keeps clicking! A: Try changing your browser. I found out that Edge does a great job. Q: Can you cover Megalovania? A: Legend has it, if you type "sans" after you press the "sample songs" button, a secret song will load....... About WAV export: (Note from my future self: Wow, my English was so bad.) Q: The WAV that's generated sounds off! A: The notes generated by the WAV generator isn't exactly equal to the notes you hear on the project. The difference should be minimal for the ears though. That, or you forgot the sampling rate you specified before. Q: Why does it takes so long to export? (note that this question was made before the trivial optimization) A: For each second of audio, the generator needs to create tens of thousands of samples. That's a lot of numbers to calculate for Scratch. Q: I made a .wav file from the export, but it didn't play! A: Did you forgot to convert the hexadecimal values? Try searching for a converter online or something. If you're nerdy enough, you could also use vim's xxd with "xxd -r". If you're using value mode, something like Audacity could help. Q: How long does it takes to export Megalovania? (yes, this project has that) A: Back then, it took 5 hours with 22050 Hz sample rate on a generic 4GB laptop. Now it only took around 10 minutes.

Project Details

Visibility
Visible
Comments
Enabled
Remixed From
Project #87829696
Original Project
Project #87829696