There are two texts bearing the title Yuelun 樂論 "Discourse on music". One is a chapter of the collection Xunzi 荀子, attributed to the Confucian philosopher Xun Kuang 荀況 (trad. 313-238 BCE) of the late Warring States period 戰國 (5th cent.-221 BCE), and the other is a treatise called Yuelun 樂論, written the philosopher Ruan Ji 阮籍 (210-263), who lived during the Three Empires period 三國 (220~280 CE) and was one of the Seven Worthies of the Bamboo Grove.
The Xunzi chapter is often compared to the chapter Yueji 樂記 of the ritual classic Liji 禮記 which is often interpreteted as one version of the (putative) Yuejing 樂經, one of the Six Classics (liujing 六經).
According to Xunzi, music is an expression of man's feelings, but in a way that is indispensable. Emotions must find their voice through sounds and timbres and find a shape in movement and silence. Such an expression might be "chaotic" (luan 亂) or improper, and would thus have to be guided to follow a certain "way" (dao 道).
This path of proper music was regulated by the earlier sage kings and their composition of odes (ya 雅) and hymns (song 頌) as described in the Shijing 詩經 "Book of Songs". The music of the ancient kings was the correct tool to embody intricacy and directness (quzhi 曲直), elaboration and simplification (fansheng 繁省), purity or richness (lianrou 廉肉), as well as rhythm and meter (jiezou 節奏). Being perfect in all these aspects, the music of the ancient sage kings would move the heart of the audience.
Different social positions, like ruler and minister, father and son, elder and younger, would thus be united in harmony, and "all under Heaven was in great uniformity" (tianxia da qi 天下大齊). This meant, in a political sense, that listening to the odes and hymns would result in unfied action and obedience (mo bu tingcong 莫不聽從, mo bu congfu 莫不從服). "Establishing [rules for] music was a [political] skill of the ancient sage-kings" (xianwang li yue zhi shu 先王立樂之術).
Music was an expression of a ruler's joy (that which the saint man rejoiced in: yue zhe, wang shengren zhi suo le ye 樂者,聖人之所樂也, or "music is joy": yue zhe, le ye 樂者、樂也), just as military campaigns were an expression of his anger. Yet the royal music was to accord with the mean and be evenly balanced (zhong ping 中平) and be solemn and dignified (su zhuang 肅莊), in order to cause the people to remain peaceful and do their duties. This in turn was a precondition for the strength of the royal army and the respect shown by the regional rulers. The king had to see to it that "lewd sounds" (yinsheng 淫聲) would not spoil the solemnity of the odes.
The intention of the ruler's way (dao zhi 道志) was expressed by bells and drums, while the emotions of the heart found their expression by zithers. Music purified the inner mind, rites perfected conduct, and both sharpened eyes and ears, brought an equilibrium to blood and energy (qi 氣), and improved manners and customs. Rituals and music were elements binding hearts together. Music embodied harmonies that can never be altered (he zhi bu ke bian zhe 和之不可變者), and rites embodied principles of natural order that can never be changed (li zhi bu ke yi zhe 理之不可易者). Music would exhaust the root of things and carry change to its highest degree (qiong ben ji bian 窮本極變), while rites would illuminate the genuine and eliminate the artificial (zhu cheng qu wei 著誠去偽).
Xunzi also described the effects and symbolism of various musical instruments. Drums (gu 鼓), resembling Heaven, represented vastness and grandeur, bells (zhong 鐘), resembling the earth, fullness and wholeness, soundstones (qing 磬), resembling the agent water, reed pipes (yu 竽) and mouth organs (sheng 笙) represented solemn harmony, tube flute (guan 筦) and flageolet (yue 籥) represented spirited outburst, ocarina (xun 塤) and bamboo flute (chi 篪) represented rising mists, the large zither (se 瑟) easy kindness, and the small zither (qin 琴) tender grace. While the pipes represented the celestial bodies, the pellet drum (tao 鞉), the leathern chaff drum (zhu 柷), the tabour (fu 拊), the sounding box (ge 鞷), the tambourine (qiang 椌), and the clapper (jie 楬) resembled the myriad things on earth. Songs would express pure fulfilment, and dancing enabled to conjoin with the Way of Heaven (yu tian dao xiang he 與天道相合).