Scott Joplin's early piano lessons did not include ragtime. That kind of music was played in dance and drinking places and was not considered acceptable.
From 1880 to World War I, New Orleans with its cafe and night club society became host to a new form of music based mostly on the blues, but also on marches and ragtime music.