I have written a hornpipe in AABB format which also has a counter-melody.
On the first time through the A section the counter-melody rests until halfway through the second bar. on the second repetition it comes in straight away. In fact the entirety of the first two bars of the counter-melody is different, but after that it's the same until the last bar which has a first and second ending bar.
My first attempt involves placing the begin repeat sign at the beginning of the third bar and having a 3 bar first ending - which actually contains the first 2 bars of the next repeat - and a one bar second ending that continues into the B section.
Although this works it is quite unintuitive and seems to really confuse people.
Can someone provide a better answer, before I give up, unroll the repeats and write it out in full?