Update music_generator.py
Browse files- music_generator.py +2 -2
music_generator.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import numpy as np
|
| 2 |
import librosa
|
| 3 |
import soundfile as sf
|
| 4 |
-
from music21 import chord, note, stream,
|
| 5 |
import random
|
| 6 |
import os
|
| 7 |
from music21 import tempo
|
|
@@ -72,7 +72,7 @@ def generate_accompaniment(emotion, sentiment_score, tempo=100, output_path="acc
|
|
| 72 |
s = stream.Stream()
|
| 73 |
|
| 74 |
# Set tempo
|
| 75 |
-
t = tempo.MetronomeMark(number=tempo_value)
|
| 76 |
s.append(t)
|
| 77 |
|
| 78 |
# Set instrument based on emotion
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import librosa
|
| 3 |
import soundfile as sf
|
| 4 |
+
from music21 import chord, note, stream, instrument
|
| 5 |
import random
|
| 6 |
import os
|
| 7 |
from music21 import tempo
|
|
|
|
| 72 |
s = stream.Stream()
|
| 73 |
|
| 74 |
# Set tempo
|
| 75 |
+
t = music21.tempo.MetronomeMark(number=tempo_value)
|
| 76 |
s.append(t)
|
| 77 |
|
| 78 |
# Set instrument based on emotion
|