Formal:
* J'ai suivi un cours de violon. (I followed a violin lesson.)
* J'ai eu un cours de violon. (I had a violin lesson.)
Informal:
* J'ai fait un cours de violon. (I did a violin lesson.)
* J'ai pris un cours de violon. (I took a violin lesson.)
You could also use the verb "apprendre" (to learn) to emphasize the learning aspect:
* J'ai appris le violon. (I learned violin.)
The best option will depend on the context and your personal preference.