JS-Live-API
A series of tutorials and examples for controlling Ableton Live with JavaScript through Max for Live.
Overview
This repository contains code examples and tutorials for programming Ableton Live using JavaScript via Max for Live. The series is designed for developers who own Ableton Live 9 Suite and are comfortable with JavaScript programming.
Video Tutorial
Watch the tutorial on YouTube
Prerequisites
- Ableton Live 9 Suite (or later)
- Basic JavaScript knowledge
- Max for Live
Tutorial Series
#1 Setup
Learn how to set up your JavaScript development environment within Ableton Live:
- Adding a Max MIDI Effect device
- Creating a JavaScript object
- Setting up the development workflow
- Basic debugging setup
Detailed Setup Guide
#2 Logging & Debugging
Learn how to implement robust logging and debugging in your Live JavaScript projects:
- Understanding the
post()
function
- Building a better logging system
- Handling different data types
- Working with objects and JSON
- Supporting multiple parameters
Detailed Logging Guide
#3 API Basics
Learn the fundamentals of interacting with Live’s API:
- Understanding Live API Documentation
- Working with Live Objects
- Navigating Live Paths
- Accessing Properties and Functions
- Using
this_device
Detailed API Guide
#4 Working with MIDI Clips
Part A: Reading MIDI Data
- Accessing MIDI clips through the API
- Reading note data
- Understanding note properties
- Working with selected notes
- Building reusable classes
Detailed MIDI Reading Guide
Part B: Writing MIDI Data
- Writing notes to clips
- Handling out-of-bounds values
- Replacing selected notes
- Building a humanize function
- Error handling and robustness
Detailed MIDI Writing Guide
#5 Building a User Interface
Learn how to create a Max for Live interface for your JavaScript code:
- Creating message objects
- Building slider controls
- Creating popup windows
- Organizing the interface
- Polishing the final device
Key concepts covered:
- Calling JavaScript from Max
- Passing parameters
- Creating floating windows
- Interface organization
- User experience considerations
Detailed UI Guide
#6 Going Deeper
Advanced topics for building production-ready Max for Live devices:
- Alternative Live paths
- Path validation
- Observers and callbacks
- Property types
- Proper device initialization
Key concepts covered:
- Working with canonical paths
- Handling invalid paths
- Using live.thisdevice
- Best practices for initialization
- Advanced error handling
Detailed Advanced Guide
Code Examples
Working with MIDI Clips