Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c43cef2
adding debug code + docs changes
helloWorld199 Nov 21, 2024
e3e6ad1
Save changes before rebasing
helloWorld199 Dec 13, 2024
83504ec
small changes in inference code
helloWorld199 Jan 24, 2025
9eea777
lil fixes
helloWorld199 Feb 23, 2025
8fcf565
clean test procedure
Feb 23, 2025
744c20e
fixes + name refactor
helloWorld199 Feb 24, 2025
31aefbd
fixes
Feb 24, 2025
8ae8b33
added infilling tests at end of the MIDI file
helloWorld199 Feb 28, 2025
780086f
fixed training strategy, new generation code, lint fixes
helloWorld199 Mar 12, 2025
1bea1e3
generation fixes
helloWorld199 Mar 18, 2025
d372f41
changing dataset path
helloWorld199 Mar 18, 2025
9c7eb2f
adding tokenizer without BPE
helloWorld199 Mar 18, 2025
0982d68
Update README.md
helloWorld199 Mar 18, 2025
5a8753f
Update README.md
helloWorld199 Mar 18, 2025
0871697
fixed preprocessing in _tokenize_score
helloWorld199 Mar 24, 2025
426761b
Merge branch 'main' into expressive
DaoTwenty Mar 26, 2025
cfac2b6
expressive MMM with REAPER
DaoTwenty Mar 26, 2025
c39cdd9
install correct MidiTok
DaoTwenty Mar 26, 2025
13c5623
train tok working
DaoTwenty Mar 26, 2025
4d10b03
training for expressive
DaoTwenty Mar 26, 2025
d350d25
baseline for expressive loops
DaoTwenty Mar 27, 2025
4b55661
Merge branch 'expressive' into expressive-loops
DaoTwenty Mar 27, 2025
7fab976
train with loops
DaoTwenty Apr 3, 2025
98b25f9
training and inference for loops
DaoTwenty Apr 3, 2025
04743f8
train tokenizer multiple tok model choice
DaoTwenty Apr 3, 2025
4578ea8
Merge branch 'expressive' of https://github.com/DaoTwenty/MMM into ex…
DaoTwenty Apr 3, 2025
9f9f0ef
new V2 dataset
DaoTwenty Apr 4, 2025
b19b717
training almost working
DaoTwenty Apr 4, 2025
6193a56
training works on cedar
DaoTwenty Apr 8, 2025
96cbb9a
eval steps to config
DaoTwenty Apr 9, 2025
4b46f8c
narval scripts
DaoTwenty Apr 9, 2025
db2b6d0
fixed loops and microtiming data loading errors
DaoTwenty Apr 23, 2025
84748bc
MMM for loop generation
DaoTwenty May 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
/docs/public
/tests/test_real_time/
/tests/tests_output
/models
.MMM/
runs/models
.idea
__pycache__
**/__pycache__
/.MMM
/debug
/tests/output
/tests/test_midis

logs/*
CCLOG/*
models/*
runs/*
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ python scripts/train_tokenizer.py
python scripts/train_model.py
```

## Pretrained model for inference
Download the model here:
https://drive.google.com/file/d/1Up6OxUANSUcBipPz_V9hLj6EiFTPCmiO/view?usp=sharing

Use generate.py to generate samples using the mentioned model.

## Data preprocessing

1. Filter non-valid files: corrupted or less than 8 bars;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Generate
# Instantiate the tokenizer
MMM(params="/path/to/tokenizer.json")

output_scores = generate(
output_scores, metadata = generate(
model,
tokenizer,
inference_config,
Expand Down
13 changes: 12 additions & 1 deletion docs/training.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,19 @@ The only thing needed is to use the provided :class:`mmm.DatasetMMM` dataset cla
1. Loads the music file;
2. Shuffles the order of the tracks, and randomly keeps a certain number of tracks (``ratio_random_tracks_range``);
3. Performs data augmentation by randomly shifting the pitches, velocities and duration values;
Currently:
+- 6 pitch offset;

+- 2 Velocity offset;

0 duration offset;
4. Select randomly whether to perform bar infilling or to generate a new track (``bar_fill_ratio``);
5. Reduce the sequence length so that it does not exceed the limit (``max_seq_len``);
Currently, bar_fill_ratio = 0.75
5. If infilling, select a number of bars to infillin equal to (``tot_bars * n_bars_infilling_ratio``)
where ``n_bars_infilling_ratio`` is random from 0.1 to 0.4
6. Randomly select a set of attribute controls which are going to be computed on a random subset of the bars to be infilled (if infilling).
7. Reduce the sequence length so that it does not exceed the limit (``max_seq_len``)
where ``max_seq_len`` = 2048
6. If bar infilling: randomly selects the portion supposed to be infilled and move the associated tokens at the end of the sequence for the model to learn;

The DatasetMMM object
Expand Down
6 changes: 3 additions & 3 deletions mmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from .config import InferenceConfig
from .data_loading import DatasetMMM
from .inference import generate
from .logits_processor import StopLogitsProcessor
from .inference import generate, generate_batch
from .logits_processor import InfillLogitsProcessor, TrackLogitsProcessor

__all__ = ["DatasetMMM", "generate", "InferenceConfig", "StopLogitsProcessor"]
__all__ = ["DatasetMMM", "generate", "generate_batch", "InferenceConfig", "InfillLogitsProcessor", "TrackLogitsProcessor"]
4 changes: 2 additions & 2 deletions mmm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class InferenceConfig:
the new tracks
"""

bars_to_generate: dict[int, list[tuple[int, int, list[str]]]] | None = None
new_tracks: list[tuple[int, list[str]]] | None = None
context_length: int = 4
bars_to_generate: dict[int, list[tuple[int, int, list[str], str]]] | None = None
new_tracks: list[tuple[int, list[str]]] | None = None
autoregressive: bool = False
infilling: bool = False

Expand Down
Loading