如何在C#中将声波转换为midi?

发布于 2024-09-10 14:23:04 字数 79 浏览 6 评论 0原文

有谁知道如何将模拟声波转换为 MIDI 文件?

我知道 WAV 和 MP3 有所不同,但现在这并不重要。我只想学习转换的基本逻辑。

Does anyone know how to convert an analog sound wave to a MIDI file?

I know that differs from WAV to MP3, but that's not important for now. I only want to learn the basic logic of the conversion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

友谊不毕业 2024-09-17 14:23:04

我知道你想编写自己的波形到 MIDI 转换器。

然而,我不知道有几家公司拥有执行波形到 MIDI 转换的软件。

为了感兴趣的人的利益,这里有一个 音频到 MIDI 程序的列表

我选择了 WidiSoft 网站进行查看,因为它位于列表顶部,并在谷歌搜索中名列前茅。英语不是他们的母语。但是,您可以在购买之前下载并试用该软件。

这不是产品评论,但根据您的转换需求,您应该能够找到已经存在的东西。

I realize that you want to write your own wave to MIDI converter.

However, I had no idea that several companies have software that performs wave to MIDI conversion.

For the benefit of those interested, here's a list of audio to MIDI programs.

I picked the WidiSoft web site to check out because it was at the top of the list, and came up high in a Google search. English is not their first language. However, you can download and try the software before you buy it.

This isn't a product review, but depending on your conversion needs, you should be able to find something that already exists.

黎歌 2024-09-17 14:23:04

波是某种声音的实际声波。
MIDI 可以被认为是在预定义乐器(存储在计算机或声卡上)上演奏的音乐音符。

因此,midi 生成的声音是可以存储在波形文件中的声音的子集。这意味着您无法将wave转换为midi(尽管您可以反过来进行)。

如果您了解有关您希望转换的波浪的某些信息,那么它可能是可能的。例如,如果您知道波形仅包含一个paino,则可以将其转换为音符,然后再将其转换为midi。

A wave is the actual sound wave of some sound.
A midi can be thought of as notes of music played on predefined instruments (stored on the computer or on the soundcard).

Therefore, the sound generated by midi is a subset of sound that can be stored in a wave file. This means that you can not convert wave to midi (although you can do it the other way round).

If you know certain things about the waves you wish to convert it might be possible. If, for example, you know that the wave contains only a paino, it might be possible to convert that into notes and from that to midi.

我很坚强 2024-09-17 14:23:04

使用《基因编程:蒙娜丽莎进化》项目的想法,但应用于声音而不是图像。

Use the ideas from Genetic Programming: Evolution of Mona Lisa project, but applied over sounds instead of images.

热风软妹 2024-09-17 14:23:04

在我看来,您应该首先将音频分成小片段(每个片段可能为 0.25 秒)。然后,您可以使用 FFT 获取每个剪辑所需的尽可能多的频率和相关幅度(也许 8 个?)。然后您可以将频率四舍五入到最接近的音符。然后我认为将其转换为 MIDI 非常容易,至少在这个基本级别上是这样。因此,您需要编写对音频剪辑进行采样的 C# 软件(已完成:请参阅 NAudio),然后获取(我不知道在哪里)对剪辑进行 FFT 的软件。将频率转换为音符就是查表。您也可以找到进行转换的商业软件:https://www. celemony.com/en/melodyne/new-in-melodyne-5

It seems to me that you should first break the audio into small clips (maybe .25 sec each). Then you could use FFT to get as many of the frequencies and associated amplitudes you require for each clip (maybe 8?). Then you could round the frequencies to the nearest note. Then I think the conversion of that to MIDI is pretty easy, at least at this basic level. So, you need to write C# software that samples the audio clip (done: see NAudio), and then obtain (I don't know where) software that does the FFT on the clip. Conversion of frequency to a note is a table lookup. You can find commercial software that does conversion too: https://www.celemony.com/en/melodyne/new-in-melodyne-5

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文