def spawn_new_midi():
    corpus = midi_parser.extract_traits(converter.parse(consts.name))
    pre_gen = utility.find_item(corpus, 'pitch', 'duration')
    
    pop = []

    for indi in pre_gen:
        pop.append(indi[0].values()[0])
    
    # population to string
    pop = utility.to_string(pop)

    # get markov chain of population
    new_pop = ga.genome(pop,10,5)
    print new_pop
Exemplo n.º 2
0
 def GET(self, size, nodes, influencer=consts.name):
     """Call with influencer name and other shit"""        
     pool = ga.genome(ExtractMidi().GET(influencer))
     web.header('Content-Type', 'application/json')
     
     return json.dumps({influencer : pool, 'settings' : {'size' : size, 'nodes' : nodes}})