A simple Processing/java template for collective "music" performances over Twitch. It creates a chatbot that connects to your Twitch channel and lets users interact with your computer through text commands like:
delay 90 2 - changes the controller labeled "delay" to 90% over the course of 2 seconds dropbass - sends a C2 note
TwitchPlaysMIDI was created for TwitchPlaysBees. It controlled two VST filters in Ableton Live. The VST filters windows were on a second display with a green background and overlayed on the stream with a chroma key effect.
Requires Processing a free Java-based environment for creative coding.
Uses PircBot an IRC library for java (included in code/)
Uses The MidiBus a Processing library (not included)
Uses Ani a Processing library that manages eased transitions between values
Traditionally Twitch-plays games run on dedicated machines that are streaming the output of the game through OBS or other applications. This program listens to Twitch chat messages and interprets them as MIDI input on your computer. A Twitch chat mostly functions like an IRC channel, so your bot can both receive or send text messages. You need some familiarity with MIDI configuration to set this up.
This program doesn't create any music, it only produces MIDI inputs emulating a keyboard or a controller. You will need a MIDI-enabled digital audio workstation like Ableton Live, Garage Band, or FL Studio to turn notes into sound.
On Twitch there is a lag of a couple of seconds between video and chat, don't expect users to be in sync or to make meaningful compositions. TwitchPlaysMIDI is probably more appropriate for hybrid performances in which users contribute to a live set, slow ambient pieces, or generative music.
Twitch hides the channel description at the bottom of the page so users don't generally see the instructions. Consider setting up a stream overlay with some information on how to interact. You can use Processing's graphical capabilities for that.