In 1671 he became deputy Kapellmeister at the imperial court. In 1673 the emperor gave him the honorary title “von Ehrenruef” which he put after his name. A few years later the court moved to Prague to try to escape the plague that was killing so many people in Vienna. At the end of 1679 the emperor’s Kapellmeister died and Schmelzer became Kapellmeister. It was the first time that the Kapellmeister at the Habsburg court had not been a foreigner but an Austrian. However, the following March Schmelzer died of the plague.