Releases: aliceisjustplaying/TIC-80
v0.0.5
EDIT: in the great rush to get this out before the party i managed to compile this with 11025 Hz/1024 🤦♀️ The upside is that there was less difference between this and the older version used for streaming!
v0.0.5 — 44.1 kHz 11 kHz, 1024 buckets
What's new
- Rebased on the latest version that has important fixes wrt CLI argument handling
44.1 kHz11 kHz, 1024 buckets (this seems to give the best data for now; with less buckets, the lower end of the bass gets unreliable)- Fixed issue with capturing non-default loopback devices on Windows
fft
andffts
can now sum frequencies between two bucket indices
Important Notes
-
For the FFT feature to work you need to start it with
--fft
-
On Windows, use
--fftuseplaybackdevices
to capture the loopback. Double-check the console output you're not accidentally capturing your microphone when running without it! -
On all platforms, for your input device, set it within the OS to 44100 Hz, because resampling produces artifacts every 3-4 seconds or so. You can do that in Audio MIDI Setup on macOS for example. Windows should default to 44100 Hz (based on my very limited testing), double-check the console output and adjust if needed.
-
Check
tic80 -h
for more options.
Known bugs
- Bounds checking for the summing feature (see below) only properly implemented in lua
- If resampling kicks in, expect artifacts in the data in every 3-4 seconds
- When first running your program, leave it running for about 20-30 seconds, as it turns out initializing the peak normalization takes time and initially all buckets are close to 0. This only happens on the first run after TIC-80 started.
Documentation
Two functions to use:
fft(start_freq, end_freq=-1)
gives you the data with peak normalization (volume independent) in the given bin (or range) where the number should be between 0 and 1 except it's sometimes slightly more than 1. Will try to track down this issue another day, but afaict this is also present in Bonzo.
ffts(start_freq, end_freq=-1)
gives you the data with peak normalization and peak smoothing in a given bin (or range) with a factor of 0.6f
which seems like a sweet spot but may tweak it in the future. This data does seem to be accurately between 0 and 1.
As always, thanks @TheNuSan for the help.
All feedback appreciated!
Full Changelog: v0.0.4...v0.0.5
TIC-80 11k edition (fixed)
Important notes:
- For the FFT feature to work you need to start it with
--fft
- On Windows, you will likely need to use
--fftusecapturedevices
to capture the loopback. Double-check the console output you're not accidentally capturing your microphone when running without it! - Check
tic80 -h
for more options.
Cooked up something new with the help of @TheNuSan. The algorithm is a carbon copy from her version of Bonzomatic but with a twist.
Details:
- Audio is sampled at 11,025 Hz instead of 44,100 Hz. In our testing this improves the data quite a bit
- Audio is binned into 1024 linear FFT bins
- Two functions:
fft(freq)
gives you the data with peak normalization (volume independent) in the given bin where the number should be between 0 and 1 except it's sometimes slightly more than 1. Will try to track down this issue another day, but afaict this is also present in Bonzo.
ffts(freq)
gives you the data with peak normalization and peak smoothing with a factor of 0.6f
which seems like a sweet spot but may tweak it in the future. This data does seem to be accurately between 0 and 1.
A side effect of sampling at 11k with 1024 bins is that our bins are higher resolution i.e. lot more narrow (~10.76hz). So while in the old, 256-bin, 44k version, fft(0)
would give you the "beat" often quite well (if I understand it right), this time you'll have to check more bins for it.
Tested and working:
- Windows XP 32-bit
- Windows 11 64-bit
- macOS arm64
- Linux amd64
- Linux arm64
Might have issues:
- Windows 7 32-bit but needs testing on other devices
All feedback appreciated!
v0.0.2
Up-to-date build. Old algorithm. Less bugs. No need for --fft
, but it does have all the improvements WRT finding and picking devices. Should work well on Windows 7 now.
Experimental `fftns()` version
Adds the fftns()
function that's normalized and smoothed peak normalized with peak smoothing (with the default options in the code) per https://github.com/TheNuSan/Bonzomatic/blob/29f3e46f6fbbf3fc3aec46af2965f9ed0dfc5beb/src/platform_common/FFT.cpp#L137.
You'll need to start it with --fft
for FFT to be enabled.
edit: does NOT yet do actual smoothing.
Initial release
TIC-80 Lovebyte / Byte Battle / FFT version
TIC-80 upstream builds with Byte Battle + FFT support.
Prior work:
- https://github.com/glastonbridge/TIC-80
- https://github.com/creativenucleus/TIC-80-bytebattle
- https://github.com/sknebel/TIC-80/tree/tmp
Contributors:
- Sven Knebel - Github @sknebel
- Graham Bates - Github @grahambates
- Kii - Github @kiikrindar
- Matt Westcott - Github @gasman
- Alice - Github @aliceisjustplaying
Tested on:
- Windows 11 amd64 (Steam Deck, all versions)
- Windows 11 arm64 (VMWare Fusion 13, winxp version)
- Windows 11 arm64 (Parallels 18; windows version)
- macOS 14 amd64 (M1 Pro; thru Rosetta 2)
- macOS 14 arm64 (M1 Pro)
- Linux amd64 (Steam Deck, Arch Linux)
- Linux arm64 (M1 Pro, Asahi Linux) - experimental - colors glitch sometimes, terminal/app needs restarting sometimes to work - may be an Asahi thing