How to Write Ragtime Music on the Piano

Updated on July 12, 2015
JohnMello profile image

JohnMello is a writer, composer, musician and the author of books for children and adults.


Ever wanted to write your own ragtime music for the piano? Stuck for ideas about how to get started?

It can be tricky to write piano music of any kind when you have to start from scratch. Instead, why not base your composition on an existing melody? Work your way through this article and you'll see exactly how you might go about it.

Although the examples used are specifically for piano - or keyboard - you can follow the same process to write ragtime music for any instrument you choose.

What is Ragtime?

Ragtime is a style of music that makes use of off-beat or syncopated rhythms, giving it a "ragged" feeling. Scott Joplin is the most well-known ragtime composer. As a genre it flourished during the late 1800s and early 1900s.

Writing Ragtime Piano Music: Step 1

To get started, you need a melody. Rather than make up my own, I've taken the first four notes from Scott Joplin's "The Entertainer" to give me something to work with.

You can see these four notes in the first bar of music below. To create the second bar I simply repeated the same pattern four notes higher. Whenever you repeat a pattern at a different pitch like this it's called a sequence.

These two bars together give me the beginnings of an original ragtime tune. I'm keen to add the left hand as well, and I want it to stand out from the melody, to act as accompaniment without getting in the way of the tune. I did this by using basic 3-note chords or triads which I decided to play staccato and in various inversions. It's important that the two hands are different to give the piece variety and depth.

Ragtime bars 1 and 2
Ragtime bars 1 and 2

You'll notice the instruction "Swing it!" at the beginning of the piece. This tells the perfomer to add a jazzy lilt to the music rather than playing the notes in strict time.

What is Swing?

Swing comes from the phrase "swing feel" where performers put the emphasis on the off-beat in popular jazz music. Swing was popular in the 1930s when "swing" bands were all the rage.

Writing Ragtime Piano Music: Step 2

As you probably know, music is an organic art form. Once you start using an idea, it's best to let the music grow out of that idea and lead you where it may. That's what Beethoven and Mozart did so well.

Because the first two bars used a rising pattern, I decided to make bar 3 go in the opposite direction. You can see that the melody in bar 4 is simply a slight variation on the opening phrases, helping to take the tune to the dominant key of G.

Ragtime bars 3 and 4
Ragtime bars 3 and 4

Writing Ragtime Piano Music: Step 3

The next part of the process involves repetition. Unlike a piece of artwork or a book, most people reference music by listening to it. That means that certain phrases and ideas need to be repeated, giving them something to relate to. Hearing an idea or phrase for the second time helps them get familiar with the music and also enables them to recognize what's happening more easily.

The first two bars of the piece are repeated exactly in bars 5 and 6. Bar 7 is the same as the first half of bar 3, played twice, while bar 8 is altered to add variety and provide a stopping place or cadence. This is at the end of the first section which makes a good place to come to rest temporarily. You'll also notice that the music ends up back in the original key of C again.

Ragtime bars 7 and 8
Ragtime bars 7 and 8

Writing Ragtime Piano Music: Step 4

Now the music moves into the subdominant key of F. This provides a change of tonality and that all-important variety mentioned above. It also gives listeners something new to enjoy - too much repetition will simply make the piece sound boring.

In this middle section the rhythm is the same as in the opening melody, but this time the notes are different, revolving around the note C. Keeping the same rhythm in a new tune is one way to establish continuity.

In bars 9 and 10 this "new tune" is expanded to revolve around the note D and take us gradually to land in the dominant key of G. This announces the end of the middle section and sets us up ready to hear the final portion of the piece.

