To insure a complete record and for the protection of all concerned, the personal right of a preliminary hearing may be waived by the defendant on the record only in the presence of a judge and the defendant’s attorney, if any.