Skip to main content

Automated Rhythm Generation

ARG: Automated Rhythm Generation.

Let's generate rhythm game maps automatically!

Features

Neural Networks

  • RhythmGen: Generate rhythm sequence from music piece.
    • RGGRU: RhythmGen with CNN feature extractor and GRU. (460K)
    • RGGRUAT: RhythmGen with CNN feature extractor, GRU, and multi-head attention. (720K)
    • RGTR: RhythmGen with CNN feature extractor and Transformer. (15M)
    • RGRoFormer: RhythmGen with CNN feature extractor, Transformer and RoPE. (420K)
    • Others: RhythmGen with other architectures.
  • RhythmRec: Reconstruct music piece from rhythm sequence.
    • No, we didn't implement this yet.

Utils

  • RhythmAnnotation (ryan): Rhythm annotation tool and format. See ryan for more details.

Installation

pip install automated-rhythm-generation

Training

from arg import Trainer

trainer = Trainer(
    "RGGRU", # Model architecture
    "JacobLinCool/taiko-2023-1.1", # Dataset
    difficulty="hard",
    num_epochs=300,
    learning_rate=0.001,
    batch_size=32,
    max_length=10.0,
)

trainer.train(
    push="JacobLinCool/RhythmGenGRU-1-hard",
    hf_token=HF_TOKEN,
)

Or you can use the command line interface:

python -m arg.train RGGRU JacobLinCool/taiko-2023-1.1 --difficulty hard --push JacobLinCool/RhythmGenGRU-1-hard

Inference

from arg import RGGRU, generate_tja
import librosa

model = RGGRU.from_pretrained("JacobLinCool/RhythmGenGRU-1-hard")

audio, sr = librosa.load("path/to/music.mp3", sr=16000)
seq = model.predict(audio)
tja = generate_tja(seq)

with open("path/to/output.tja", "w") as f:
    f.write(tja)

Or you can use the command line interface:

python -m arg.infer RGGRU JacobLinCool/RhythmGenGRU-1-hard path/to/music.mp3

Others

To see the model architecture: python -m arg.model.RGGRU, python -m arg.model.RGRoFormer, etc.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

automated_rhythm_generation-0.0.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

automated_rhythm_generation-0.0.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file automated_rhythm_generation-0.0.1.tar.gz.

File metadata

File hashes

Hashes for automated_rhythm_generation-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dc1742aa0bf32cc69623b93416bcebd5ba25dda9092172f63bd4f00d5852054e
MD5 0fa1fc9dff4489299f3d736edb6daec5
BLAKE2b-256 f66fdfb98b867d9be6d37ada53d537f7e149637a6124ee1cbcb274e2b4e3aa54

See more details on using hashes here.

File details

Details for the file automated_rhythm_generation-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for automated_rhythm_generation-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b7e94611aa5488a210ac17722d4f79e96ee6f97175dc266dafadcb222d5fb1a
MD5 a6cb662946359c708e6adb266cf16636
BLAKE2b-256 63b51a39de35d41f78538b7f2fd59a656e8d1a9980c2908952738df0382007a1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 files

0.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page