asigalov61 commited on
Commit
96122eb
1 Parent(s): 9363e59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -140,12 +140,16 @@ def GenerateMIDI(progress=gr.Progress()):
140
  f.write(midi_data)
141
 
142
  output1 = []
143
-
144
- for o in TMIDIX.score2opus(output):
145
- if o[0] == 'note':
146
- output1.append(o)
 
 
 
 
147
 
148
- audio = synthesis(output1), 'SGM-v2.01-YamahaGrand-Guit-Bass-v2.7.sf2')
149
 
150
  yield output1, "Allegro-Music-Transformer-Music-Composition.mid", (44100, audio)
151
 
 
140
  f.write(midi_data)
141
 
142
  output1 = []
143
+ itrack = 1
144
+
145
+ opus = TMIDIX.score2opus(output):
146
+
147
+ while itrack < len(opus):
148
+ for event in opus[itrack]:
149
+ if event[0] == 'note':
150
+ output1.append(o)
151
 
152
+ audio = synthesis(output1, 'SGM-v2.01-YamahaGrand-Guit-Bass-v2.7.sf2')
153
 
154
  yield output1, "Allegro-Music-Transformer-Music-Composition.mid", (44100, audio)
155