Beispiel #1
0
def parse_midi_directory(input_dir, time_step):
    """ 
    input_dir: data directory full of midi files
    time_step: the number of ticks to use as a time step for discretization

    Returns a list of [T x D] matrices, where T is the amount of time steps
    and D is the range of notes.
    """
    files = [ os.path.join(input_dir, f) for f in os.listdir(input_dir)
              if os.path.isfile(os.path.join(input_dir, f)) ] 
    sequences = [ \
        (f, midi_util.parse_midi_to_sequence(f, time_step=time_step)) \
        for f in files ]

    return sequences
Beispiel #2
0
def parse_midi_directory(input_dir, time_step):
    """ 
    input_dir: data directory full of midi files
    time_step: the number of ticks to use as a time step for discretization

    Returns a list of [T x D] matrices, where T is the amount of time steps
    and D is the range of notes.
    """
    files = [ os.path.join(input_dir, f) for f in os.listdir(input_dir)
              if os.path.isfile(os.path.join(input_dir, f)) ] 
    sequences = [ \
        (f, midi_util.parse_midi_to_sequence(f, time_step=time_step)) \
        for f in files ]

    return sequences