asigalov61
commited on
Commit
•
c91ebe0
1
Parent(s):
f457f4f
Update app.py
Browse files
app.py
CHANGED
@@ -30,12 +30,14 @@ def pitches_counts(melody_score):
|
|
30 |
|
31 |
count = 0
|
32 |
pp = pitches[0]
|
|
|
33 |
for p in pitches:
|
34 |
if p == pp:
|
|
|
35 |
count += 1
|
36 |
else:
|
|
|
37 |
pcounts.append(count)
|
38 |
-
count = 1
|
39 |
pp = p
|
40 |
|
41 |
return pcounts
|
@@ -59,8 +61,6 @@ def find_similar_song(songs, src_melody):
|
|
59 |
for i, c in enumerate(src_pcount):
|
60 |
if c == trg_pcount[i]:
|
61 |
pcount += 1
|
62 |
-
else:
|
63 |
-
break
|
64 |
|
65 |
ratios.append(pcount / len(src_pcount))
|
66 |
|
|
|
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(count)
|
|
|
41 |
pp = p
|
42 |
|
43 |
return pcounts
|
|
|
61 |
for i, c in enumerate(src_pcount):
|
62 |
if c == trg_pcount[i]:
|
63 |
pcount += 1
|
|
|
|
|
64 |
|
65 |
ratios.append(pcount / len(src_pcount))
|
66 |
|