SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.05916 · 2021

Towards Automatic Instrumentation by Learning to Separate Parts in Symbolic Multitrack Music

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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; 1 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 0 failures of our instrument; 3 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/2107.05916.json · badge: /api/ran/2107.05916.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/arranger canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
FunctionStatusWhere it lives
find_optimal_zone Ran
ran on a synthesized input
salu133445/arranger/arranger/common/learn.py
code served (permissive licence) · get_code("502df14523bf8941")
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 tuple. 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 numpy as np

# Analyze the function find_optimal_zone:
# - counts: a sequence (list/tuple) that is indexed by label, where each element supports np.sum and slicing
# - permutations: an iterable of permutations

# Create counts: needs to be indexable by labels (0 to 127)
# Each counts[label] should support slicing [lower:upper] and np.sum()
counts = [np.random.rand(128) for _ in range(4)]

# Create permutations: an iterable of permutations
# Each permutation is used in zip with uppers, lowers, and labels
# The permutation should be a sequence with length equal to len(counts)
permutations = [
    tuple(range(len(counts))),
    tuple(reversed(range(len(counts)))),
    (0, 1, 2, 3),
    (3, 2, 1, 0),
]

ARGS = {
    "counts": counts,
    "permutations": permutations,
}
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 tuple — a tuple output has no array shape of its own; none is 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
get_angles Ran
ran, violated the contract we drafted
salu133445/arranger/arranger/lstm/model.py
code served (permissive licence) · get_code("585440080f31568c")
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 1, dtype family float, shape (4,) 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

# Analyze the function:
# - pos: used in multiplication with angle_rates, should be a scalar or array
# - i: used in integer division (i // 2) and arithmetic, should be an integer
# - d_model: used in division and as float, should be a positive number

ARGS = {
    "pos": np.array([0, 1, 2, 3]),  # position indices
    "i": 5,  # dimension index
    "d_model": 512,  # model dimension
}
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 1, dtype family float, shape (4,) — shape (4,) 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
predict Ran
ran on a synthesized input
salu133445/arranger/arranger/closest/infer.py
code served (permissive licence) · get_code("6ad16c2da171c819")
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 1, dtype family int, shape (4,) 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

# Analyze the function signature and body:
# - notes: 2D numpy array with shape (n_notes, 3) where each row is [time, pitch, duration]
# - onsets: list where each element is either None or an index into notes (or None)
# - n_tracks: integer, number of tracks
# - states: boolean flag

# Create small test data
notes = np.array([
    [0.0, 60, 1.0],   # note 0: time=0, pitch=60, duration=1
    [0.0, 64, 1.0],   # note 1: time=0, pitch=64, duration=1
    [1.0, 67, 1.0],   # note 2: time=1, pitch=67, duration=1
    [2.0, 72, 1.0],   # note 3: time=2, pitch=72, duration=1
], dtype=np.float32)

# onsets should be a list where each index corresponds to a track
# and contains either None or an index into notes array
onsets = [0, 1, None]  # 3 onsets for 3 tracks

n_tracks = 3

states = True

ARGS = {
    "notes": notes,
    "onsets": onsets,
    "n_tracks": n_tracks,
    "states": states,
}
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 1, dtype family int, shape (4,) — shape (4,) 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
scaled_dot_product_attention Ran
ran, honoured the contract we drafted
salu133445/arranger/arranger/transformer/model.py
code served (permissive licence) · get_code("cec70fbe641ff7aa")
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 tuple. 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 tensorflow as tf

# Set random seed for reproducibility
tf.random.set_seed(0)

# Define small tensors for scaled dot product attention
batch_size = 2
seq_len_q = 3
seq_len_k = 4
seq_len_v = 4
depth = 5
depth_v = 6

# Create query, key, value tensors with appropriate shapes
q = tf.random.normal((batch_size, seq_len_q, depth))
k = tf.random.normal((batch_size, seq_len_k, depth))
v = tf.random.normal((batch_size, seq_len_v, depth_v))

