Tips for Streaming Your Max Patch


    With the increased importance of social distancing, many people are facing the need to teach or present work using Max remotely. Many schools have moved their courses online, and streaming video has emerged as a popular way to connect with people socially across distances. This article will provide some practical tips on how to set up audio and video streaming from your computer in order to share it with others.
    Modern video conferencing services and solutions usually apply intelligent filters and compression algorithms in order to optimise the stream for low latency and speech intelligibility, usually at the cost of audio quality. While the following won’t provide an audiophile streaming experience to your audience it does provide a solution where both the latency and quality are good enough to illustrate what is going on with your patch.
    While modern browsers are equipped with technology (WebRTC) that allows peer-to-peer communication between users, it’s usually more difficult to set up and furthermore prone to issues with the networking layer if people are behind proxies or firewalls that can often be found in educational institutions. This guide therefore opts for a more classic streaming approach in order to increase accessibility and ease of use.
    Check out the other streaming article - Streaming Tips - The Jitter Edition

    Requirements

    The key idea here is to use local software in conjunction with a streaming platform for creating a video stream that can be accessed by others by means of visiting a url in their browser. Additional to providing a video stream most services include features for interacting with your audience like a live chat or others. In order to achieve this you will need to install the following:
    You will also need:
    • A stable internet connection
    • An account with a streaming platform of your choice, two popular options are Twitch and YouTube
    In this guide we’ll be using BlackHole as a virtual audio driver, OBS and Twitch as a video streaming service. Twitch offers us the possibility of 160Kpbs stereo audio, as opposed to video conferencing services that usually work with mono and even further compressed audio streams.

    Setup

    Creating a Twitch Account
    If you do not already have an account please visit https://www.twitch.tv and create a new user account to use for your stream.
    Configuring Max
    We’ll start by setting up the audio in Max in order to be able to use its output as an input within OBS. Assuming that BlackHole has been successfully installed simply open the Audio Status Window (Options => Audio Status) and select BlackHole as the Output Device. Also make sure that the Sampling Rate is set to 44100.
    Audio Status Window with BlackHole set as Output Device and a Sampling Rate of 441000
    Audio Status Window with BlackHole set as Output Device and a Sampling Rate of 441000
    Adjusting the OBS settings for streaming to Twitch
    After successfully installing and opening OBS we need to adjust the settings for streaming to Twitch. In case you are greeted by the Configuration Wizard on your first launch of OBS you can simply skip that for now. To adjust the settings for our Twitch stream open the Preferences (OBS => Preferences) and navigate to the Stream section. Within that section select Twitch as the service, leave Auto as the Server.
    OBS Stream Preferences
    OBS Stream Preferences
    Next click on the Link next to Stream Key , which will open your web browser and navigate to the Settings Page of your Twitch Account. Copy your Stream Key from here and paste it into OBS.
    Next up we’ll adjust the parameters for our stream within OBS. For this guide we’ll be streaming using a resolution of 1080p and 160kbps audio. However, this might be demanding for your machine and network so please refer to the encoding recommendations provided by Twitch https://stream.twitch.tv/encoding/ in order to adjust the parameters accordingly.
    Navigate to the Output section of the preference screen and make sure that Simple is selected as the Output Mode. We’ll use a Video Bitrate of 6000 kbps according to the recommendations. Leave the Encoder as Software (x264) and set the Audio Bitrate to 160. Also make sure to enable the Advanced Encoder Settings and Enforce streaming service bitrate limits and select veryfast as the Encoder Preset.
    OBS Output Preferences
    OBS Output Preferences
    Next we’ll head to the Audio section to ensure that we are using a Sample Rate of 44.1 kHz to match our setting in Max and that we are streaming in stereo. Underneath this we can set up our Audio Devices. In order to route the output from Max into OBS we select BlackHole for Mic / Auxiliary Audio. If you’d like to additionally use a microphone input you can select this as the second device.
    OBS Audio Preferences
    OBS Audio Preferences
    We’ll now head to the video settings and set our resolution. In order to stream with 1080p we set the Base and Output resolution to 1920x1080 and the Common FPS Value to 60.
    OBS Video Preferences
    OBS Video Preferences
    With that, we have prepared OBS for our stream and can close the Preferences Window.
    Selecting the Display Capture
    At the bottom of OBS’ main window you can adjust the sources of video input that should be included in our stream. OBS is a powerful tool that allows you to combine various sources of video input into a single stream. For the sake of this guide we’ll stick to simply sharing the entire screen of the streaming computer, however feel free to adjust this according to the needs of your stream.
    If there are already sources added to your stream simply remove them by selecting and clicking the Minus Button. To add a capture of your screen click on Plus Button in the Sources section and select Display Capture. Click OK in the opening dialogue and next up you will see a window that allows you to adjust the properties of the Display Capture. This would for example allow you to select the display to use in case you have multiple displays connected, hide the cursor or perform any cropping. You can simply click on Defaults in the bottom left corner and then click on OK. You should now see your display getting shown within OBS and can simply use the red border to resize the captured display to fit into the stream.
    Starting the stream
    To start our stream, click on Start Streaming in the bottom right corner of the OBS window. Once the stream is successfully connected and live you should see a bright green square on the bottom right corner.
    You should now be able to access the Creator Dashboard on Twitch to verify your stream is up and running by visiting https://dashboard.twitch.tv/ and running with a good quality. From here you will also be able to interact with your viewers using the Live Chat. During your actual live stream it might be a good idea to turn off the local preview of your stream in order to save additional bandwidth.
    Creator Dashboard on Twitch of our Live Stream
    Creator Dashboard on Twitch of our Live Stream

    Audio Monitoring

    In order to be able to monitor the audio you will be streaming we need to ensure that OBS' monitoring is routed and setup correctly. First off open the Preferences again and switch to the Audio pane. In the Advanced section you can use the dropdown to select the Monitoring Device of your choice.
    OBS Audio Preferences with "External Headphones" used as Monitoring Device
    OBS Audio Preferences with "External Headphones" used as Monitoring Device
    Next up we will need to enable the Monitoring for our stream. For that open OBS' Advanced Audio Properties via the Edit Menu and set the option for Audio Monitoring to Monitor and Output on the Mic/Aux device.
    OBS Advanced Audio Properties with enabled Monitoring on the Audio from Max (Mic / Aux - BlackHole)
    OBS Advanced Audio Properties with enabled Monitoring on the Audio from Max (Mic / Aux - BlackHole)

    Issues to Consider

    A fundamental limitation you will potentially encounter is the speed of your upstream connection. Most people have faster download than upload speeds. For example, an example cable modem speed test might say you have 130Mbps download and 12Mbps upload. Therefore it is recommended to test the speed of your connection before your are asking others to join your stream. You will end up having to adjust your video output settings accordingly. As a general help please refer to resources like Twitch’s Encoding Guidelines.
    We chose to illustrate how to stream your Max patch using Twitch for this guide given the simplicity and accessibility of the service. However, if you have certain requirements like unlisted or private streaming you might want to consider using a different platform.
    You can use OBS to route multiple audio sources into your stream but can of course also use an adc~ within your Max patch and combine it with the audio produced by your patch if that’s easier for your setup . We hope this guide helps you get started using Max in a live streaming environment, and encourage you to leave a comment if you run into trouble or have any other tips you can offer.

    • Mar 20 2020 | 10:45 pm
      Wonderful article and some great tips. Thank you!
    • Mar 20 2020 | 10:57 pm
      Currently rehearsing my next live stream, thank you so much !
    • Mar 21 2020 | 4:01 am
      Thanks for the article!
    • Mar 21 2020 | 4:34 pm
      Just in time! Thank you!
    • Mar 21 2020 | 4:37 pm
      Perfect! thank you
      Edit: I couldn't get the 'Display Capture' to work (or more specifically, i can get the stream going, but its just a black screen) . Followed some OBS troubleshooting links here but no luck.
      I did notice a 'Syphon Client' option, which i got to work pretty easily and am excited about.
      Redit: nm i figured it out, had to manually allow OBS to record screen lol im dumb.
    • Mar 26 2020 | 5:12 am
      I maybe have skipped over something, but how does one monitor the output locally? It seems like it just routes the audio to obs and out to twitch.
    • Mar 26 2020 | 12:19 pm
      @Ryan thanks for your comment and yes, definitely a very valid point. I added an additional section that shows how to set up Audio Monitoring for your stream. Please be aware that the audio configuration might be slightly different for every user given their specific setup but hopefully this gives you a general idea on how to achieve it.
      Thanks.
    • Mar 26 2020 | 3:13 pm
      The article doesn't mention any virtual audio input for Windows. Let me suggest VoiceMeeter Banana, which represents 3 ASIO drivers in 1. It can create connections to/from other software using other types of Windows drivers. Also, there's an add-on for OBS to get signals from ASIO programs in parallel with the regular audio input.
    • Mar 30 2020 | 4:17 pm
      Great article. I am not a Max Power user but ages ago there was an experiment about connecting midi instruments and also audio instruments via internet. Is there a solution? I mean that i can play midi keyword and my friend over internet play an acoustic instrument and we stream it as a concert?
    • Apr 18 2020 | 4:20 pm
      Is there a solution? I mean that i can play midi keyword and my friend over internet play an acoustic instrument and we stream it as a concert?
      You can use Jamtaba for that purpose, it is a free and open source software that connects to Ninjam servers (made by Cockos). I'm using it with some friend to play music over internet and stream it on youtube, it is working perfectly. You can use it as a standalone or a vst plugin : http://jamtaba.com/
    • Apr 30 2020 | 8:29 am
      Clear and well explained. Excellent. Thank you for the article.
    • May 09 2020 | 9:24 am
      I've followed all the steps but this is not working for me. I have no sound from Max in the stream. Did anyone test this on Catalina?
    • May 09 2020 | 9:54 am
      @CARLOSCCAIRES this article / walkthrough was actually done on OSX Catalina. So I'd assume something is off in your setup as it worked for others. Do hear the Max patch using the OBS monitoring functionality to ensure the Max audio out is properly reaching OBS using BlackHole or a similar solution?
    • May 09 2020 | 1:31 pm
      Ok. really not working here with BlackHole, everything checked... With loopback works fine, but I was hoping not to spend 122$...
    • Jun 08 2020 | 6:08 pm
      @THORSTEN OLSCHA I have been using soundjack to play music in real-time. However, it does not deal in MIDI, just audio stream. I highly recommend it for that purpose. I haven't been able to find anything quite like it. Here is a quick tutorial video which also shows a possible setup for streaming. Very interested to hear about other options that might be out there for online collaborative music. Cheers