SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.08380 · 2021

Video Background Music Generation with Controllable Music Transformer

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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 7 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2111.08380.json · badge: /api/ran/2111.08380.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
wzk1015/video-bgm-generation canonical (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
FunctionStatusWhere it lives
cal_matchness Ran
ran on a synthesized input
wzk1015/video-bgm-generation/src/match.py
code served (permissive licence) · get_code("c29417ebd3678088")
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 float64, ndim 0, 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 numpy as np

# Construct midi_npz: a sequence of words
# Based on the code, we need:
# - Bar words: len=10 with word[0]==1, word[1]==17, or len=6 with word[0]==17
# - Beat words: len=10 with word[0]==1, 0<word[1]<17, or len=6 with 0<word[0]<17
# Each bar word should be followed by up to 16 beat words

midi_npz = []

# First bar (using 10-length format)
bar_word_1 = np.array([1, 17, 2, 0, 0, 0, 0, 0, 0, 0])  # density = bar_word[2] - 1 = 1
midi_npz.append(bar_word_1)

# Add beat words for first bar (using 10-length format)
# beat_word = [1, tick+1, ..., strength, ...]
# strength at index 6, tick extracted as beat_word[1] - 1
for tick in range(4):
    beat_word = np.array([1, tick + 1, 0, 0, 0, 0, 5, 0, 0, 0])  # strength=5 at index 6
    midi_npz.append(beat_word)

# Second bar (using 10-length format)
bar_word_2 = np.array([1, 17, 3, 0, 0, 0, 0, 0, 0, 0])  # density = 2
midi_npz.append(bar_word_2)

# Add beat words for second bar
for tick in range(3):
    beat_word = np.array([1, tick + 6, 0, 0, 0, 0, 3, 0, 0, 0])  # strength=3
    midi_npz.append(beat_word)

# Convert to list of numpy arrays
midi_npz = [np.array(w) for w in midi_npz]

# Construct v_density and v_strength arrays
# v_density shape: (n_bars,)
# v_strength shape: (n_bars, 16)
n_bars = 3
v_density = np.array([1.0, 2.0, 1.5])  # shape (3,)
v_strength = np.zeros((3, 16))
# Set some non-zero values to match beat structure
v_strength[0, 0:4] = 1.0  # first 4 beats have strength
v_strength[1, 0:3] = 1.0  # first 3 beats have strength
v_strength[2, 0:2] = 1.0  # first 2 beats have strength

ARGS = {
    "midi_npz": midi_npz,
    "v_density": v_density,
    "v_strength": v_strength,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
nucleus Ran
ran on a synthesized input
wzk1015/video-bgm-generation/src/model.py
code served (permissive licence) · get_code("8f4c0fe611a5fe75")
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 int64, ndim 0, dtype family int, shape () 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

np.random.seed(0)

# The function nucleus takes:
# - probs: a numpy array of probabilities
# - p: a float representing the nucleus probability threshold

# Create a small probability array
probs = np.array([0.1, 0.2, 0.3, 0.25, 0.15], dtype=np.float32)

# Create a nucleus threshold (typical value between 0 and 1)
p = 0.9

ARGS = {
    "probs": probs,
    "p": p
}
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 int64, ndim 0, dtype family int, shape () — shape () 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
resize_video Ran
ran on a synthesized input
wzk1015/video-bgm-generation/src/video2npz/resize_video.py
code served (permissive licence) · get_code("24207c3c9d70fcf8")
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 str. 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 os
import tempfile

# Create temporary directories for testing
temp_dir = tempfile.mkdtemp()
in_dir = os.path.join(temp_dir, 'video')
out_dir = os.path.join(temp_dir, 'video_360p')
os.makedirs(in_dir, exist_ok=True)
os.makedirs(out_dir, exist_ok=True)

# Create a dummy video file (just an empty file for testing purposes)
video_name = 'test_video.mp4'
dummy_video_path = os.path.join(in_dir, video_name)
with open(dummy_video_path, 'w') as f:
    f.write('')

ARGS = {
    'video_name': 'test_video.mp4',
    'in_dir': in_dir,
    'out_dir': out_dir,
    'max_height': 360
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
softmax_with_temperature Ran
ran on a synthesized input
wzk1015/video-bgm-generation/src/model.py
code served (permissive licence) · get_code("7628e5077aee38fb")
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

# Construct valid arguments for softmax_with_temperature
# The function takes logits (numpy array) and temperature (float)

logits = np.array([1.0, 2.0, 3.0, 4.0])
temperature = 0.5

ARGS = {
    "logits": logits,
    "temperature": temperature
}
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
softmax_with_temperature Ran
ran on a synthesized input
wzk1015/video-bgm-generation/src/utils.py
code served (permissive licence) · get_code("166d227c4c912a25")
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

# Construct valid arguments for softmax_with_temperature
logits = np.array([1.0, 2.0, 3.0, 4.0])
temperature = 0.5

ARGS = {
    "logits": logits,
    "temperature": temperature,
}
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
weighted_sampling Ran
ran on a synthesized input
wzk1015/video-bgm-generation/src/model.py
code served (permissive licence) · get_code("74555f5d0871cdec")
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 int64, ndim 0, dtype family int, shape () 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

# The function weighted_sampling takes a single parameter 'probs'
# which should be a numpy array of probabilities.
# The function:
# 1. Normalizes the probabilities by dividing by their sum
# 2. Sorts them in descending order
# 3. Uses np.random.choice with the sorted indices and probabilities
# 4. Returns a single index

# Create a small numpy array of probabilities
probs = np.array([0.1, 0.3, 0.4, 0.2])

ARGS = {
    "probs": probs
}
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 int64, ndim 0, dtype family int, shape () — shape () 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
weighted_sampling Ran
ran on a synthesized input
wzk1015/video-bgm-generation/src/utils.py
code served (permissive licence) · get_code("a826b4cfbc9c2170")
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 int64, ndim 0, dtype family int, shape () 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

# The function weighted_sampling takes a single parameter 'probs' which should be
# a numpy array of probabilities. The function:
# 1. Normalizes probs by dividing by sum
# 2. Sorts the probabilities in descending order
# 3. Gets the sorted indices
# 4. Uses np.random.choice with the sorted indices and sorted probabilities
# 5. Returns a single element

# Create a small probability array
probs = np.array([0.1, 0.3, 0.4, 0.2])

ARGS = {
    "probs": probs
}
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 int64, ndim 0, dtype family int, shape () — shape () 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 7 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-23.

Repositories linked to this paper

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

Abstract

In this work, we address the task of video background music generation. Some previous works achieve effective music generation but are unable to generate melodious music tailored to a particular video, and none of them considers the video-music rhythmic consistency. To generate the background music that matches the given video, we first establish the rhythmic relations between video and background music. In particular, we connect timing, motion speed, and motion saliency from video with beat, simu-note density, and simu-note strength from music, respectively. We then propose CMT, a Controllable Music Transformer that enables local control of the aforementioned rhythmic features and global control of the music genre and instruments. Objective and subjective evaluations show that the generated background music has achieved satisfactory compatibility with the input videos, and at the same time, impressive music quality. Code and models are available at https://github.com/wzk1015/video-bgm-generation.

For agents

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

get_harvested_code_for_paper("2111.08380")
get_code_for_paper("2111.08380")
have("2111.08380")

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

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

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

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

Connect an agent — have() is free.