We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
好的,这里有几个不同的问题,每个问题都有自己的困难。
MIDI 到 MP3 转换
假设您想要 MIDI -> SF2-> MP3,Timidity++ 源代码将是一个很好的起点。 Timidity++“可以通过将MIDI文件转换为PCM波形数据来播放它们”。 Timidity++ 的最新分支可以在 Github 上找到。
要转换为 MP3,您需要一个额外的工具。 LAME 将是一个很好的起点。将 Timidity 和 LAME 结合在一起,您可以通过 SF2 从 MIDI 转换为 MP3。该脚本说明了如何在不编写自己的应用程序的情况下实现这一点。
随机合成
您问题的另一个要素涉及随机生成的合成器,实际上无法通过上述方法轻松解决。如果我正确理解这个问题,您需要执行以下操作:
SF2 主要是基于样本的格式,如果您本质上想通过 MIDI 播放随机合成器并将输出保存到音频文件,则会引入不必要的复杂性。
为了解决您的问题,我建议跳过 SF2 步骤,并查看音频处理框架,例如 Synthesis ToolKit ( STK)。 STK能够读取MIDI文件和声音合成。然后,您可以使用 LAME 将音频缓冲区转换为 MP3。
OK, there are few different questions here, each with their own difficulties.
MIDI to MP3 conversion
Assuming you want to go MIDI -> SF2 -> MP3, the Timidity++ source code would be a good starting point. Timidity++ "can play MIDI files by converting them into PCM waveform data". A recent fork of Timidity++ can be found on Github.
To convert to MP3, you need an additional tool. LAME would be a good starting point here. Stitching together Timidity and LAME, you can go from MIDI to MP3 via an SF2. This script illustrates how this can be achieved without writing your own app.
Random Synthesis
The other element of your question, which concerns randomly generated synths, can't really be addressed easily through the above approach. If I understand the question correctly, you want to do the following:
SF2 is a primarily sample-based format, and would introduce unnecessary complexity if you essentially want to play random synths via MIDI and save the output to an audio file.
To address your problem, I would therefore suggest skipping the SF2 step, and looking at an audio processing framework like Synthesis ToolKit (STK). STK is capable of reading MIDI files, and sound synthesis. You can then use LAME for the audio buffer to MP3 conversion.