Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirasawaSama committed Dec 28, 2023
1 parent 39cabbd commit 6e37f23
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import sys
import musicpy.algorithms as algorithms
import musicpy.structures as structures

if __name__ == '__main__' and len(sys.argv) > 1:
action = sys.argv[1]
if action == "chords":
while True:
if __name__ == '__main__':
while True:
action = input()
if action == 'chords_detect':
chord_notes, chord_inds = algorithms.chord_analysis(
structures.chord(input(), list(map(float, input().split(','))), list(map(float, input().split(',')))),
is_chord=True, mode='chords', get_original_order=True
)
result = [algorithms.detect(each) for each in [chord_notes[k[0]:k[1]] for k in chord_inds]]
for i in result:
print(i if not isinstance(i, list) else i[0], end=',')
print(flush=False)
print()
inds = [[i[0], i[1]] for i in chord_inds]
for k in inds:
bar_range = chord_notes.count_bars(k[0], k[1])
print(bar_range[0], end=',')
print(bar_range[1], end=',')
print()
print(flush=True)

0 comments on commit 6e37f23

Please sign in to comment.