# Create a mask tensor with shape broadcastable to (..., seq_len_q, seq_len_k)
# Using a simple attention mask (can be padding mask or causal mask)
mask = tf.zeros((batch_size, seq_len_q, seq_len_k))

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
to_pianoroll Ran
ran on a synthesized input
salu133445/arranger/arranger/utils.py
code served (permissive licence) · get_code("16bbb7326cf757ef")
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 3, dtype family int, shape (7, 5, 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

class MockMusic:
    """Mock music object that has to_pypianoroll method."""
    def __init__(self, num_tracks):
        self.num_tracks = num_tracks
    
    def __len__(self):
        return self.num_tracks
    
    def to_pypianoroll(self):
        """Return a mock multitrack object."""
        return MockMultitrack(self.num_tracks)

class MockMultitrack:
    """Mock multitrack object with stack method."""
    def __init__(self, num_tracks):
        self.num_tracks = num_tracks
        # Create a stacked array: (num_tracks, time_steps, num_pitches)
        # Using distinct dimensions: 2 tracks, 5 time steps, 7 pitches
        self._data = np.random.randint(0, 2, size=(2, 5, 7), dtype=np.uint8)
    
    def stack(self):
        """Return the stacked pianoroll array."""
        return self._data

# Create mock music object with 2 tracks
music = MockMusic(num_tracks=2)

# Create colors array with RGB values for each track (2 tracks, 3 color channels)
colors = np.array([
    [255, 0, 0],      # Red for track 0
    [0, 255, 0]       # Green for track 1
], dtype=np.uint8)

ARGS = {
    "music": music,
    "colors": colors
}
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 3, dtype family int, shape (7, 5, 3) — shape (7, 5, 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
compute_score Not yet run
unverified (harvested, no recorded run)
salu133445/arranger/arranger/common/learn.py
code served (permissive licence) · get_code("d8ee12ccc51e2e70")
How it ran

no invocation recorded.

positional_encoding Not yet run
unverified (harvested, no recorded run)
salu133445/arranger/arranger/lstm/model.py
code served (permissive licence) · get_code("cf935caad271a818")
How it ran

no invocation recorded.

save_sample Not yet run
unverified (harvested, no recorded run)
salu133445/arranger/arranger/utils.py
code served (permissive licence) · get_code("cdaf0d084ef79ee6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 6 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.

FunctionAlso present inEarliest-datedOthers named
get_angles 14 other papers
7 dated earlier, 7 later · 2 only as an assembly brick
1704.04368 (2017-04)
Get To The Point: Summarization with Pointer-Generator Networks
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 11 more not named here
scaled_dot_product_attention 4 other papers
3 dated earlier, 1 later · 1 only as an assembly brick
1704.04368 (2017-04)
Get To The Point: Summarization with Pointer-Generator Networks
1706.03762 (2017-06)
Attention Is All You Need
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 1 more not named here

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

Modern keyboards allow a musician to play multiple instruments at the same time by assigning zones -- fixed pitch ranges of the keyboard -- to different instruments. In this paper, we aim to further extend this idea and examine the feasibility of automatic instrumentation -- dynamically assigning instruments to notes in solo music during performance. In addition to the online, real-time-capable setting for performative use cases, automatic instrumentation can also find applications in assistive composing tools in an offline setting. Due to the lack of paired data of original solo music and their full arrangements, we approach automatic instrumentation by learning to separate parts (e.g., voices, instruments and tracks) from their mixture in symbolic multitrack music, assuming that the mixture is to be played on a keyboard. We frame the task of part separation as a sequential multi-class classification problem and adopt machine learning to map sequences of notes into sequences of part labels. To examine the effectiveness of our proposed models, we conduct a comprehensive empirical evaluation over four diverse datasets of different genres and ensembles -- Bach chorales, string quartets, game music and pop music. Our experiments show that the proposed models outperform various baselines. We also demonstrate the potential for our proposed models to produce alternative convincing instrumentations for an existing arrangement by separating its mixture into parts. All source code and audio samples can be found at https://salu133445.github.io/arranger/ .

For agents

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

get_harvested_code_for_paper("2107.05916")
get_code_for_paper("2107.05916")
have("2107.05916")

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

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

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

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

Connect an agent — have() is free.