Yanyue kaoyuan 燕樂考原 "On the origins of court banquet music" is a book on the music of the Sui 隋 (581-618) and Tang periods 唐 (618-907) compiled during the Qing period 清 (1644-1911) by Ling Tingkan 淩廷堪 (c. 1755-1809), courtesy name Cizhong 次仲. He hailed from Shexian 歙縣, Anhui, and was a teacher in the prefecture of Ningguo 甯國, Anhui.
He studied ancient music and came to the conclusion that the popular music of later times had during the Tang period separated from the court music, but the court music of the Tang was based on the music of the city state of Qiuci 龜茲 (Kucha) that had been brought to China by Sujiva (late 6th cent., Chinese rendering Suzhipo 蘇祗婆) and was adapted to the Chinese taste by Zheng Yi 鄭譯 (540-591). This music was particularly fitting to the pear-shaped lute (pipa 琵琶) that also originated in Central Asia. In his book of 6 juan length, Ling Tingkan explains that the tunes of the pipa were based on five musical scales (dan 旦) with seven tones (diao 調), while the traditional Chinese system knew twelve scales with a total of 84 tones. Zheng Yi transformed the Inner Asian tone model to the Chinese one. In order to harmonize the seven tones with the pentatonic system, two alternated tones were created, namely bianzhi 變徵 and biangong 變宮.
The Yanyue kaoyuan assembles a lot of ancient sources like the Pipalu 琵琶錄 from Duan Anjie's 段安節 (9th cent.) Yuefu zalu 樂府雜錄, the musicological treatise Liyue zhi 禮樂志 of the history Xintangshu 新唐書, chapters on music from Shen Kuo's 沈括 (1031-1094) Mengxi bitan 夢溪筆談, from Wang Zhuo's 王灼 (1105-1160) book Bixi manzhi 碧雞漫志, the treatise on music from the histories Songshi 宋史 and Liaoshi 遼史, and parts of Zhou Deqing's 周德清 (1277-1365) Zhongyuan yinyun 中原音韻 from the Yuan period 元 (1279-1368).
The results of Ling's comparative researches are assembled in various tables, like Qigong qiyu biao 七宮七羽表 (and similar tables for the other tones and scales) or Yanyue heqin biao 燕樂合琴表, where the musical modes of the pipa lute are compared with that of the small zither (qin 琴). These tables are very helpful for the study of ancient music in China. Of similar value is the critical method with which Ling Tingkan used ancient sources, so that he is able to correct many errors that had crept in the transmission of older texts.