Typically the number of characters in each line and the arrangement of tones were determined by one of around 800 set patterns, each associated with a particular title, called cípái 詞牌. Originally they were written to be sung to a tune of that title, with set rhythm, rhyme, and tempo. Therefore, the title may have nothing to do with its contents, and it is common for several ci to appear to have the same title. Some ci would have a "subtitle" (or a commentary, sometimes as long as a paragraph) indicating the contents. Sometimes, for the sake of clarity, a ci is listed under its title plus its first line.
Beginning in the Liang Dynasty, the ci followed the tradition of the Shi Jing and the yue fu: they were lyrics which developed from anonymous popular songs (some of Central Asian origin) into a sophisticated literary genre. The form was further developed in the Tang Dynasty, and was most popular in the Song Dynasty.
Two main categories of ci employed in Song Dynasty were xiǎolìng 小令 (the original form since Pre-Song) and màncí 慢詞 (starting after Liu Yong), depending on the song being either short and in fast tempo or long and in slow tempo. Later in Ming Dynasty and Qing Dyansties, the ci, or rather the cipai, are classified for the number of characters it dictates. It's called xiǎolìng 小令 if it's no more than 58 characters, zhōngdiào 中調 for 59-90, and chángdiào 長調 for over 90. If the ci appears in one stanza, it's called dāndiào 單調, mostly xiǎolìng written in Pre-Song era. The largest majority is shuāngdiào 雙調 with two stanzas or qüè 闋 in identical or nearly identical patterns. There also are rare cases of sāndié 三疊 and sìdié 四疊, for three and four qüè, respectively. In terms of style, ci can also be classified as either wǎnyuē 婉約 or háofàng 豪放.
Most cipai consist of three characters. The literal meaning of a cipai can be rather obscure, making it difficult to translate. Some are taken straight from earlier poems, and some are clearly of Non-Han origin — mostly songs introduced from Central Asia. Some cipai have alternative names, usually taken from a famous piece of that very cipai. There also are variants of certain cipai, indicated by a prefix or a suffix.
In the title of this ci, "the Tune of Riverside City" is the cipai, followed by the first sentence of the poem. Su Shi got married when he was 19, his wife 16. His wife died when she was only 27. Because of his government duties, Su Shi had moved to many different places in China, all far away from his hometown. One night in early 1075, about 10 years after her death, Su Shi dreamed of his wife, then composed this famous ci.