def set_selected_solo_rhythm(c_2, current_bar_num):
    """sets solo rhythm type depending on bar number and number of bars in current part"""
    if c_2['num_bars_in_part'] == 1:
        c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][c_2['double_select']]
    elif c_2['num_bars_in_part'] == 2:
        if current_bar_num == 0:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][c_2[
                'intro_select']]
        else:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][c_2['end_select']]
    elif c_2['num_bars_in_part'] == 3:
        if current_bar_num == 0:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][c_2[
                'intro_select']]
        elif current_bar_num == c_2['num_bars_in_part'] - 1:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][c_2['end_select']]
        else:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][c_2[
                'double_select']]
    elif c_2['num_bars_in_part'] >= 4:
        if current_bar_num == 0:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][1]
        elif current_bar_num == c_2['num_bars_in_part'] - 1:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][2]
        else:
            c_2['selected_solo_rhythm'] = c_2['solo_rhythm'][c_2[
                'double_select']]
