🎶

Integrating Python with Ableton for Music

Jun 4, 2025

Connecting Python to Ableton for Music Creation

Introduction

  • Presenter: Mark Evansen
  • Objective: Connect Python to Ableton for music creation

Part 1: Setup and Computer Settings

  • Ableton Setup

    • Start with a blank Ableton session with three MIDI parts:
      1. Drum kit
      2. Ethereal Theremin whistle
      3. Electric bass
    • Record enable all three tracks to hear playback
  • MIDI Setup on Mac

    • Use IAC (Inter-Application Communication) for MIDI communication between programs
    • Steps to setup IAC:
      • Go to Audio MIDI Setup
      • Navigate to Window -> Show MIDI Studio
      • Double-click on IAC Driver to open settings
      • Ensure "Device is online" is checked
      • Add 3-4 MIDI ports (only one needed for this setup)
    • In Ableton, set MIDI input for each part to IAC Driver Bus 1
    • Assign MIDI channels:
      • Drums: Channel 1
      • Theremin: Channel 2
      • Bass: Channel 3

Python Setup

  • IDE

    • Use Thonny IDE for its simple and uncluttered interface
  • Python Libraries

    • Install Scamp Suite (via pip or Thonny's Manage Packages tool)
    • Scamp Extensions (optional)
  • Python Script Overview

    • Import Scamp library
    • Create session object with tempo of 100 stored in variable s
    • Create instruments using session object:
      • Drum part: MIDI messages over IAC Bus 1, Channel 1
      • Theremin part: Channel 2
      • Bass part: Channel 3
    • Script structure:
      • Infinite loop to play notes on drums, theremin, and bass
      • Play note parameters: pitch, volume (0-1), duration (beats)

Adding Randomization and Effects

  • Use Python's random library for randomization
    • Drum pitch: random.randint(36, 45)
    • Bass pitch: Same as drums
    • Theremin pitch: Glissando effect with [80, 78]
    • Randomize durations using random.uniform(0.2, 1.3)
  • Add acceleration effect with s.set_tempo_target(1000, 50)

Additional Information

  • Next steps: Creating a slap bass part
  • Resources:
    • Code available in video description
    • Early access and additional resources available on Patreon
  • Patreon supports Scamp development efforts

Conclusion

  • This video focused on the setup for integrating Python with Ableton
  • Upcoming videos will delve into more creative aspects of music making with Python