File size: 3,863 Bytes
a966ca1
 
14c010e
 
 
a966ca1
14c010e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e17e031
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14c010e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
license: mit
tags:
- audiocraft
- Musicgen
---

# micro-musicgen-jungle

Curated and trained by Aaron Abebe. 

![image/webp](https://cdn-uploads.huggingface.co/production/uploads/65829a887cec0a2080d4bb3f/mbtvUtbIUbZJ8DbxtIPUo.webp)

> [!WARNING]  
> WARNING: **These models WILL sound bad to a lot of people.** The goal is not create pleasant sounding music,
> but to spark creativity by using the weird sounds of Neural Codecs for music production and sampling!
 
Micro-Musicgen is a new family of super small music generation models focussing on experimental music and latent space exploration capabilities. 
These models have unique abilities and drawbacks which should enhance creativity when working with them while creating music. 

- **only unconditional generation**: Trained without text-conditioning to reduce model size.
- **very fast generation times**: ~8secs for 10x 10sec samples.
- **permissive licensing**: The models are trained from scratch using royalty-free samples and handmade chops,
which allows them to be released via the MIT License.


The first entry in the series is a model trained on chopped jungle drum breaks called `micro-musicgen-jungle`.

If you find this model interesting, please consider:

- following me on [GitHub](https://github.com/aaronabebe)
- following me on [Twitter](https://twitter.com/mcaaroni)

## Samples

All samples are from a single run, without cherry picking. 

<table style="width:100%; text-align:center;">
  <tr>
    <td>
      <audio controls>
        <source src="https://huggingface.co/pharoAIsanders420/micro-musicgen-jungle/resolve/main/assets/output_3.wav?download=true" type="audio/wav">
        Your browser does not support the audio element.
      </audio>
    </td>
    <td>
      <audio controls>
        <source src="https://huggingface.co/pharoAIsanders420/micro-musicgen-jungle/resolve/main/assets/output_2.wav?download=true" type="audio/wav">
        Your browser does not support the audio element.
      </audio>
    </td>
    <td>
      <audio controls>
        <source src="https://huggingface.co/pharoAIsanders420/micro-musicgen-jungle/resolve/main/assets/output_6.wav?download=true" type="audio/wav">
        Your browser does not support the audio element.
      </audio>
    </td>
  </tr>
  <tr>
    <td>
      <audio controls>
        <source src="https://huggingface.co/pharoAIsanders420/micro-musicgen-jungle/resolve/main/assets/output_9.wav?download=true" type="audio/wav">
        Your browser does not support the audio element.
      </audio>
    </td>
    <td>
      <audio controls>
        <source src="https://huggingface.co/pharoAIsanders420/micro-musicgen-jungle/resolve/main/assets/output_7.wav?download=true" type="audio/wav">
        Your browser does not support the audio element.
      </audio>
    </td>
    <td>
      <audio controls>
        <source src="https://huggingface.co/pharoAIsanders420/micro-musicgen-jungle/resolve/main/assets/output_5.wav?download=true" type="audio/wav">
        Your browser does not support the audio element.
      </audio>
    </td>
  </tr>
</table>



## Usage

Install my [audiocraft](https://github.com/facebookresearch/audiocraft) fork:

```
pip install -U git+https://github.com/aaronabebe/audiocraft#egg=audiocraft
```

Then, you should be able to load this model just like any other musicgen checkpoint here on the Hub:

```python
import torchaudio
from audiocraft.models import MusicGen
from audiocraft.data.audio import audio_write
model = MusicGen.get_pretrained('pharoAIsanders420/micro-musicgen-jungle')
model.set_generation_params(duration=10)
wav = model.generate_unconditional(10)

for idx, one_wav in enumerate(wav):
    # Will save under {idx}.wav, with loudness normalization at -14 db LUFS.
    audio_write(f'{idx}', one_wav.cpu(), model.sample_rate, strategy="loudness", loudness_compressor=True)
```