Spaces:
Runtime error
Runtime error
Add minor progression.
Browse files
app.py
CHANGED
|
@@ -65,9 +65,10 @@ def sonify_text(text, sentiment):
|
|
| 65 |
p = music21.stream.Part()
|
| 66 |
if sentiment == 'NEGATIVE':
|
| 67 |
# If negative, use TODO
|
| 68 |
-
p.append(music21.chord.Chord('C4 E4
|
| 69 |
-
p.append(music21.chord.Chord('
|
| 70 |
-
p.append(music21.chord.Chord('
|
|
|
|
| 71 |
else:
|
| 72 |
# If positive, use a partial progression I-V-vi in C Major.
|
| 73 |
p.append(music21.chord.Chord('C4 E4 G4', type='half')) # I
|
|
@@ -98,7 +99,7 @@ def process_midi(MIDI_File, Text_to_Sonify, Randomness, Amount_of_Music_to_Add):
|
|
| 98 |
|
| 99 |
# create the model input object
|
| 100 |
if sonification:
|
| 101 |
-
sentiment = '
|
| 102 |
item = sonify_text(Text_to_Sonify, sentiment)
|
| 103 |
else:
|
| 104 |
item = MusicItem.from_file(name, data.vocab)
|
|
|
|
| 65 |
p = music21.stream.Part()
|
| 66 |
if sentiment == 'NEGATIVE':
|
| 67 |
# If negative, use TODO
|
| 68 |
+
p.append(music21.chord.Chord('A3 C4 E4', type='half')) # i
|
| 69 |
+
p.append(music21.chord.Chord('F3 A4 C4', type='half')) # VI
|
| 70 |
+
p.append(music21.chord.Chord('C3 E3 G3', type='half')) # III
|
| 71 |
+
p.append(music21.chord.Chord('G3 B3 D4', type='half')) # VII
|
| 72 |
else:
|
| 73 |
# If positive, use a partial progression I-V-vi in C Major.
|
| 74 |
p.append(music21.chord.Chord('C4 E4 G4', type='half')) # I
|
|
|
|
| 99 |
|
| 100 |
# create the model input object
|
| 101 |
if sonification:
|
| 102 |
+
sentiment = 'NEGATIVE'
|
| 103 |
item = sonify_text(Text_to_Sonify, sentiment)
|
| 104 |
else:
|
| 105 |
item = MusicItem.from_file(name, data.vocab)
|