Sec. 2. The provisions of this article do not apply to a defendant who is:
(1) serving a sentence of imprisonment for another offense while the defendant is serving that sentence;
(2) being detained pending trial of another accusation against the defendant as to which the applicable period has not yet elapsed;
(3) incompetent to stand trial, during the period of the defendant's incompetence; or
(4) being detained for a violation of the conditions of a previous release related to the safety of a victim of the alleged offense or to the safety of the community under this article.