Ragtime bars 9 and 10
Ragtime bars 9 and 10
Ragtime bars 11 and 12
Ragtime bars 11 and 12
Joplin - Complete Rags for Piano (Schirmer's Library of Musical Classics) Vol. 2020
Joplin - Complete Rags for Piano (Schirmer's Library of Musical Classics) Vol. 2020
All of Scott Joplin's ragtime piano pieces in one handy book from the leading publishers of classic piano literature.

Writing Ragtime Piano Music: Step 5

The piece ends as it began, reminding listeners about the opening theme. The first four bars are repeated exactly in bars 13, 14, 15 and 16. Then we hear bars 1 and 2 for the last time before a brand new tune enters the mix, played by the right hand only.

To bring things to a satisfactory close, both hands play a short melodic fragment based on the original rhythm of the opening melody, the right hand moving up, and the left hand moving down.

Ragtime final two bars
Ragtime final two bars

Example of Ragtime Piano Music

You can see and print the whole tune - which is called "Extended Rag" - by following this link to the piece on Score Exchange:

You can also hear me play the piece in the accompanying video above.

Ragtime Music Quiz

view quiz statistics


    0 of 8192 characters used
    Post Comment
    • profile image


      29 hours ago

      I have just come across this article and would like to point out that ragtime is emphatically NEVER swung. It goes against the whole point of the style and so I find your emphasis on this as being a key trait of ragtime music very misleading. If you listen to any rag or look at the score for any rag piece you will never see the marking telling you to play with a swung rhythm. The only time you would see such a thing is in those rather naff arrangements of non-rag tunes into 'rag'-style pieces.

    • profile image


      2 years ago

      Hi David

      Thanks for your observations. I think there are probably a lot of parallels between Joplin's music and what we might call traditional classical music. He also has links with blues and jazz too, of course. Who knows? Somebody might come along and write a brand new type of ragtime that people will be talking about in the future.

      If you do find any research that makes the kind of connections you mention, do please let us know.

    • profile image

      David Jordan 

      2 years ago

      I have loved playing ragtime since I was a beginning student, but why someone would want to compose it today is a bit strange to me. However, I think I can add to the discussion if someone really wanted to do it.

      First, there is an interesting work that Joplin wrote called "School of Ragtime" in which he goes through almost all the standard ragtime rhthyms and how he envisioned they should be played. One point I think that is often missed is that it isn't just the syncopation that gives the effect but also where the RH is accented on top of the regular "oom-pa" of the left that gives the effect.

      Second, there are also characteristic harmonic devices in ragtime. 2 of the most common are: the heavy use of the secondary dominant going back 3 or even 4 changes and extensively using diminished 7ths as transition chords. Also the octave and 6th intervals are used quite frequently as well.

      Finally, it would be well to study the rags to see how the motifs are developed and for the broad structures as well. Like the author pointed out, the second section always changes keys, sometimes twice, before the final reprise. It is obvious looking at his work that he intended ragtime to at least partially mirror classical tradition (he even wrote an opera); and I have wondered if a "rag" has parallels with a sonata in terms of how they are developed but I have never taken the time to verify this. If anyone does a study like this, I would be interested to see the results.

      I hope these observations might be helpful to anyone trying to compose ragtime.

    • JohnMello profile imageAUTHOR


      4 years ago from England

      Thanks for the comprehensive comment Antonio Martinez1! Glad you liked my article :)

    • Antonio Martinez1 profile image

      Antonio Martinez 

      4 years ago from Kearny, New Jersey

      An astonishing account of how to write ragtime music. As a composer myself, I can say without a doubt that writing for ragtime is one of the most enjoyable form of music to write, particularly because of the repetition and the structure that goes with writing a ragtime piece. I remember Christmas 13 years ago that I got a book of Scott Joplin's Rags and, at first, I never really understood much about American music (most of my interests related to classical music).

      However, after playing a few Joplin rags (notably Elite Syncopations, The Sycamore and Kismet Rag), it would be something of a blessing. More recently, as a native New Jersey resident, one of the three pioneers of ragtime was born in Montclair: Joseph Lamb and his background also became an inspiration for me to continue ragtime and its continuing revival.

      I am proud to say that during 2015, I wrote 14 more (of my 22) ragtime pieces, drawing inspiration from ragtime but also from classical music and doing so in rather unorthodox ways. I hope to continue to venture into ragtime while also drawing inspiration not only from the great ragtime composers such as Joplin, Lamb and James Scott but also from this guide.

      Thanks for a great article and perhaps one day I would love to listen to your ragtime pieces.


    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at:

    Show Details
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the or domains, for performance and efficiency reasons. (Privacy Policy)
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
    ClickscoThis is a data management platform studying reader behavior (Privacy Policy)