SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.06983 · 2022

Multitrack Music Transformer

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2207.06983.json · badge: /api/ran/2207.06983.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
salu133445/mmt canonical (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
salu133445/mtmt canonical (classifier label)
classifier basis not recorded on the link
2 ran · 2 no recorded run
FunctionStatusWhere it lives
encode_notes Ran
ran on a synthesized input
salu133445/mmt/mmt/representation.py
code served (permissive licence) · get_code("61feba2e9419878d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (10, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Build the encoding dictionary with all required mappings
encoding = {
    'max_beat': 16,
    'max_duration': 8,
    'type_code_map': {
        'start-of-song': 0,
        'instrument': 1,
        'start-of-notes': 2,
        'note': 3,
        'end-of-song': 4,
    },
    'beat_code_map': {
        0: 10, 1: 11, 2: 12, 4: 13, 8: 14, 16: 15
    },
    'position_code_map': {
        0: 20, 0.5: 21, 1: 22
    },
    'pitch_code_map': {
        60: 30, 62: 31, 64: 32, 65: 33
    },
    'duration_code_map': {
        1: 40, 2: 41, 4: 42, 8: 43
    },
    'instrument_code_map': {
        'piano': 50,
        'guitar': 51,
        'strings': 52,
    },
    'program_instrument_map': {
        0: 'piano',
        24: 'guitar',
        48: 'strings',
        100: None,
    },
    'dimensions': ['event_type', 'beat', 'position', 'pitch', 'duration', 'instrument'],
}

# Build notes as a list of tuples: (beat, position, pitch, duration, program)
notes = [
    (0, 0, 60, 1, 0),
    (2, 0.5, 64, 2, 24),
    (4, 1, 65, 4, 48),
    (8, 0, 62, 2, 0),
]

ARGS = {
    'notes': notes,
    'encoding': encoding,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (10, 6) — shape (10, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_notes Ran
ran on a synthesized input
salu133445/mmt/mmt/representation.py
code served (permissive licence) · get_code("4f844f0f942a9c17")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (5, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a minimal MusPy-like music object
class Note:
    def __init__(self, time, pitch, duration):
        self.time = time
        self.pitch = pitch
        self.duration = duration

class Track:
    def __init__(self, program, is_drum=False, notes=None):
        self.program = program
        self.is_drum = is_drum
        self.notes = notes or []
    
    def __iter__(self):
        return iter(self.notes)

class Music:
    def __init__(self, resolution, tracks=None):
        self.resolution = resolution
        self.tracks = tracks or []
    
    def __iter__(self):
        return iter(self.tracks)

# Build test data
resolution = 480

# Create some notes for a valid track
notes_track_1 = [
    Note(time=0, pitch=60, duration=480),
    Note(time=480, pitch=64, duration=480),
    Note(time=960, pitch=67, duration=960),
]

# Create some notes for another valid track
notes_track_2 = [
    Note(time=240, pitch=72, duration=240),
    Note(time=720, pitch=76, duration=480),
]

# Track with program 0 (piano - valid)
track1 = Track(program=0, is_drum=False, notes=notes_track_1)

# Track with program 40 (violin - valid)
track2 = Track(program=40, is_drum=False, notes=notes_track_2)

# Track that is drums (should be skipped)
track3 = Track(program=0, is_drum=True, notes=[Note(time=0, pitch=36, duration=240)])

# Track with invalid program (should be skipped)
track4 = Track(program=120, is_drum=False, notes=[Note(time=0, pitch=60, duration=480)])

# Create music object with multiple tracks
music = Music(resolution=resolution, tracks=[track1, track2, track3, track4])

ARGS = {
    "music": music,
    "resolution": resolution,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (5, 5) — shape (5, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_notes Ran
ran on a synthesized input
salu133445/mtmt/baseline/representation_mmm.py
code served (permissive licence) · get_code("d5b3cafc9b1d5ff4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class SimpleNote:
    def __init__(self, time, pitch, duration):
        self.time = time
        self.pitch = pitch
        self.duration = duration

class SimpleTrack:
    def __init__(self, program, notes):
        self.program = program
        self.notes = notes
    
    def __iter__(self):
        return iter(self.notes)

class SimpleMusic:
    def __init__(self, resolution, tracks):
        self.resolution = resolution
        self.tracks = tracks
    
    def __iter__(self):
        return iter(self.tracks)

# Create a simple music object with valid instruments
note1 = SimpleNote(time=0, pitch=60, duration=4)
note2 = SimpleNote(time=8, pitch=64, duration=4)
note3 = SimpleNote(time=16, pitch=67, duration=4)

track1 = SimpleTrack(program='piano', notes=[note1, note2])
track2 = SimpleTrack(program='violin', notes=[note3])

music = SimpleMusic(resolution=4, tracks=[track1, track2])

ARGS = {
    'music': music,
    'resolution': 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 5) — shape (3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_notes Ran
ran on a synthesized input
salu133445/mtmt/baseline/representation_remi.py
code served (permissive licence) · get_code("cf05a0584cdd8e3d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class Note:
    def __init__(self, time, pitch, duration):
        self.time = time
        self.pitch = pitch
        self.duration = duration

class Track:
    def __init__(self, notes, program):
        self.notes = notes
        self.program = program
    
    def __iter__(self):
        return iter(self.notes)

class Music:
    def __init__(self, tracks, resolution):
        self.tracks = tracks
        self.resolution = resolution
    
    def __iter__(self):
        return iter(self.tracks)

# Create sample notes
note1 = Note(time=10, pitch=60, duration=4)
note2 = Note(time=20, pitch=64, duration=8)
note3 = Note(time=10, pitch=60, duration=4)  # Duplicate for testing set deduplication

# Create tracks with program attribute
track1 = Track([note1, note2], program=0)
track2 = Track([note3], program=1)

# Create music object
music = Music([track1, track2], resolution=5)

ARGS = {
    "music": music,
    "resolution": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (3, 5) — shape (3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_mask Ran
ran on a synthesized input
salu133445/mmt/mmt/dataset.py
code served (permissive licence) · get_code("a4775d7ad289f8ac")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects 'data' which is an iterable of sequences
# Each sequence should support len()
# The function iterates through them and finds max length

# Create a list of sequences with different lengths
# Using lists as sequences since they support len()
data = [
    [1, 2, 3],           # length 3
    [4, 5, 6, 7, 8],     # length 5
    [9, 10],             # length 2
]

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (3, 5) — shape (3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
inverse_dict Ran
ran on a synthesized input
salu133445/mmt/mmt/utils.py
code served (permissive licence) · get_code("536553c3bd2d2ef0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def inverse_dict(d):
    """Return the inverse dictionary."""
    return {v: k for k, v in d.items()}

# Construct valid arguments for inverse_dict
d = {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
}

ARGS = {
    "d": d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_json Ran
ran on a synthesized input
salu133445/mmt/mmt/utils.py
code served (permissive licence) · get_code("39ad0a1e610519f3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, "test_data.json")

sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(temp_file, 'w', encoding='utf8') as f:
    json.dump(sample_data, f)

ARGS = {
    "filename": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_txt Ran
ran on a synthesized input
salu133445/mmt/mmt/utils.py
code served (permissive licence) · get_code("c0a19c384703b701")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary text file for testing
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf8')
temp_file.write("line one\n")
temp_file.write("line two\n")
temp_file.write("line three\n")
temp_file.close()

ARGS = {
    "filename": temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pad Ran
ran on a synthesized input
salu133445/mmt/mmt/dataset.py
code served (permissive licence) · get_code("44d7d3f43204eb41")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create test data with different shapes
# data[0].ndim == 1: 1D arrays
data_1d = [
    np.array([1.0, 2.0, 3.0]),
    np.array([4.0, 5.0]),
]

# data[0].ndim == 2: 2D arrays
data_2d = [
    np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]),
    np.array([[7.0, 8.0]]),
]

ARGS = {
    "data": data_1d,
    "maxlen": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
encode_notes Not yet run
unverified (harvested, no recorded run)
salu133445/mtmt/baseline/representation_mmm.py
code served (permissive licence) · get_code("da8737665512aaf7")
How it ran

no invocation recorded.

encode_notes Not yet run
unverified (harvested, no recorded run)
salu133445/mtmt/baseline/representation_remi.py
code served (permissive licence) · get_code("3c28f24eae63a984")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Existing approaches for generating multitrack music with transformer models have been limited in terms of the number of instruments, the length of the music segments and slow inference. This is partly due to the memory requirements of the lengthy input sequences necessitated by existing representations. In this work, we propose a new multitrack music representation that allows a diverse set of instruments while keeping a short sequence length. Our proposed Multitrack Music Transformer (MMT) achieves comparable performance with state-of-the-art systems, landing in between two recently proposed models in a subjective listening test, while achieving substantial speedups and memory reductions over both, making the method attractive for real time improvisation or near real time creative applications. Further, we propose a new measure for analyzing musical self-attention and show that the trained model attends more to notes that form a consonant interval with the current note and to notes that are 4N beats away from the current step.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2207.06983")
get_code_for_paper("2207.06983")
have("2207.06983")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2207.06983.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2207.06983.svg)](https://syntology.ai/paper/2207.06983)

Connect an agent — have() is free.