def attack_decay(params, attack, start=0, peak=1):
    '''
    Signal starts at min value, ramps linearly up to max value during the
    attack time, than ramps back down to min value over remaining time
    :param params: buffer parameters, controls length of signal created
    :param attack: attack time, in samples
    :param start: start value (number)
    :param peak: peak value (number)
    :return:
    '''
    builder = GenericEnvelope(params)
    builder.set(start)
    builder.linseg(peak, attack)
    if attack < params.length:
        builder.linseg(start, params.length - attack)
    return builder.build()
def attack_decay ( params , attack , start = 0 , peak = 1 ) : builder = GenericEnvelope ( params ) builder . set ( start ) builder . linseg ( peak , attack ) if attack < params . length : builder . linseg ( start , params . length - attack ) return builder . build ( )
Signal starts at min value, ramps linearly up to max value during the
    attack time, than ramps back down to min value over remaining time
    :param params: buffer parameters, controls length of signal created
    :param attack: attack time, in samples
    :param start: start value (number)
    :param peak: peak value (number)
    :return: