Wanted to see if codes could speak, so I build up with this small code to combine the sound playing and a lexical analyser to create exactly that.
This is most fun I had with a 20 minutes code, so I decided to share it. Try using different values for different sounds.
It requires ply which is a python implementation of lex and yacc. Install that from pip
pip install ply
Then you can run it directly.