A Nim MOD player just for fun
Some people ride ridiculously expensive Harley-Davidsons, collect vintage guitars or marry 20-year younger platinum blondes when midlife crisis strikes.
I write modplayers.
(Substitute nimmod with nimmod.exe on Windows and ./nimmod on Linux & OS X)
Play foo.mod
:
nimmod foo.mod
Play foo.mod
and explicitly set the buffer size (experiment with larger
values if experiencing audio drop-outs):
nimmod --bufferSize=4096 foo.mod
Display the calculated non-looped length of foo.mod
and exit:
nimmod --showLength foo.mod
Render foo.mod
to a 24-bit/48kHz WAV file called foo.wav
:
nimmod --output=wav --bitDepth=24 --sampleRate=48000 --outFilename=foo.wav foo.mod
Play foo.mod
without displaying the UI and show detailed debug info:
nimmod --noUserInterace --verbose foo.mod
Run nimmod -h
to see the full list of command line options.
The default Windows console raster font doesn't include Unicode box drawing characters, so if you see some random garbage on the screen, most likely that's the culprit. The solution is to set the console font to Lucida Console or some other font that includes the Unicode box drawing characters. Note that not all fonts will work well, some will result in discontinuous lines—you'll need to experiment.
Check out the data directory in this repo for a (in my opinion) very good selection of classic modules.
Visit the following huge online collections if you need more!
nimmod requires Nim 0.18.0+ and depends on the fmod, illwill and easyWave Nim packages. Install them with Nimble:
nimble install fmod illwill easywav
Then do a release build:
cd src
nim c -r -d:release nimmod
After this, you can run the render tests:
cd test
nim c -r rendertest
Copyright © 2016-2019 John Novak <[email protected]>
This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.