-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmusicmap.py
75 lines (62 loc) · 2.69 KB
/
musicmap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import sys, os
import argparse
from halo import Halo
from graph.graph import run_path_plotter
parser = argparse.ArgumentParser(description="musicmap mental health music tagger")
parser.add_argument('-o', '--tagoptions', dest="tagoptions",
action='store_true',
help="Get all possible tags")
parser.add_argument('-t', '--tags', dest="tags",
type=str,
help="Path to already computed tags",
default=os.path.dirname(os.path.abspath(__file__)))
parser.add_argument('-p', '--path', dest="path",
type=str,
help="path to mp3 files")
parser.add_argument('-l', '--hops', dest="hops",
type=int,
help="playlist length",
default=10)
parser.add_argument('-s', '--start', dest="start",
type=str,
help="playlist start tag",
default="Mellow")
parser.add_argument('-e', '--end', dest="end",
type=str,
help="playlist end tag",
default="party")
parser.add_argument('-f', '--force_compute', dest="force_compute",
action='store_true',
help="force computing of process files, will override existing ones")
# getting all provided arguments
args = parser.parse_args(sys.argv[1:])
if __name__ == '__main__':
if args.tagoptions:
print(['rock','pop','alternative',
'indie','electronic','female vocalists',
'dance','00s','alternative rock',
'jazz','beautiful','metal','chillout',
'male vocalists','classic rock','soul',
'indie rock','Mellow','electronica','80s',
'folk','90s','chill','instrumental','punk',
'oldies','blues','hard rock','ambient',
'acoustic','experimental','female vocalist',
'guitar','Hip-Hop','70s','party','country',
'easy listening','sexy','catchy','funk',
'electro','heavy metal','Progressive rock',
'60s','rnb','indie pop','sad','House','happy'])
exit()
if not args.tags:
from analysis.music_analyser import music_analyiser
file_folder = args.path
processor = music_analyiser(file_folder)
#print ('Number of arguments:', len(sys.argv), 'arguments.')
#print ('Argument List:', str(sys.argv))
processor.get_files()
#processor.run()
processor.run(extract_features=True)
#processor.save_glob_sidecar()
spinner = Halo(text='calculating graph', spinner='dots')
spinner.start()
run_path_plotter(args.tags, args.hops, args.start, args.end, args.force_compute)
spinner.stop()