With WaveOut, typically one defines the following values before starting a WaveOut thread: sample rate, number of blocks, and size of each block in frames. Based on these values, a particular latency will be calculated. StepMania historically follows this approach. However, it is possible to target a specific latency instead, and extrapolate the needed number of blocks if the sample rate and block size values are known. This PR refactors the driver to calculate the ideal number of blocks based on a pre-determined optimal target latency and block size. This allows us to guarantee a nearly-imperceptible difference in WaveOut latency (0.29 ms) between 44.1 kHz and 48 kHz. Nothing related to driver functionality is changed. We just change the way the buffer parameters are determined. This PR only changes code which runs before the WaveOut thread is launched. When we consider how the WaveOut API works, we need to provide three of four values and the fourth is calculated. So, at 44100 Hz, with 15 blocks of 256 frames each, 15 * 256 gives us 3840 frames of latency (3840 / 44100 = ~87 ms). If we use this same configuration with 48000 Hz, we get a latency of 80ms which is a significant difference. However, if we increase to 16 blocks at 48000 Hz, we get 4096 frames of latency (~85 ms), which is much closer to the 87 ms when using 15 blocks at 44100 Hz. A target latency of 118 ms allows for the smallest possible delta when using a block size of 512 frames, and testing with sample rates of 44100 and 48000. At 44100 Hz / 512 frames / 118 ms target latency, we have a calculated latency of 127.7098 ms. At 48000 Hz / 512 frames/ 118 ms target latency, we have a calculated latency of 128 ms - a 0.29 ms difference. I determined this by simulating the CalculteNumBufferChunks calculation for a range of 100 to 300.
ITGmania
ITGmania is a fork of StepMania 5.1, an advanced cross-platform rhythm game for home and arcade use.
Changes to StepMania 5.1
- Built-in network functionality
- Fully 64-bit, optimized for modern OSes
- Reload new songs from within the song select screen
- The mine fix applied (courtesy of DinsFire64)
- Held misses tracked in the engine for pad debugging
- Fixed overlapping hold bug
- Per-player visual delay
- Per-player disabling of timing windows
- New preference to control note render ordering
- Increased the Stats.xml file size limit to 100MB
- Changed the default binding for P2/back from hyphen to backslash
Installation
You can choose between using the installer or using the portable build. Using the installer is recommended, because it makes upgrading to new versions easier.
Windows
Windows 7 is the minimum supported version.
- You will likely have to manually allow the installer to start.
macOS
macOS users need to have macOS 11 (Big Sur) or higher to run ITGmania.
-
Move ITGmania.app to the Applications folder, and then run the following command in Terminal:
xattr -dr com.apple.quarantine /Applications/ITGmania
-
You should then add ITGmania to the "Input Monitoring" section of System Preferences (under Security & Privacy)
Linux
Linux users should receive all they need from the package manager of their choice.
-
Debian-based:
sudo apt install libgdk-pixbuf-2.0-0 libgl1 libglvnd0 libgtk-3-0 libusb-0.1-4 libxinerama1 libxtst6
-
Fedora-based:
sudo yum install gdk-pixbuf2 gtk3 libusb-compat-0.1 libXinerama libXtst
-
Arch Linux:
sudo pacman -S mesa gtk3 libusb-compat libxinerama libxtst llvm-libs
-
OpenSUSE:
- OpenSUSE comes with everything you need pre-installed.
Build From Source
ITGmania can be compiled using CMake. More information about using CMake to build ITGmania can be found in both the Build directory and CMake's documentation.
Resources
- ITGmania Website
- StepMania 5.1 to ITGmania Migration Guide
- Lua for ITGmania
- Lua API Documentation can be found in the Docs folder.
Licensing Terms
ITGmania, as well as the Simply Love theme, are both under the GPLv3 license, or at your option, any later version.
If ITGmania code is used in your project, we would also appreciate it if you link back to ITGmania as well as StepMania.
For specific information/legalese:
- All of our source code is under the GPLv3 license.
- Songs included within the 'StepMania 5' folder are under the CC-NC license.
- Simply Love is licensed under the GPLv3, or, at your option, any later version.
- The copyright for songs in the 'Club Fantastic' folders rests with the original authors. The content is explicitly NOT placed under a Creative Commons license (or similar license), but has been provided free of charge, for personal or public use, including online broadcasting, tournaments, and other purposes. Go to the Club Fantastic website for more information.
- The MAD library and FFmpeg codecs when built with our code use the GPL license.
- This software is based in part on the work of the Independent JPEG Group.
- Check the Docs/Licenses.txt for the licenses of the used libraries.
Credits
ITGmania Team
- Martin Natano (natano)
- teejusb
Contributors
- Club Fantastic
- DinsFire64 (Mine Fix)
- EvocaitArt (Enchantment NoteSkin)
- jenx (Fast Profile Switching)
- LightningXCE (Cyber NoteSkin)
- MegaSphere (Note/Rainbow/Vivid NoteSkins)
- StepMania 5
- Old StepMania Team