In addition to the identity you state, there are two others.
Using your notation,
Asin (x) - Bcos (x) = Csin (x - v)
and
Acos (x) - Bsin (x) = Ccos (x + v ).
It was this last one that was chosen in order that the signs matched up.
Incidently, if the rhs of Melody's equation is known to be negative, (it depends on the value of c), it might be better to switch the left and right hand sides. In that case we would use the identity for
Asin (x) - Bcos(x).
Tiggsy