The Live Object Model in Max for Live

Introduction to getting, setting, and observing Live parameters with Max for Live.

Screen Shot 2015-03-04 at 11.48.03 AM

download

https://github.com/tkzic/max-for-live-projects

folder: lom

patch: aaa-lom-examples

tutorial

This example device shows several ways of working with Ableton Live parameters in a M4L patch. It can be a confusing process. And there are many different ways to accomplish the same result.

The examples here will use the LOM (Live Object Model) directly, and via builtin LiveAPI abstractions and choosers – available from the context menu that appears when you <ctrl> click inside of an open patcher window.

live.observer

Screen Shot 2015-03-04 at 11.57.45 AM

The snippet above shows how to continuously monitor Live’s tempo.

  • live.this.device sends out a bang when the device loads
  • the “path live_set” message tells live.path to get an id number for the current set. This id is sent to the right inlet of live.observer, telling it we want to observe the current Live set
  • the “property tempo” message asks live.observer for the current tempo value
  • If the tempo changes it will be automatically updated
live.object (set)

Screen Shot 2015-03-04 at 12.09.49 PM

The snippet above shows how to set Live’s tempo.

  • Get the Live set path id using the same method as shown for live.observer
  • the “set tempo” message sends a tempo value to live.object
live.object (get)

Screen Shot 2015-03-04 at 12.15.57 PM

The snippet above shows how to get Live’s tempo.

  • Get the Live set path id using the same method as shown for live.observer
  • the “get tempo” message requests the current tempo value from live.object
live.object (call)

Screen Shot 2015-03-04 at 12.23.11 PM

The snippet above shows how to start or stop the Live transport by calling functions.

  • Get the Live set path id using the same method as shown for live.observer
  • the “call start_playing” message tells live.object to start the Live transport. “start_playing” is the name of a function builtin to the Live set.
LiveAPI abstractions

The LiveAPI abstractions provide convenient shortcuts to working with Live parameters. Copy them into your patch by <ctrl> clicking inside an open (unlocked) patcher window – and selecting “Paste from -> LiveAPI abstractions”

Screen Shot 2015-03-04 at 12.30.25 PM

Observing the Live transport

Screen Shot 2015-03-04 at 12.31.49 PM

The snippet above shows how to monitor whether the Live transport is running

  • paste the abstraction into your patch as explained above
Selecting the master track

Screen Shot 2015-03-04 at 12.34.07 PM

The snippet above shows how to select the Master track

  • paste the abstraction into your patch as explained above
LiveAPI choosers

The LiveAPI choosers provide convenient shortcuts to selecting Live parameters from menu objects. Copy them into your patch by <ctrl> clicking inside an open (unlocked) patcher window – and selecting “Paste from -> LiveAPI choosers”

Screen Shot 2015-03-04 at 12.36.43 PM

Setting device parameters remotely with live.remote

Screen Shot 2015-03-04 at 12.38.29 PM

The snippet above shows how to remotely set the volume on the master track

  • paste the chooser into your patch as explained above
  • connect the left outlet of “substitute” to the right inlet of live.remote
  • send values to live.remote to change the selected parameter