To use this project, make sure Scratch has access to a working microphone that is on. Then run the project and play some music out loud. You can click the screen for additional settings. This algorithm only has the volume from the mic to work with, so it uses a bunch of randomizers as well. It's supposed to look kind of convincing, but if you pay close attention, you will see the randomization. In the future, I might make a version that works off of pre-recorded frequencies to make it more realistic.
I would like to thank @flamingenius for inspiration. Be sure to give me credit if you remix this project or save any scripts to your backpack/device storage.