asigalov61 commited on
Commit
c5f1657
·
verified ·
1 Parent(s): fcc4900

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +139 -7
README.md CHANGED
@@ -15,8 +15,9 @@ tags:
15
  ---
16
 
17
  # Monster Piano Transformer
 
18
 
19
- ![Monster-Piano-Logo.jpg](https://cdn-uploads.huggingface.co/production/uploads/5f57ea2d3f32f12a3c0692e6/YfcZDnWjtbFKr4bm0GJ0x.jpeg)
20
 
21
  ***
22
 
@@ -49,17 +50,148 @@ And in its rhythm, our spirits glow.
49
 
50
  ***
51
 
52
- ## Models info
53
 
54
- ### Model with velcoity
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
- * ...
 
57
 
58
- ### Model without velocity
 
59
 
60
- * ...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  ***
63
 
64
  ### Project Los Angeles
65
- ### Tegridy Code 2024
 
15
  ---
16
 
17
  # Monster Piano Transformer
18
+ ## Ultra-fast and very well fitted solo Piano music transformer
19
 
20
+ ![Monster-Piano-Logo](https://github.com/user-attachments/assets/89c755b7-6fd3-45ba-93da-e8c3dd07f129)
21
 
22
  ***
23
 
 
50
 
51
  ***
52
 
53
+ ## Install
54
 
55
+ ```sh
56
+ pip install monsterpianotransformer
57
+ ```
58
+
59
+ #### (Optional) [FluidSynth](https://github.com/FluidSynth/fluidsynth/wiki/Download) for MIDI to Audio functinality
60
+
61
+ ##### Ubuntu or Debian
62
+
63
+ ```sh
64
+ sudo apt-get install fluidsynth
65
+ ```
66
+
67
+ ##### Windows (with [Chocolatey](https://github.com/chocolatey/choco))
68
+
69
+ ```sh
70
+ choco install fluidsynth
71
+ ```
72
+
73
+ ***
74
+
75
+ ## Quick-start use example
76
+
77
+ ```python
78
+ # Import Monster Piano Transformer as mpt
79
+ import monsterpianotransformer as mpt
80
+
81
+ # Load desired Monster Piano Transformer model
82
+ # There are several to choose from...
83
+ model = mpt.load_model()
84
+
85
+ # Get sample seed MIDI path
86
+ sample_midi_path = mpt.get_sample_midi_files()[6][1]
87
+
88
+ # Load seed MIDI
89
+ input_tokens = mpt.midi_to_tokens(sample_midi_path, model_with_velocity=False)
90
+
91
+ # Generate seed MIDI continuation
92
+ output_tokens = mpt.generate(model, input_tokens, 600, return_prime=True)
93
+
94
+ # Save output batch 0 to MIDI
95
+ mpt.tokens_to_midi(output_tokens[0], model_with_velocity=False)
96
+ ```
97
+
98
+ ***
99
+
100
+ ## Main features use examples
101
+
102
+ ### Long auto-continuation generation
103
+
104
+ ```python
105
+ # Import Monster Piano Transformer as mpt
106
+ import monsterpianotransformer as mpt
107
+
108
+ # Load desired Monster Piano Transformer model
109
+ # There are several to choose from...
110
+ model = mpt.load_model()
111
+
112
+ # Get sample seed MIDI path
113
+ sample_midi_path = mpt.get_sample_midi_files()[6][1]
114
 
115
+ # Load seed MIDI
116
+ input_tokens = mpt.midi_to_tokens(sample_midi_path, model_with_velocity=False)
117
 
118
+ # Generate long seed MIDI auto-continuation
119
+ output_tokens = mpt.generate_long(model, input_tokens, return_prime=True)
120
 
121
+ # Save output batch 0 to MIDI
122
+ mpt.tokens_to_midi(output_tokens[0], model_with_velocity=False)
123
+ ```
124
+
125
+ ### Pitches inpainting
126
+
127
+ ```python
128
+ # Import Monster Piano Transformer as mpt
129
+ import monsterpianotransformer as mpt
130
+
131
+ # Load desired Monster Piano Transformer model
132
+ # There are several to choose from...
133
+ model = mpt.load_model()
134
+
135
+ # Get sample seed MIDI path
136
+ sample_midi_path = mpt.get_sample_midi_files()[6][1]
137
+
138
+ # Load seed MIDI
139
+ input_tokens = mpt.midi_to_tokens(sample_midi_path, model_with_velocity=False)
140
+
141
+ # Inpaint pitches
142
+ output_tokens = mpt.inpaint_pitches(model, input_tokens)
143
+
144
+ # Save output to MIDI
145
+ mpt.tokens_to_midi(output_tokens, model_with_velocity=False)
146
+ ```
147
+
148
+ ### Simple velocities inpainting
149
+
150
+ ```python
151
+ # Import Monster Piano Transformer as mpt
152
+ import monsterpianotransformer as mpt
153
+
154
+ # Load desired Monster Piano Transformer model
155
+ # There are several to choose from...
156
+ model = mpt.load_model(model_name='with velocity - 3 epochs')
157
+
158
+ # Get sample seed MIDI path
159
+ sample_midi_path = mpt.get_sample_midi_files()[6][1]
160
+
161
+ # Load seed MIDI
162
+ input_tokens = mpt.midi_to_tokens(sample_midi_path, model_with_velocity=True)
163
+
164
+ # Inpaint velocities
165
+ output_tokens = mpt.inpaint_velocities_simple(model, input_tokens)
166
+
167
+ # Save output to MIDI
168
+ mpt.tokens_to_midi(output_tokens, model_with_velocity=True)
169
+ ```
170
+
171
+ ### Seq2Seq velocities inpainting
172
+
173
+ ```python
174
+ # Import Monster Piano Transformer as mpt
175
+ import monsterpianotransformer as mpt
176
+
177
+ # Load desired Monster Piano Transformer model
178
+ # There are several to choose from...
179
+ model = mpt.load_model(model_name='velocity inpainting - 3 epochs')
180
+
181
+ # Get sample seed MIDI path
182
+ sample_midi_path = mpt.get_sample_midi_files()[6][1]
183
+
184
+ # Load seed MIDI
185
+ input_tokens = mpt.midi_to_tokens(sample_midi_path, model_with_velocity=True)
186
+
187
+ # Inpaint velocities
188
+ output_tokens = mpt.inpaint_velocities_seq2seq(model, input_tokens, verbose=True)
189
+
190
+ # Save output to MIDI
191
+ mpt.tokens_to_midi(output_tokens, model_with_velocity=True)
192
+ ```
193
 
194
  ***
195
 
196
  ### Project Los Angeles
197
+ ### Tegridy Code 2025