The Multi-Agent Autonomous Looper (MAAL) is a co-creative sampler/looper based on a multi-agent logic algorithm and machine listening. The MAAL is composed of several agents, each controlling a loop track, which can autonomously decide to sample and play back segments of a live vocal performance by listening to each other. The MAAL aims to expands the possibilities for indirect control, interaction, and co-creativity in live looping for improvising musicians.
More information about the project is in the paper:
Vincenzo Madaghiele, Stefano Fasciani, Tejaswinee Kelkar, Çagri Erdem. MAAL: a multi-agent autonomous live looper for improvised co-creation of musical structures. In Proceedings of AI and Music Creativity Conference (AIMC) 2025, 10-12 September 2025, Bruxelles (BE).
Download and install anaconda here. Open a terminal and run the following instructions to install the dependencies:
conda env create -f looper-environment.yml
conda activate looper
Download Pure Data (PD) here. Download the Flucoma library for PD following the instructions here.
The zexy library for PD is used for OSC communication between python and PD, it can be installed by typing zexy in the deken externals manager (Help -> find externals) and clicking on install.
The iem_tab library for PD is used for buffer operations in PD, it can be installed by typing iem_tab in the deken externals manager (Help -> find externals) and clicking on install.
The else library for PD is used for GUI objects in PD, it can be installed by typing else in the deken externals manager (Help -> find externals) and clicking on install.
Just play live with the looper without messing around with custom settings! Just run:
python3 onlineMAAL.py
This will use the default config.json file in this repo.
Open a terminal. Configure the settings of the looper by modifying a configuration file like config.json in this repository; set the audiofile to be used for the offline ALL in the python script. Then run:
python3 offlineMAAL.py --SOUNDFILE_FILEPATH <path/to/soundfile.wav> --CONFIG_FILEPAHT <path/to/configfile.json> --OUTPUT_DIR_PATH <path/to/outputdir>
This will generate a the corresponding audiotracks and visualizations in a new folder with the same name as the soudfile in <path/to/outputdir>.
Open a terminal. Configure the settings of the looper by modifying a configuration file like config.json in this repository. Then run:
python3 onlineMAAL.py --CONFIG_FILEPAHT <path/to/configfile.json>
This python script will load and set up a PD patch as well.
The ALL can be configured by changing the settings in a ./config.json file. This is a list of the possible configuration options:
| Settings name | Description | Value range |
|---|---|---|
| tempo: int | Tempo determining the duration of a beat in beats per minute (BPM). | any |
| beats_per_loop: int | Number of beats corresponding to the duration of a loop. | any |
| rhythm_subdivision: int | Quantization of a loop for rhythm analysis. | any |
| startup-mode: string | Mode for selection of first loop. | repetition or user-set |
| startup-repetition-numBars: int | Number of consecutive repetitions at for repetition startup mode. | any |
| startup-similarityThreshold: float | Similarity threshold for for repetition startup mode. | [0,1] |
| startup-firstLoopBar: int | Number of first loop to be selected in user-set startup mode. | any |
| minLoopsRepetition: int | Minimum number of repetitions for a loop before it can be dropped. | any |
| maxLoopsRepetition: int | Maximum number of repetitions for a loop after which it is dropped. | any |
| loopChange-rule: string | Rule for changing the content of a loop track. | better or newer |
| looping-rules: list of RuleCombination | A list of rule combinations for each loop track. The ALL infers the number of loop tracks from the number of elements in this list. It is composed of RuleCombination lists. | as many as the number of tracks |
| RuleCombination: list of Rule | A list of rules used for a loop track, composed of many Rule objects. | any |
| Rule: dict with keys { | A rule object. It is a dictionary with three elements. | |
| rule-name: string | The name of the rule. | rule name from the table comparison metrics |
| rule-type: string | The type of rule to be used for comparison. | more or less |
| rule-threshold: float | The threshold used for comparison. | [0,1] |
| } |
The all works by comparing sound segments according to specific sequence-level comparison functions inspired by musical criteria. Comparison functions evaluate the similarity of two sequences according to musical criteria, returning a similarity index between 0 and 1. Comparison functions can be combined into rules to assign musical functions to each loop track. This is a list of the possible comparison functions:
| Metric name | Descriptors computed | Comparison method |
|---|---|---|
| Harmonic similarity | Chroma | MSE on sequence |
| Harmonic movement - C | Chroma | PCC on sequence |
| Harmonic movement - D | Chroma, Onset | PCC at onsets |
| Melodic similarity | Centroid | MSE on sequence |
| Melodic trajectory - C | Centroid | PCC on sequence |
| Melodic trajectory - D | Centroid, Onset | PCC at onsets |
| Dynamic similarity | RMS | MSE on sequence |
| Dynamic changes - C | RMS | PCC on sequence |
| Dynamic changes - D | RMS, Onset | PCC at onsets |
| Timbral similarity | Flatness | MSE on sequence |
| Timbral evolution - C | Flatness | PCC on sequence |
| Timbral evolution - D | Flatness, Onset | PCC at onsets |
| Global spectral overlap | Mel Spectrum | Difference between averages |
| Frequency range overlap | Mel Spectrum | Overlap of estimated bandwidths |
| Rhythmic similarity | Binary Rhythm, Onset | Hamming distance |
| Rhythmic density | Binary Rhythm, Onset | MSE on quantized sequence |
| Harmonic function similarity | Tonnetz | MSE on sequence |
| Harmonic function transitions - C | Tonnetz | PCC on sequence |
| Harmonic function transitions - D | Tonnetz, Onset | PCC at onsets |
@inproceedings{madaghiele2024RLimpro,
author = {Madaghiele, Vincenzo and Fasciani, Stefano and Kelkar, Tejaswinee and Erdem, Çagri},
title = {{MAAL: a multi-agent autonomous live looper for improvised co-creation of musical structures}},
booktitle = {Proceedings of AI and Music Creativity Conference (AIMC)},
year = {2025},
month = {09},
address = {Bruxellses (BE)}
}
- released MAAL~ v0.0.0 is only tested on Pd-0.55-2 and Pd-0.56 and macOS Tahoe 26.0.1
- PD MAAL~ standalone app only works at 44.1 kHz
- missing exec for windows release
- externals need to be included in the release version
