import mido

def playAtIntervals(messages, times, outport):
    '''
    function to play messages at given intervals
    messages and times must be arrays of equal length
    '''
    for msg,t in zip(messages,times):
        outport.send(msg)
        time.sleep(t)

def getFibonacci(length, t1):
    '''
    returns array of intervals generated by the fibonacci sequence
    starts at t1
    '''
    out = []
    t2 = t1
    for i in range(length):
        out.append(t1)
        temp = t1
        t1 = t1 + t2
        t2 = temp

    return out
