def convertTempoByReferent(numberSrc, quarterLengthBeatSrc,
    quarterLengthBeatDst=1.0):
    """
    Convert between equivalent tempi, where the speed stays the
    same but the beat referent and number change.


    60 bpm at quarter, going to half

    >>> tempo.convertTempoByReferent(60, 1, 2)
    30.0

    60 bpm at quarter, going to 16th

    >>> tempo.convertTempoByReferent(60, 1, .25)
    240.0

    60 at dotted quarter, get quarter

    >>> tempo.convertTempoByReferent(60, 1.5, 1)
    90.0

    60 at dotted quarter, get half

    >>> tempo.convertTempoByReferent(60, 1.5, 2)
    45.0

    60 at dotted quarter, get trip

    >>> tempo.convertTempoByReferent(60, 1.5, 1/3)
    270.0

    A Fraction instance can also be used:

    >>> tempo.convertTempoByReferent(60, 1.5, common.opFrac(1/3))
    270.0

    """
    srcDurPerBeat = 60 / numberSrc
    dur = srcDurPerBeat / quarterLengthBeatSrc
    dstDurPerBeat = dur * float(quarterLengthBeatDst)
    return float(60 / dstDurPerBeat)
