asigalov61 commited on
Commit
a73b76e
1 Parent(s): a462022

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -90,22 +90,24 @@ def GenerateMIDI(progress=gr.Progress()):
90
  channel = 0
91
 
92
  for ss in song:
 
 
93
 
94
- if ss > 0 and ss < 256:
95
-
96
- time += ss * 8
97
-
98
- if ss >= 256 and ss < 1280:
99
-
100
- dur = ((ss-256) // 8) * 32
101
- vel = (((ss-256) % 8)+1) * 15
102
-
103
- if ss >= 1280 and ss < 2816:
104
- channel = (ss-1280) // 128
105
- pitch = (ss-1280) % 128
106
-
107
  song_f.append(['note', int(time), int(dur), int(channel), int(pitch), int(vel) ])
108
-
109
  output_signature = 'Allegro Music Transformer'
110
  output_file_name = 'Allegro-Music-Transformer-Music-Composition'
111
  track_name='Project Los Angeles'
 
90
  channel = 0
91
 
92
  for ss in song:
93
+
94
+ ss1 = int(ss)
95
 
96
+ if ss1 > 0 and ss1 < 256:
97
+
98
+ time += ss1 * 8
99
+
100
+ if ss1 >= 256 and ss1 < 1280:
101
+
102
+ dur = ((ss1-256) // 8) * 32
103
+ vel = (((ss1-256) % 8)+1) * 15
104
+
105
+ if ss1 >= 1280 and ss1 < 2816:
106
+ channel = (ss1-1280) // 128
107
+ pitch = (ss1-1280) % 128
108
+
109
  song_f.append(['note', int(time), int(dur), int(channel), int(pitch), int(vel) ])
110
+
111
  output_signature = 'Allegro Music Transformer'
112
  output_file_name = 'Allegro-Music-Transformer-Music-Composition'
113
  track_name='Project Los Angeles'