python 背景音乐程序代码_歌曲背景音乐生成方法探讨

你可以从一开始考虑吉他手必须做些什么才能成功地伴唱一个歌手,在这种情况下,他们事先不知道歌曲的主调、和弦进行或节奏(更不用说它的结构、风格等)

在伴奏者(人类或计算机)以前没有听过这首歌的情况下实时进行这项工作将很困难,因为它需要一些时间来分析正在唱什么,以便对伴奏做出适当的音乐选择。一个吉他手或其他音乐家在现实世界中有这种能力将被认为是高度熟练的。在

如果你没有音乐背景的话,这听起来是一个很有挑战性的项目,持续1.5个月也许简单的模式会起作用-也许,但是有很多简单的模式是可能的!在

不那么雄心勃勃的项目可能是:录制一整首歌并分析,然后渲染背景(仍然是

很多工作!)在

创造一条单一的和声线或部分

人声和声效果

基于

用户输入和弦级数

编辑回复您的第一条评论:

如果你想产生一个完整的伴奏,你将需要(如你所说)同时处理键和和弦的进展,以及计时(包括时间签名和检测哪一个小节是“beat 1”)

获取这一级别的定时信息这可能很困难,因为仅从语音中检测节拍是不可能使用标准技术从歌曲中获取节拍(在特定频率范围内寻找振幅峰值)。在

你可能仍然会得到好的结果,根本不计算时间,只是简单地弹你的和弦与歌曲的开始(或其中的一个子集)。在

然后你需要做的就是检测音符。这篇文章是关于在python中检测音调的:Python frequency detection。振幅检测更直接。在

想出一个算法来计算出这首曲子的根音符(更大胆地说,是它变化的地方)。在某些情况下,仅仅从旋律上是很难分辨的。您可以先假设第一个音符或最常见的音符是根音符。在

想出一个生成和弦级数的算法(在网上搜索“和谐旋律”)。很明显,在客观上没有正确或错误的方法来做到这一点,你可能只有在有限的风格范围内才能令人信服地做到这一点。你可以先假设一个有限的和弦子集,例如I,IV,V。这些和弦应该适用于大多数简单的“童谣”风格的曲调。在

当然,如果你把自己局限于从beatone开始的简单曲调,你可能会更容易地计算出时间特征。总的来说,我认为你的成功之路应该是先处理简单的案件,然后再接再厉。在

ReadMe Release Version beta_1.0 index.py imageMatlab.py This is more or less a wrapper for Matplotlib imaging functions such that their behavior is equivalent, in terms of colormap, aspect and so forth, to the expected behavior of Matlab's functions. sepVocal.py This script can be used to execute the desired separation. See below for an example of use of this file. SIMM.py This script implements the actual algorithm for parameter estimation. It is mainly used by sepVocal.py. tracking.py The Viterbi decoding algorithm is implemented in this script. Requirements: These scripts have been tested with Python 2.7, The packages that are required to run the scripts are pydub,ffmepg, Numpy, Spicy, Matplotlib. One can respectively find the latest versions at the following addresses: http://pydub.com/ https://ffmpeg.org http://numpy.org/ http://scipy.org/ http://matplotlib.sourceforge.net/ Notes: Prefer recent versions of the above packages, in order to avoid compatibility issues, notably for Matplotlib. Note that this latter package is not necessary for the program to run, although you might want to watch a bit what is happening! Spicy should be version 0.8+, since we use its io.wavefile module to read the wave files. We once used the audio lab module, but it would seem that it is a bit more complicated to install (with the benefit that many more file formats are allowed). Usage: The easy way to use these scripts is to run the exec package of our release version: http://www.github.com/beata_1.0 for more develop: you can run the index.py on pycharm directly. note: the output files will create under you source wav file. ContactMe Email:xlzhang14@fudan.edu.cn
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值