Rag, or ragtime, is a musical genre that appeared at the turn of the 20th century. It was originally a dance genre, with a distinct syncopated rhythm. It later evolved into a more refined form of piano music, which begun to be published in the first years of the 20th century. Rag fell out of favor when jazz arose during the first decades of the 20th century, but was later revived several times.