Experiments in digital soundwave/WAV file generation.
Warning: I was learning as I was writing, so the code is poorly formatted, cryptic, undocumented, with many notes-to-self.
There are samples of generated wave files in the samples/ directory. Turn your volume down for any with the word "danger" in their names.
Some of my favorites:
- linksawakening.wav, for being one of my favorites pieces of VGM
- midi_stereo_dkccoral.wav, for being the most interesting (volume ramps, stereo audio, pitch bends, fake slapback delay)
- the best one yet.wav, you'll see why
There are currently only 2 main programs, midi2wav and sf2analyzer.
make midi2wav
bin/midi2wav MY_MIDI_FILE.midmake sf2analyzer
bin/sf2analyzer MY_SOUNDFONT.sf2- Add some formal notes on how MIDI time (division, ticks, etc.) works
- Allow specifying output file name
- Make
midi2wavactually use the MIDI channel number - Add some simple instrument definitions that can be used in
midi2wav - Become MIDI 1.0 compliant
- http://soundfile.sapp.org/doc/WaveFormat
- https://www.synthfont.com/SFSPEC21.PDF
- https://www.ibiblio.org/thammer/HammerSound/sd_computers_and_music/pitch.html
- https://ccrma.stanford.edu/~craig/14q/midifile/MidiFileFormat.html
- https://www.ccarh.org/courses/253/handout/vlv/
- http://personal.kent.edu/~sbirch/Music_Production/MP-II/MIDI/midi_file_format.htm
- https://drive.google.com/file/d/1t4jcCCKoi5HMi7YJ6skvZfKcefLhhOgU
- https://midimusic.github.io/tech/midispec.html
Special thanks to Desmos for helping me visualize things, and ImHex for being amazing.