def overlaps(df, idx):
    """
    Check if the note at the given index in the given dataframe overlaps any
    other notes in the dataframe.

    Parameters
    ----------
    df : pd.DataFrame
        The DataFrame to check for overlaps.

    idx : int
        The index of the note within df that might overlap.

    Returns
    -------
    overlap : boolean
        True if the note overlaps some other note. False otherwise.
    """
    note = df.loc[idx]
    df = df.loc[
        (df["pitch"] == note.pitch) & (df["track"] == note.track) & (df.index != idx)
    ]
    overlap = any(
        (note.onset < df["onset"] + df["dur"]) & (note.onset + note.dur > df["onset"])
    )
    return overlap