def gabcPositionToStep(notePosition, clef, adjustClefOctave=0):
    """Convert a gabc note position to a step name"""
    positions = 'abcdefghijklm'
    cPosition = dict(c1='d', c2='f', c3='h', c4='j',
                      cb1='d', cb2='f', cb3='h', cb4='j', 
                      f1='a', f2='d', f3='e', f4='g')
    clefOctaves = dict(c1=4, c2=5, c3=5, c4=5,
                        cb1=4, cb2=5, cb3=5, cb4=5,
                        f1=4, f2=4, f3=4, f4=4)

    noteIndex = positions.index(notePosition.lower())
    cIndex = positions.index(cPosition[clef])
    stepsAboveC = noteIndex - cIndex
    octavesAboveC = stepsAboveC // 7
    noteName = 'CDEFGAB'[stepsAboveC % 7]
    noteOctave = clefOctaves[clef] + adjustClefOctave + octavesAboveC
    return f'{noteName}{noteOctave}'