Update README.md
Browse files
README.md
CHANGED
|
@@ -49,8 +49,8 @@ spec = importlib.util.spec_from_file_location("parse_custom",file_path)
|
|
| 49 |
modul = importlib.util.module_from_spec(spec)
|
| 50 |
spec.loader.exec_module(modul)
|
| 51 |
|
|
|
|
| 52 |
generated_songs=text_formated_midi.split("*")
|
| 53 |
-
generated_songs.pop(0) #remove the first since it is an empty string
|
| 54 |
first_song=generated_songs[0]
|
| 55 |
|
| 56 |
if(len(generated_songs)==1): #remove the last incomplete note of an unfinished melody
|
|
@@ -60,6 +60,7 @@ if(len(generated_songs)==1): #remove the last incomplete note of an unfinished m
|
|
| 60 |
|
| 61 |
events = modul.parse_custom(first_song)
|
| 62 |
modul.build_midi(events, "example.mid")
|
|
|
|
| 63 |
```
|
| 64 |
|
| 65 |
To prompt the model, you can use this code to convert a midi to a string:
|
|
|
|
| 49 |
modul = importlib.util.module_from_spec(spec)
|
| 50 |
spec.loader.exec_module(modul)
|
| 51 |
|
| 52 |
+
text_formated_midi=text_formated_midi.strip("*") #Remove the first star so to not get an empty string
|
| 53 |
generated_songs=text_formated_midi.split("*")
|
|
|
|
| 54 |
first_song=generated_songs[0]
|
| 55 |
|
| 56 |
if(len(generated_songs)==1): #remove the last incomplete note of an unfinished melody
|
|
|
|
| 60 |
|
| 61 |
events = modul.parse_custom(first_song)
|
| 62 |
modul.build_midi(events, "example.mid")
|
| 63 |
+
|
| 64 |
```
|
| 65 |
|
| 66 |
To prompt the model, you can use this code to convert a midi to a string:
|