def onset_attributes_to_onset(o_beat, o_subdiv):
    """
    Convert arrays of o_bt and o_sub to o.
    - See eq. (1) of the paper.
    """

    def o_bt_o_sub_to_o(o_bt, o_sub):

        def convert_sub(x):
            """ o_sub from its 2's complement representation to exact value."""
            return (x + 3) % 7 - 3

        return (4 * o_bt + convert_sub(o_sub)) % 32

    o = o_bt_o_sub_to_o(o_beat, o_subdiv)

    return o