Skip to content

molleindustria/TwitchToMIDI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  • 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

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

  • 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.

About

Turns the Twitch chat into a MIDI device

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published