Quick and dirty song parser to play obligatory Super Mario Bros. theme song.#1
Conversation
|
@lberezy It seems like it would be easy to add a quick and dirty if statement that checks for a token such as |
|
Is this a standard file format for the audio tune? |
|
@rocketinventor: almost certainly that is possible, but read on because... Take a look at the example from the tinyMML parser, looks straight forward to implement. |
|
@lberezy @fulldecent It seems excessive to add an MML parser or a MIDI player to the main program, at least at this point. Having a separate program that parses MML or MIDI and spits out a list of frequencies in the format of the smb.song file might be a fun idea and could be implemented in any language without introducing bugs into the main program or making it bloated. |
|
I completely agree. The tinyMML parser is the smallest fully fledged song And yes, I'll get around to adding in a loop. On Wed, 2 Mar 2016, 9:45 AM Elliot Gerchak notifications@github.com wrote:
|
|
It now repeats on the ":end" token in the song. |
|
Awesome! I hope it gets merged! |
Conflicts: main.c
Conflicts: main.c
|
I kind of have a json descriptor idea here that I made for a game engine based on that old music tracker software that I can't recall the name right now. It's basically an array of channels, that are an array of beats each that's a array that includes first the note, than the instrument, and then the volume. I ditched effects and have a synthesizer one folder up. It's missing a bpm field right now. |
I copied the file from pull request #1.
Based on pull request #1... The list of frequencies to be played has been moved from the JS to a textbox in the HTML. Editing the content of the box will change what gets played. The format also is more human human readable and consistent with the songfile from #1. If you copy and paste the smb.song file, it should work.
|
Blocker #28 |
|
@lberezy Thank you for your contributions! I'd love to see it added to the main branch but, that is currently not possible (because of the conflicts). Do you have any plans on updating the source for the new parser? |
|
Here is conversion to .song format: |
|
Sorry for the glacial pace here. And... it's merged! Thank you. Also updated to standardized tune format for #28. |
This works on my MacBook Air (Mid 2013).
I wrote this small song parser very quickly to get the theme song to Super Mario Bros. playing.
The song does not repeat as the file pointer is not wound back to the start. Unexpected data in the file will most definitely break the parser.