-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonSoundHelix.py
More file actions
31 lines (30 loc) · 1.07 KB
/
PythonSoundHelix.py
File metadata and controls
31 lines (30 loc) · 1.07 KB
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
import sys
if "--nogui" in sys.argv[1:]:
from pathlib import Path
from app.generator import generate_song, preset_defaults
preset = "Auto Composer"
seed = None
prompt = ""
language = "English"
output = str(Path(__file__).resolve().parent / "output")
argv = sys.argv[1:]
for i, a in enumerate(argv):
if a == "--preset" and i + 1 < len(argv): preset = argv[i+1]
if a == "--seed" and i + 1 < len(argv): seed = int(argv[i+1])
if a == "--output" and i + 1 < len(argv): output = argv[i+1]
if a == "--prompt" and i + 1 < len(argv): prompt = argv[i+1]
if a == "--language" and i + 1 < len(argv): language = argv[i+1]
s = preset_defaults(preset)
s.prompt = prompt
s.prompt_language = language
s.prompt_mode = True
if seed is not None:
s.seed = seed
s.randomize_seed = False
res = generate_song(s, output)
print(f"{res.title} | seed={res.seed} | notes={res.note_count}")
print(res.midi_path)
raise SystemExit(0)
else:
from app.main import main
raise SystemExit(main())