def notes_to_intervals(notes: list) -> list:
    """Convert a list of MIDI pitches to a list of intervals. 

    >>> notes_to_intervals([60, 62, 64, 60])
    [2, 2, -4]

    Parameters
    ----------
    notes : list
        The notes, as MIDI pitches

    Returns
    -------
    list
        The intervals
    """
    pairs = zip(notes[:-1], notes[1:])
    get_interval = lambda pair: pair[1] - pair[0]
    intervals = list(map(get_interval, pairs))
    return intervals