1. Except as provided in subdivisions (2), (3) and (4), punishment for a contempt, specified in section seven hundred fifty, may be by fine, not exceeding one thousand dollars, or by imprisonment, not exceeding thirty days, in the jail of the county where the court is sitting, or both, in the discretion of the court. Where the punishment for contempt is based on a violation of an order of protection issued under section 530.12 or 530.13 of the criminal procedure law, imprisonment may be for a term not exceeding three months. Where a person is committed to jail, for the nonpayment of a fine, imposed under this section, he must be discharged at the expiration of thirty days; but where he is also committed for a definite time, the thirty days must be computed from the expiration of the definite time. Such a contempt, committed in the immediate view and presence of the court, may be punished summarily; when not so committed, the party charged must be notified of the accusation, and have a reasonable time to make a defense.