saysynth.cli.commands.arp

Synthesize an arpeggiated melody.

 1"""
 2Synthesize an arpeggiated melody.
 3"""
 4import click
 5from midi_utils import note_to_midi
 6
 7from saysynth.cli.options import (adsr_opts, arp_opts, chord_opts,
 8                                  duration_opts, log_configurations,
 9                                  output_file_opt, phoneme_opts,
10                                  randomize_velocity_opt, say_opts,
11                                  segment_opts, start_opts, text_opt,
12                                  velocity_emphasis_opt, volume_level_opts,
13                                  volume_range_opt)
14from saysynth.core import Arp, controller
15
16
17def run(**kwargs):
18    """
19    Generate an arpeggiated melody.
20    """
21    arp = Arp(**kwargs)
22    arp.cli(**kwargs)
23
24
25@click.command()
26@click.argument("root", type=note_to_midi, default="A2")
27@arp_opts
28@chord_opts
29@velocity_emphasis_opt
30@volume_range_opt
31@randomize_velocity_opt
32@volume_level_opts
33@start_opts
34@duration_opts
35@phoneme_opts
36@text_opt
37@segment_opts
38@adsr_opts
39@output_file_opt
40@say_opts
41def cli(**kwargs):
42    """
43    Generate an arpeggiated melody.
44    """
45    if kwargs["yaml"]:
46        return log_configurations("arp", **kwargs)
47    kwargs = controller.handle_cli_options("arp", **kwargs)
48    return run(**kwargs)
def run(**kwargs):
18def run(**kwargs):
19    """
20    Generate an arpeggiated melody.
21    """
22    arp = Arp(**kwargs)
23    arp.cli(**kwargs)

Generate an arpeggiated melody.

cli = <Command cli>

Generate an arpeggiated melody.