added shell interactions

This commit is contained in:
Cezary Pukownik [Impakt S.A.] 2019-10-25 11:23:59 +02:00
parent 86b0540feb
commit eaaad76a2a
2 changed files with 18 additions and 12 deletions

View File

@ -7,17 +7,16 @@ from midi_processing import extract_data, analyze_data
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('midi_pack', help='folder name for midi pack in midi_packs folder', type=str) parser.add_argument('midi_pack', help='folder name for midi pack in midi_packs folder', type=str)
parser.add_argument('--n', help='name for experiment', type=str) parser.add_argument('name', help='name for experiment', type=str)
parser.add_argument('--b', help='lengh of sequence in bars', type=int) parser.add_argument('--b', help='lengh of sequence in bars', type=int)
parser.add_argument('-a', help='analize data', action='store_true') parser.add_argument('-a', help='analize data', action='store_true')
args = parser.parse_args() args = parser.parse_args()
'''SETTINGS''' '''SETTINGS'''
MIDI_PACK_NAME = args.midi_pack MIDI_PACK_NAME = args.midi_pack
EXPERIMENT_NAME = args.n EXPERIMENT_NAME = args.name
BARS_IN_SEQ = args.b BARS_IN_SEQ = args.b
midi_folder_path = os.path.join('midi_packs', MIDI_PACK_NAME) midi_folder_path = os.path.join('midi_packs', MIDI_PACK_NAME)
# analyze data set for intresting intruments # analyze data set for intresting intruments
@ -25,13 +24,18 @@ if args.a:
analyze_data(midi_folder_path) analyze_data(midi_folder_path)
sys.exit() sys.exit()
'''SETTINGS'''
model_workflow = { '''MODEL WORKFLOW DIALOG'''
1 : ('Organ', 'melody'), number_of_instruments = int(input('Please specify number of instruments\n'))
2 : (('Organ','Guitar'), 'arrangment'), model_workflow = dict()
3 : (('Organ','Bass'), 'arrangment'), input_list = []
4 : (('Bass','Drums'), 'arrangment') for i in range(number_of_instruments):
} input_string = input('Please specify a workflow step\n')
tokens = input_string.split()
if tokens[-1] == 'melody':
model_workflow[i] = (tokens[0], tokens[1])
else:
model_workflow[i] = ((tokens[1], tokens[0]), tokens[2])
# make folder for new experiment if no exist # make folder for new experiment if no exist
try: try:

View File

@ -8,12 +8,14 @@ import pickle
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('n', help='name for experiment', type=str) parser.add_argument('n', help='name for experiment', type=str)
parser.add_argument('--i', help='number of midis to generate', type=int) parser.add_argument('--i', help='number of midis to generate', type=int)
parser.add_argument('--l', help='latent_dim_of_model', type=int)
parser.add_argument('--m', help="mode {'from_seq', 'from_state}'", type=str)
args = parser.parse_args() args = parser.parse_args()
EXPERIMENT_NAME = args.n EXPERIMENT_NAME = args.n
GENERETIONS_COUNT = args.i GENERETIONS_COUNT = args.i
LATENT_DIM = 256 LATENT_DIM = args.l
MODE = 'from_seq' MODE = args.m
if GENERETIONS_COUNT == None: if GENERETIONS_COUNT == None:
GENERETIONS_COUNT = 1 GENERETIONS_COUNT = 1