Byte jams are a fun demoscene event where there's usually music from a DJ and several participants who use the TIC-80 fantasy console to code up a graphics effect from scratch within an hour. I usually watch the Field-FX stream on Monday evenings, and occasionally take part; there's an archive of the graphical effects people have made in these sessions, here.
A rather neat part of this is that TIC-80 has been modified to allow its programs to access the FFT of a sound stream, so that you can make your programs respond to the music in real-time. However, this can require a bit of setup on a mac.
In this document I will describe how to set up the audio software, plus byte jam client and TIC-80 itself, to allow participation in a byte jam.
You will need the following to get started:
- rust: ideally install via rustup; follow the instructions here
- Blackhole 2CH: download and install the PKG file from here
- git: if you don't have it installed, follow the instructions here
Ticws is totetmatt's byte jam client, linking your TIC-80 session to whoever is running the stream. In the terminal, do the following:
git clone https://github.com/totetmatt/ticws.git
cd ticws && cargo build --release
The stable release of TIC-80 does not currently (2024-12-28) have the changes for byte jams or the FFT interface; however the nightly builds do. Download the build from here and extract it into the ticws
directory. If you click that link from Safari then it will probably unzip it for you, in which case from the ticws
directory in terminal you just need to do this:
mv ~/Downloads/tic80-macos-arm64 .
You should then be able to see both the ticws
client and the tic80
executable from the ticws
directory:
$ ls target/release/ticws-client tic80-macos-arm64/tic80
target/release/ticws-client* tic80-macos-arm64/tic80*
$
Tell macOS to trust the tic80
executable:
xattr -r -d com.apple.quarantine tic80-macos-arm64/*
Download run_client.sh
(from here ) and put it in the ticws
directory, then
chmod +x run_client.sh
If you want your TIC-80 code to be able to react to an audio stream (from Twitch, or Spotify or whatever) then you'll need some way of taking audio output and looping it back so TIC-80 can access it as an input. This is what Blackhole 2CH does. Once you've installed it, open the "Audio MIDI Setup" app (I normally seach using the icon in the top-left of the screen; the app has a little piano keyboard icon). You should then see something like this:
- Click the "+" sign in the bottom left and select "Create Multi-Output Device".
- Make sure both "Macbook pro speakers" and "Blackhole 2CH" are selected in the right-hand pane.
This creates a new virtual audio device - sound sent here will go to both your laptop speakers and also to the Blackhole loopback device which can be read by TIC-80. If you right-click/double-finger-tap on "Multi-output device" then select "Use this device for Sound Output" then the system will send sound (eg from Spotify or your web browser) here. Note that this disables the speaker controls on F11/F12! If you want to go back to normal sound setup (and re-enable the F11/F12 controls), right-click on "Macbook pro speakers" and select "Use this device for Sound Output".
Whoever is organizing the jam will tell you the name of the room; you will also need to choose a name or handle for yourself. Then, in the ticws
directory, run:
./run_client.sh roomname handle
That's it! You should get a TIC-80 session up, and (remember to use "Multi output device" for audio output) it should have a working fft()
function. Have a great byte jam!
Comments to [email protected]