floriangardin commited on
Commit
b23da08
1 Parent(s): 51b4b9b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +43 -0
README.md CHANGED
@@ -1,3 +1,46 @@
1
  ---
2
  license: bsd-3-clause
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: bsd-3-clause
3
  ---
4
+
5
+ Musiclang LLM
6
+ --------------
7
+
8
+ Check https://github.com/MusicLang/musiclang to use this model in your musical compositions
9
+
10
+ MusicLang LLM is a language model based on top of the musiclang symbolic tonal music language. Is is used to predict new music from an existing score.
11
+
12
+ How to use
13
+ ----------
14
+
15
+ Install musiclang package in python :
16
+
17
+ ```
18
+ pip install musiclang
19
+ ```
20
+
21
+ Predict some music from a given prompt written with musiclang :
22
+
23
+ ```python
24
+ from musiclang.library import *
25
+ from musiclang import Score
26
+
27
+ # Some random bar of chopin op18 Waltz
28
+ score = ((V % III.b.M)(
29
+ piano__0=s0 + s2.e.mp + s3.e.mp,
30
+ piano__4=s0.e.o(-2).p + r.e + s0.ed.o(-1).mp + r.s,
31
+ piano__5=r + s4.ed.o(-1).mp + r.s,
32
+ piano__6=r + s6.ed.o(-1).mp + r.s)+
33
+ (V['7'] % III.b.M)(
34
+ piano__0=s2.ed.mp + r.s,
35
+ piano__2=s4.ed.mp + r.s,
36
+ piano__4=s6.ed.o(-1).mp + r.s,
37
+ piano__5=s0.ed.o(-1).mp + r.s,
38
+ piano__6=s4.ed.o(-1).mp + r.s))
39
+
40
+ # Predict a continuation of the score using huggingface musiclang model
41
+ predicted_score = score.predict_score()
42
+ # Save it to midi
43
+ predicted_score.to_midi('test.mid')
44
+ ```
45
+
46
+