Mercurial > hg > simscene-py
changeset 4:94eb0280ad4a
added more (all?) options
author | Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk> |
---|---|
date | Fri, 29 Sep 2017 20:39:54 +0100 |
parents | bfd2651f928c |
children | 42f189846ba8 |
files | simscene.py |
diffstat | 1 files changed, 53 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/simscene.py Fri Sep 29 20:05:23 2017 +0100 +++ b/simscene.py Fri Sep 29 20:39:54 2017 +0100 @@ -16,44 +16,79 @@ **kwargs): print("TODO: Implement simscene()") - +def not_implemented(): + print("TODO: not implemented") if __name__=="__main__": + """ + Main function, parses options and calls the simscene generation function + or a demo. The options given are almost identical to Lagrange et al's + simscene. + """ argparser = argparse.ArgumentParser( description="SimScene.py audio scene generator", ) argparser.add_argument( - '--demo', - help="runs a scene generation demo", - action='store_true', - ) - argparser.add_argument( 'input_path', type=str, help="Path of a directory containing wave files for sound backgrounds (in the `background' sub-directory) or events (in `event')" ) argparser.add_argument( - '-s', '--scene_duration', + '-T', '--scene-duration', type=float, help="Duration of scene in seconds", ) argparser.add_argument( - '-e', '--score_events', + '-e', '--score-events', type=str, help="Score events file as a comma-separated text file (.csv, .txt), JSON (.json), or Excel (.xls) file" ) argparser.add_argument( - '-b', '--score_backgrounds', + '-b', '--score-backgrounds', type=str, help="Score backgrounds file as a comma-separated text file (.csv, .txt), JSON (.json), or Excel (.xls) file" ) + argparser.add_argument( + '-t', '--time-mode', + type=str, + help="Mode of spacing between events. `generate': values must be set for each track in the score files. `abstract': values are computed from an abstract representation of an existing acoustic scene. `replicate': values are replicated from an existing acousting scene.", + choices=['generate', 'abstract', 'replicate'] + ) + argparser.add_argument( + '-R', '--ebr-mode', + type=str, + help="Mode for Event to Background power level ratio. `generate': values must be set for each track in the score files. `abstract': values are computed from an abstract representation of an existing acoustic scene. `replicate': values are replicated from an existing acousting scene.", + choices=['generate', 'abstract', 'replicate'] + ) + argparser.add_argument( + '--annotation-file', + type=float, + help="If -R or -m are selected, this provides the source for sourcing the times or EBRs from ANNOTATION_FILE. ANNOTATION_FILE must be comma-separated text file (.csv, .txt), JSON (.json), or Excel (.xls)." + ) + argparser.add_argument( + '--audio-file', + type=float, + help="If -R or -m are selected, this provides the source for sourcing the times or EBRs from AUDIO_FILE. AUDIO_FILE must be a 44100Hz .wav file." + ) + argparser.add_argument( + '-f', '--figure', action='count', + help="Increase figure verbosity. (Default) 0 - Don't save or display figures, 1 - Save pictures but do not display them, 2 - Save and display figures" + ) + argparser.add_argument( + '-C', '--channel', + type=int, + help="number of audio channels contained in file. (Default) 0 - 1 channel (mono), 1 - As many channels as sound classes (events+textures), 2 - Same as 1, each channel is saved in a separate .wav file." + ) + argparser.add_argument( + '-m', '--min-space', + type=float, + help="Minimum space allowed between successive events (seconds). If -1, then allow overlapping between events." + ) + argparser.add_argument( + '-c', '--end-cut', + action='store_true', + help="If the last sample ends after the scene ends then: if enabled, cut the sample to duration, else remove the sample." + ) + args = argparser.parse_args() + not_implemented() - args = argparser.parse_args() - if args.demo: - run_demo() - elif args.input_path: - print(args.input_path) - else: - argparser.print_usage() - -