另一个使用mass(示例序列中的音乐和音频)框架的音乐包
musicLegac的Python项目详细描述
这个项目提供面向音乐的声音合成程序 在基于样本的系统中。音乐可以作为一个样本水平 DAW系统,其中被操纵的对象实际上是数组 描述到达听者耳朵的声波的样本。 使用mass(采样序列中的音乐和音频)建模[1][2]。
安装时使用:
$ pip3 install musicLegacy
破解演示歌曲并制作wav文件:
$ python3 tests/testSong.py
要收听testsong.wav或
$ python3 tests/testSong2.py
听到vibrosong.wav。要破解大批量软件包本身,并从回购协议中使用它,请不要忘记:
$ pip install -e <path/to/repo>
实时是可能的,但重点不是: 所有参数均按样本和计算进行更新 以64位浮点表示。所有操作由 直接将音频样本与音乐方面联系起来的方程式。 详细说明请参见:
- “声音离散时间表示中音乐元素的心理物理学”一文:http://arxiv.org/abs/1412.6853
- 硕士学位论文“m_sica no_udio digital:descrip_o psicofica e caixa de ferramentas”:https://github.com/ttm/dissertacao/blob/master/dissertacaoCorrigida.pdf?raw=true
还要检查音乐python包:https://github.com/ttm/music
用法示例
从一个gmane列表下载消息:
importmusicLegacyasm# sine, triangle, square and sawtooth# are attributes of the bt object:bt=m.BasicTables()# for frequency to midi and decibels to amplitude relations:co=m.BasicConverter()# try co.db2Amp .amp2Db .hz2Midi .midi2Hzsy=m.Synth()note=sy.render()ut=m.Utils()ut.write(note)# saved to fooname.wavmelody=n.hstack([sy.render(f,.2)forfinco.p2f(220,[0,7,7,5,6,7,0,4,7,0])])sy.vib_depth=3.sy.vib_freq=3.sy.tab=bt.sawsection2=n.hstack([sy.render(freq,dur)forfreq,durinzip(co.p2f(110,[0,7,7,5,6,7,0,4,7,0]),[.2,.4,.2,.2,.8,.2,.4,.2,.4])])song=n.hstack((melody,section2))ut.write(song,"song.wav")# A core purpose of the toolbox is to serve other# toolboxes on the development sonic representations# E.g. m.pieces.FourHubsDance is used by gmane toolbox# to make sonified animations:# https://www.youtube.com/watch?v=YxDiwzAUPeU# sonicLine1 and sonicLine2 attributes are# most basic sonic "templates" used by:# https://pypi.python.org/pypi/gmane to make social music# more in the way. Take a look at the above literature.# Enjoy!