Presets in Max for Live

How to use the Max preset object inside of M4L.

Screen Shot 2015-03-22 at 8.06.14 PM

There is some confusion about how to use Max presets in a M4L device. The method described here lets you save and recall presets with a device inside of a Live set, without additional files or dialog boxes. It uses pattrstorage. It works automatically with the Live UI objects.

It also works with other Max UI objects by connecting them to pattr objects.

Its based on an article by Gregory Taylor: https://cycling74.com/2011/05/19/max-for-live-tutorial-adding-pattr-presets-to-your-live-session/

Download

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

Folder: presets

Patch: aaa-preset3.amxd

How it works:

Instructions are included inside the patch. You will need to add objects and then set attributes for those objects in the inspector.  For best results, set the inspector values after adding each object

Write the patch in this order:

A1. Add UI objects.

For each UI object:

  1. check link-to-scripting name
  2. set long and short names to actual name of param

Screen Shot 2015-03-22 at 8.44.23 PM

A2 (optional) Add non Live (ie., Max UI objects)

For each object, connect the middle outlet of a pattr object (with a parameter name as an argument) to the left inlet of the UI object. For example:

Screen Shot 2015-03-22 at 8.30.24 PM

Then in inspector for each UI object:

  1. check  parameter-mode-enable
  2. check inital-enable

Screen Shot 2015-03-22 at 8.51.10 PM

B. Add a pattrstorage object.

Screen Shot 2015-03-22 at 8.35.28 PM

Give the object a name argument, for example: pattrstorage zoo. The name can be anything, its not important. Then in the inspector for pattrstorage:

  1. check parameter-mode enable
  2. check Auto-update-parameter Initial-value
  3. check initial-value
  4. change short-name to match long name

Screen Shot 2015-03-22 at 8.42.49 PM

C. Add an autopattr object

Screen Shot 2015-03-22 at 8.34.21 PM

D. Add a preset object

Screen Shot 2015-03-22 at 8.34.53 PM

In the inspector for the preset object:

  1. assign pattrstorage object name from step B. (zoo) to pattrstorage attribute

Screen Shot 2015-03-22 at 8.52.11 PM

 Notes

The preset numbers go from 1-n. They can be fed directly into the pattrstorage object – for example if you wanted to use an external controller

You can name the presets (slotnames). See the pattrstorage help file

You can interpolate between presets. See pattrstorage help file

Adding new UI objects after presets have been stored

If you add a new UI object to the patch after pattrstorage is set up, you will need to re-save the presets with the correct setting of the new UI object. Or you can edit the pattrstorage data.

 

 

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

Patches for Cycling 74 “Programming in Max for Live” videos

These are my versions of some of the patches. Not Cycling 74’s. If you find ‘official’ versions please let me know. The list isn’t complete. The simpler (beginning) patches are not included, but the interesting ones are.

Screen Shot 2015-02-23 at 12.50.20 PM

download

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

folder: c74-video-tutorials

Sub-folders:

  • API-step-sequencer
  • dub-delay
  • poly-synth
  • velocity-sequencer
  • wobble-bass
Instructions

In Live, create new Max for Live devices, as instructed in the videos – and then copy and paste from these patches into your new patches.

 

 

chord generator using Live Object Model

Global tempo setting triggers Midi chords

download

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

folder: repeater

device: chord.amxd

instructions
  1. drag chord.amxd into a midi track
  2. put a midi instrument after the device in the track
  3. start the global transport (play on top toolbar)
  4. arm the midi track for record
  5. play some midi notes
  6. adjust the note value in the device

random tone and speed changes

This version randomly generates chord tones and and note durations.

In the same folder, device: chord2.amxd

instructions
  1. drag chord2.amxd into a midi track
  2. put a midi instrument after the device in the track
  3. start the global transport (play on top toolbar)
  4. arm the midi track for record
  5. hold down a Midi note
  6. Use toggles to select parameters to randomize

csound M4L devices made from Max help patches

Examples of editing Max help files to build Csound M4L devices

fof

A formant based Midi synth using Csound FOF – from the Max help file for [csound~]

from “The Csound Book” by Dr. Richard Boulanger

download

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

folder: csound

device: csound-fof3-tz.amxd

instructions

  • drag csound-fof3-tz.amxd file into a midi track
  • arm the track for recording and play some midi notes

svfilter

Sample playback using a state variable filter using Csound SVFILTER – from the Max help file for [csound~]

from “The Csound Book” by Dr. Richard Boulanger

download

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

folder: csound

device: svfilter-tz.amxd

instructions

  • drag svfilter-tz.amxd file into a midi track
  • drag a file into the waveform display (or use the default file)
  • With the mouse, select a section of the waveform to start playback

general suggestions

for converting Max help files to M4L devices:

  • Replace UI objects with Live versions. For example, toggle becomes live.toggle
  • Replace audio inputs/outputs with plugin~/plugout~
  • Select UI objects for presentation mode
  • In inspector, change default Scripting names for UI objects to allow automation

build M4L devices using Max help patches

Edit Max help files to build M4L devices

An audio pitch transposer made from [gizmo~]

download

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

folder: gizmo

device: gizmo-mod-example.amxd

instructions

  • drag gizmo-mod-example.amxd file into an audio track
  • use dial to pitch-shift audio

Leap Motion version

If you have access to a leap motion sensor, here is the same device using hand gestures to control the pitch.

device: gizmo-thing-700.amxd

externals and dependencies

Uses the aka.leapmotion external – which needs to be in your Max file path. Download from here: http://akamatsu.org/aka/max/objects/

instructions

  • plug in a Leap Motion sensor
  • drag gizmo-mod-700.amxd file into an audio track
  • Click the toggle to start reading Leap Motion data
  • Wave your hands around to pitch-shift audio

general suggestions

for converting Max help files to Max for Live devices:

  • Replace UI objects with Live versions. For example, toggle becomes live.toggle
  • Replace audio inputs/outputs with plugin~/plugout~
  • Select UI objects for presentation mode
  • In patch inspector, set the patch to open in presentation mode
  • In UI object inspectors, change default Scripting names to allow automation. “Long Name” is the name used by Live for automation

max-for-live-projects index

A collection of experiments using Max for Live.

Each project is in a separate folder. Several projects require additional external objects or dependencies. You will find helpful instructions by clicking links next to the project names below.

download

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

Runs in Live 9 and Max 6.1, on Mac OS 10.9

index