从 MIDI 中提取音符开始

发布于 2024-09-03 11:25:15 字数 445 浏览 3 评论 0原文

我需要从复调(高音和低音有 2 个乐谱 - 低音也可能有和弦)MIDI 文件中提取音乐特征(音符详细信息 -> 音高、持续时间、节奏、响度、音符开始时间)。我正在使用 jMusic API 从 MIDI 文件中提取这些详细信息。我的方法是仔细检查每个乐谱,分成部分,然后是乐句,最后是音符并提取细节。

按照我的方法,它首先读取所有高音音符,然后读取低音音符 - 但不会捕获和弦(即仅获取和弦的单个音符),并且我无法确定从哪一点开始是低音音符。 所以我尝试的是获取音符开始(即正在演奏的音符的开始时间) - 因为乐曲开头的高音和低音音符的开始时间应该相同 - 但我无法使用提取音符开始j音乐API。对于每个音符,它显示 0.0。

有什么方法可以识别音符的声音(高音或低音)吗?还有和弦的所有音符?每个音符的声音或音符开始是如何存储在 MIDI 中的?每个 MIDI 文件的情况都不同吗?

任何见解都将受到高度赞赏。提前致谢

I need to extract musical features (note details->pitch, duration, rhythm, loudness, note start time) from a polyphonic (having 2 scores for treble and bass - bass may also have chords) MIDI file. I'm using the jMusic API to extract these details from a MIDI file. My approach is to go through each score, into parts, then phrases and finally notes and extract the details.

With my approach, it's reading all the treble notes first and then the bass notes - but chords are not captured (i.e. only a single note of the chord is taken), and I cannot identify from which point onwards are the bass notes.
So what I tried was to get the note onsets (i.e. the start time of note being played) - since the starting time of both the treble and bass notes at the start of the piece should be same - But I cannot extract the note onset using jMusic API. For each note it shows 0.0.

Is there any way I can identify the voice (treble or bass) of a note? And also all the notes of a chord? How is the voice or note onset for each note stored in MIDI? Is this different for each MIDI file?

Any insight is greatly appreciated. Thanks in advance

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

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

发布评论

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

评论(1

云朵有点甜 2024-09-10 11:25:15

您可能想看看这个问题:MIDI 持续时间的实际音符持续时间

讨论了从 MIDI 文件中提取音符的可能方法。

考虑到 MIDI 文件可以拆分为多个轨道(“类型 1”midi 文件)。

一旦你确定了音符,识别和弦仍然很棘手。假设您有 3 个音符:C、E、G “同时”发生(即在一个小节的同一点被识别为声音)。它们何时被视为 C 大调和弦?

  • 在同一通道上演奏
  • 由同一乐器演奏(即使在不同的通道上)
  • 在同一通道上演奏 即使它们出现在不同的轨道上

Midifile 格式非常简单(甚至可能太简单了!!) 我建议你看看它此处描述:http://duskblue.org/proj/toymidi/midiformat.pdf

You might want to have a look at this question: Actual note duration from MIDI duration

Where a possible approach to extracting notes from a midi file is discussed.

Consider that a MIDI file can be split on multiple tracks (a "type 1" midifile).

Once you have identified notes, identifying chords can still be tricky. Say you have 3 notes: C, E, G happening "at the same time" (i.e. having been identified as being sound at the same point in a measure). When are they to be considered the C major chord?

  • played on the same channel
  • played by the same instrument (even if on different channels)
  • played on the same channel even if they appear on different tracks

Midifile format is very simple (maybe even too simple!!) I suggest you have a look at its description here: http://duskblue.org/proj/toymidi/midiformat.pdf

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