(a) If the defendant is confined in the custody of the sheriff, the court may direct the sheriff to produce him;
(b) If the defendant is at liberty within the state as a result of an order releasing him on his own recognizance or on bail, the court may secure his attendance by notification or by the issuance of a bench warrant. 3. If the defendant's attendance cannot be secured by methods described in subdivisions one and two, either because he is outside the state or because he is confined in an institution within the state as a result of an order issued in some other action, proceeding or matter, his attendance may, under indicated circumstances, be secured by procedures prescribed in the ensuing articles of this title.