Complex sentence: Sonatas were at first written mainly for the violin, and in the course of time a certain formal type was evolved, predominating until the late 18th century.
Split into simpler sentences: Sonatas were at first written mainly for the violin. Over time, a certain formal type evolved, predominating until the late 18th century.