ARG: Automated Rhythm Generation. Let's generate rhythm game maps automatically!
Project description
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.
- RGGRU: RhythmGen with CNN feature extractor and GRU. (
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file automated_rhythm_generation-0.0.1.tar.gz
.
File metadata
- Download URL: automated_rhythm_generation-0.0.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc1742aa0bf32cc69623b93416bcebd5ba25dda9092172f63bd4f00d5852054e |
|
MD5 | 0fa1fc9dff4489299f3d736edb6daec5 |
|
BLAKE2b-256 | f66fdfb98b867d9be6d37ada53d537f7e149637a6124ee1cbcb274e2b4e3aa54 |
File details
Details for the file automated_rhythm_generation-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: automated_rhythm_generation-0.0.1-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b7e94611aa5488a210ac17722d4f79e96ee6f97175dc266dafadcb222d5fb1a |
|
MD5 | a6cb662946359c708e6adb266cf16636 |
|
BLAKE2b-256 | 63b51a39de35d41f78538b7f2fd59a656e8d1a9980c2908952738df0382007a1 |