计算机工程与应用 ›› 2008, Vol. 44 ›› Issue (32): 206-209.DOI: 10.3778/j.issn.1002-8331.2008.32.062

• 工程与应用 • 上一篇    下一篇

基于遗传算法的智能作曲技术研究

曹西征,张爱丽,徐久成   

  1. 河南师范大学 计算机与信息技术学院,河南 新乡 453007
  • 收稿日期:2008-04-01 修回日期:2008-05-03 出版日期:2008-11-11 发布日期:2008-11-11
  • 通讯作者: 曹西征

Intelligent music composition technology research based on genetic algorithm

CAO Xi-zheng,ZHANG Ai-li,XU Jiu-cheng   

  1. School of Computer and Information Technology,Henan Normal University,Xinxiang,Henan 453007,China
  • Received:2008-04-01 Revised:2008-05-03 Online:2008-11-11 Published:2008-11-11
  • Contact: CAO Xi-zheng

摘要: 为了利用遗传算法进行智能作曲,对由计算机自动生成音符序列和音频文件的具体问题进行了讨论。计算机根据预先设定的参数生成初始乐段群体,将对各乐段的人工评估结果作为适应度函数值,分别设定选择、交换和突变规则,通过时值修正来解决进化过程中乐曲每小节各音符的时值之和的不稳定问题,完成了音符序列的计算机生成问题。音频文件的产生通过建模和编码的方法实现。建立表示振幅与频率、时值之间关系的振动模型,其频率因子和时值因子分别取自音符编码中音高分量所映射的频率值和时值分量所映射的时间,根据此模型,结合数字音频技术,最终生成WAV音频文件,从而完成了音符到音频文件的转换。与目前MIDI形态的计算机音乐相比,WAV形态的计算机音乐具有很强的丰富性、灵活性和稳定性。实验表明,利用这种交互式遗传算法所创作的乐曲能基本满足部分人的情感表达需要和审美标准,对促进计算机音乐技术的发展有重要的科学意义。

关键词: 遗传算法, 智能作曲, 音符序列, 音频文件, 计算机音乐技术

Abstract: In order to compose music intelligently by genetic algorithm,the concrete question that how to create the music note sequences and the audio frequency file by the computer automatically is discussed.The initial groups of music paragraph are produced by the computer in terms of the pre-established parameters,the fitness function values are from the marks to the music paragraphs by manual work.The rules of the selection,crossover and mutation are set respectively.The unstable problem of the duration sum of the music notes in every bar in music during the evolutionary is solved by the duration correction,so the music notes are created by the computer.The audio frequency file is built by the method of modeling and coding.The vibration model expresses the relation among the amplitude,the frequency and the duration.In this model,the frequency value is from the frequency mapped by the pitch component and the duration value is from the time mapped by the duration component in the coding of music notes.So the wave form audio frequency file is built in terms of the vibration model and the digital audio frequency technology,and the transferring from the music notes to the audio frequency file is finished.Compared with the computer music in MIDI form currently,the computer music in WAVE form is abundant,flexible and steady.The experiment shows that the music created by the method of the interactive genetic algorithm can meet the emotional expressing requirements and the aesthetic standards of some people on the whole.And it is of important scientific significance for the development of the computer music technology.

Key words: genetic algorithm, intelligent composition, music note sequences, audio frequency file, computer music technology