asigalov61 commited on
Commit
d0031d1
1 Parent(s): f4837f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -29,15 +29,15 @@ def pitches_counts(melody_score):
29
  pcounts = []
30
 
31
  count = 0
32
- pp = -1
33
 
34
  for p in pitches:
35
  if p == pp:
36
- count += 1
37
  pcounts.append(count)
 
38
  else:
39
  count = 0
40
- pcounts.append(count)
41
  pp = p
42
 
43
  return pcounts
@@ -202,7 +202,7 @@ def MixMelody(input_midi, input_find_best_match, input_adjust_melody_notes_durat
202
  mixed_song = []
203
 
204
  midx = 0
205
- next_note_dtime = 511
206
 
207
  for i, c in enumerate(cscore):
208
  cho = copy.deepcopy(c)
 
29
  pcounts = []
30
 
31
  count = 0
32
+ pp = pitches[0]
33
 
34
  for p in pitches:
35
  if p == pp:
 
36
  pcounts.append(count)
37
+ count += 1
38
  else:
39
  count = 0
40
+ pcounts.append(p)
41
  pp = p
42
 
43
  return pcounts
 
202
  mixed_song = []
203
 
204
  midx = 0
205
+ next_note_dtime = 255
206
 
207
  for i, c in enumerate(cscore):
208
  cho = copy.deepcopy(c)