molleindustria / TwitchToMIDI

Turns the Twitch chat into a MIDI device
MIT License
19 stars 2 forks source link

Twitch Plays MIDI

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.

Setup

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.

  1. Open the project in Processing making sure that all the files are in a folder named TwitchPlaysMidi (not TwitchPlaysMidi-master).
  2. Add your Twitch credentials to Bot.pde. If "irc.twitch.tv" in Bot.pde doesn't connect try "irc.chat.twitch.tv"
  3. Install The MidiBus and Ani libraries from Processing with Add Library...
  4. Set up your virtual MIDI bus/port. On Window you will need a Virtual Midi Cable program like loopMIDI (launch, add port with the +). On Mac you need to follow these instructions
  5. Run the sketch check the list of MIDI device and replace "loopMIDI Port" in TwitchToMidi.pde with the device you want to use.
  6. Set up your music making program (DAW) and map the controls you want to expose to remote MIDI. This configuration depends on the application. Examples: Ableton Live, FL Studio...
  7. In TwitchPlaysMidi.pde add your own chat commands and related MIDI controllers in the arraylist "controllers"
  8. Test the Twitch to MIDI communication first and then the MIDI to DAW communication. You don't have to be live on Twitch to test the chat functionalities, just open your offline channel and type in the chat.
  9. Start streaming
  10. ???
  11. Profit!

Notes