How to Create Custom Chord Rules for Stacks

As of Ableton Live 12.1, you can create and load custom chords for the Stacks MIDI Generator. Stacks "chord files" (or "banks") enable you to define your own set of rules to generate chords. These files are formatted using JSON and use the file extension .stacks. This guide covers how to create your own .stacks files and load them in Live’s MIDI Generative Tools. To learn more about the Stacks MIDI Tool in Ableton Live, visit the Live Manual section MIDI Tools > Stacks.

The Stacks MIDI Tool
Terminology
Creating custom chord banks 
Example .stacks file
Create and edit the JSON file
Tips for creating custom chords

The Stacks MIDI Tool

The Stacks MIDI Tool generates one or more chords in a given time interval of a MIDI Clip. This can be applied to Clips using the Stacks panel in MIDI Clip View. In Live, open a MIDI Clip, go to the Generate tab, and select Stacks from the dropdown menu.

Terminology

Chord rules

Chords in Stacks are generated from rules, which are expressed as lists of intervals (for instance, [0, 2, 4]). 

Scale cardinality

The number of pitches/intervals in the scale used to define the rule is called "cardinality.”  For example, a pentatonic scale has a cardinality of 5. A major scale, or any of its modes, has a cardinality of 7. The chromatic scale  has a cardinality of 12. If the current clip has no scale, rules are expressed in semitones, using all 12 notes of the octave.

Examples:

  • For a cardinality of 7, the rule [0, 2, 4]  would create a triad, where 0  is the root,  2  is the third (root + 2 scale degrees), and  4  is the 5th (root +4 scale degrees). The resulting chord depends on the current scale.
  • For a cardinality of 12 (chromatic scale/scale off) you can think of each number as semitones added to the root. The rule [0, 4, 7, 11]  would create a Maj7 chord. 

Chord banks

A bank or chord bank contains one or more sets of rules, corresponding to different supported cardinalities. Each rule set in the bank contains the different rules that are proposed for each chord pad in the Stacks panel.

The default Stacks Generator supports the following possible scale cardinalities: 5, 6, 7, 8, 9, 10, 12, 19, 22, 24, and 31. For each of these, up to 16 rules are defined.

The actual ruleset is chosen from the bank depending on the scale that is currently selected and its cardinality. If the bank doesn't have a set of rules for the selected scale cardinality, the rule set with the closest cardinality will be applied.

Loading chord banks

Stacks default chord bank can be replaced by alternative rules, loaded in Live from a .stacks file. Each .stacks file is a chord bank, meaning it contains one or more rule sets corresponding to different cardinalities. See the attached example Jazzy.stacks.

To load a chord file into the Stacks Generator, place the .stacks file into a folder that’s visible in Live’s Browser. You can then double-click the file name to load it as a replacement for Stacks’s default chord bank.

If the file is valid, the rule set is loaded automatically and will be used by the Stacks generator for all MIDI clips as long as the current Set is open. If the file is invalid for some reason, an error message will be displayed.

The top of the Stacks panel shows the name of the loaded bank (if any). A number in parentheses displays the cardinality currently selected in the file. This usually depends on which scale is used, but if the bank doesn't have a set of rules for the selected scale cardinality, the rule set with the closest cardinality will be applied. 

To return to the default bank, you can right-click or CTRL+click on the chord bank name to open the context menu and choose Reset Bank to Default.

Note: The selected chord bank is not saved with the Live set. It needs to be re-loaded each time a new Live set is created, or when a Set is opened.

Creating custom chord banks 

A chord bank is contained in a text file with the .stacks extension. The content of the file must be formatted following the JSON format.

Example .stacks file

The example .stacks file excerpt included below contains rule sets for 3 kinds of scales: 7-note, 12-note, and 5-note. 

The set for cardinality 7 contains 4 rules:

  • a triad, 
  • a 7th chord
  • a 9th chord 
  • a cluster of the 5 first notes of the scale

The ruleset for cardinality 12 contains 2 rules:

  • a Maj7 chord
  • a minor 7 chord 

The ruleset for cardinality 5 contains 3 other rules. 

Note: White spaces and line breaks are not significant, but they can be included for clarity of formatting. 

{ "chord_rulesets":
[
{
"scale_cardinality": 7,
"rules" : [[0,2,4], [0,2,4,6], [0,2,4,6,8], [0,1,2,3,4]]
},

{
"scale_cardinality": 12,
"rules" : [[0, 4, 7, 11], [0, 3, 7, 10]]
},

{
"scale_cardinality": 5,
"rules" : [[0,2,3], [0,2,4], [0,2,4,6]]
}
]
}

 

You can download the example file Example Bank.stacks linked at the bottom of this article.

Create and edit the JSON file

To get started creating your own chord rules file, you can copy and paste the example code above into a JSON editor such as https://jsonchecker.com/. The editor will notify you if there are any JSON syntax errors. You can then customize the example by modifying the existing rules, or add more rules. 

When you're done modifying the JSON file, copy and paste the contents into a text editor on your computer, such as TextEdit on macOS or NotePad on Windows, and save it. Then rename the file, and change the file extension from ".txt" to ".stacks".

Tips for creating custom chords

  • You can add as many rules to a ruleset as you like.
  • Rules can have any number of elements. Rules included with Live have at most four intervals, but this is not a limitation.
  • You can omit 0 as an interval.
  • You can use negative numbers as intervals.
  • You can use numbers larger than the cardinality to go over the octave. For example in the cardinality of 7, the rule [0, 8]  would create the root and a 9th. In the cardinality of 12 the rule [0, 14]  would create the root and a major 9th.
  • You can create rulesets for tuning systems with any number of notes. For example 19, 24, 31, etc. 
  • To edit a chord bank, you can make changes to the loaded .stacks file and save it, then reload by double-clicking on the file name in Live’s Browser. This will update the bank without needing to restart Live.

Attachments:

Ableton offers these in-depth help and learning resources: