MORTM is a Transformer-based model designed for melody generation, with a strong emphasis on metric (rhythmic) structure. It represents music as sequences of pitch, duration, and relative beat positions within a measure (normalized to 96 ticks), making it suitable for time-robust, rhythm-aware music generation tasks.
This modelcard aims to be a base template for new models. It has been generated using
this raw template.
MORTM (Metric-Oriented Rhythmic Transformer for Melodic generation) is a decoder-only Transformer architecture optimized for music generation with rhythmic awareness. It generates melodies measure-by-measure in an autoregressive fashion. The model supports chord-conditional generation and is equipped with the following features:
-
Mixture of Experts (MoE) in the feedforward layers for capacity increase and compute efficiency.
-
ALiBi (Attention with Linear Biases) for relative positional biasing.
-
FlashAttention2 for fast and memory-efficient attention.
-
Relative tick-based tokenization (e.g., [Position, Duration, Pitch]) for metric robustness.
-
Developed by: Koue Okazaki & Takaki Nagoshi
-
Funded by [optional]: Nihon University, Graduate School of Integrated Basic Sciences
-
Shared by [optional]: ProjectMORTM
-
Model type: Transformer (decoder-only with MoE and ALiBi)
-
Language(s) (NLP): N/A (music domain)
-
License: MIT
-
Finetuned from model [optional]: Custom-built from scratch (not fine-tuned from a pretrained LM)
MORTM can generate melodies from scratch or conditionally based on chord progressions. It is ideal for:
As the training dataset is primarily composed of Western tonal music, the model may underperform on:
Generated melodies should be manually reviewed in professional music contexts. Users are encouraged to retrain or fine-tune on representative datasets when applying to culturally specific music.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("nagoshidayo/mortm")
4tokenizer = AutoTokenizer.from_pretrained("nagoshidayo/mortm")