def get_subtrack_offset(n_subtrack, max_subtrack, width):
    """Get the X offset to center a subtrack around an origin.
    
    :param n_subtrack: The 0-based subtrack index
    :param max_subtrack: The number of subtracks
    :param The width of a single subtrack
    :return: The offset to apply
    """
    total_width = max_subtrack * width
    base_offset = -total_width / 2
    subtrack_offset = width * n_subtrack
    center_offset = width / 2
    return base_offset + subtrack_offset + center_offset
