(a) Joinder of Offenses. The indictment or information may charge a defendant in separate counts with 2 or more offenses if the offenses charged-whether felonies or misdemeanors or both- are of the same or similar character, or are based on the same act or transaction, or are connected with or constitute parts of a common scheme or plan.

(b) Joinder of Defendants. The indictment or information may charge 2 or more defendants if they are alleged to have participated in the same act or transaction, or in the same series of acts or transactions, constituting an offense or offenses. The defendants may be charged in one or more counts together or separately. All defendants need not be charged in each count.