You may apply for a visa/residence permit as soon as you receive an offer of admission from Mid Sweden University. In order to get a decision as quickly as possible, you should apply online and pay the first installment of the tuition fee.
Note that you cannot obtain a residence permit before the first installment of the tuition payment has been made to Mid Sweden University.