A native of Jiangsu, he graduated as jinshi (presented scholar) in 1709 and was employed in literary and examination work, rising in 1733 to be President of the Board of Punishments. Two years later, he narrowly escaped execution for his failure to arrange the management of the aboriginal territories in Guizhou. He was again employed on literary work, and was joint compiler of the Lülü Zhengyi (律呂正義) and its sequel (houbian 後編) under the same name, the two standard treatises on music. His poems were much admired by the Emperor, who was especially struck with some verses written with his left hand after a fall from his horse had disabled his right arm. He died of grief for the loss of his father. In his Retrospect (懷舊詩, 1779) the Emperor Qianlong numbered him among his Five Men of Letters (五詞臣), the others being Qian Chenqun, Liang Shicheng, Shen Deqian, and Wang Yudun. He was canonised as Wen'ao (文敏).