A motion for a new trial shall be in writing, shall state the grounds upon which it is based, and shall be tried contradictorily with the district attorney.