如何将midi时间线转换成应该播放的实际时间线 [英] How to convert midi timeline into the actual timeline that should be played

查看:50
本文介绍了如何将midi时间线转换成应该播放的实际时间线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经研究了一段时间了,但仍然没有弄清楚.我使用 midas3 库 (Midi-actionscript3) 将 midi 导入到 flash.我在时间线上得到每个笔记项目.我得到了除法值 (192) 并且所有GET-TEMPO"元素都等于 81.

I have researched the subject for some time now and still haven't figure it out. I use midas3 library (Midi-actionscript3) to import midi to flash. I get each note-item on a timeline. I get the divisions value (192) and all of the "GET-TEMPO" elements are equal to 81.

我尝试了很多组合来获得 MIDI 的实际时间,但仍然不好(例如时间线*192/60).

I tried a lot of combinations to get the actual time of the midi but still no good (timeline*192/60 for example).

我知道它与实际时间不同步的原因是,当我将音符可视化为 flash 中的简单矩形时 - 我检查它们是否与 mp3 文件播放的内容完全一致(我已将 midi 文件转换为这个 mp3使用简单的转换程序)

The reason I know it is not synchronized to the actual time is that when I visualize the notes as simple rectangles in flash - I check if they appear exactly to what the mp3 file plays (I have converted the midi file to this mp3 using simple conversion program)

我已经阅读了很多关于如何计算所有内容的信息,但仍然没有弄清楚我需要使用的数字才能正确计算(时间线 * MysteriusConstant = ReaTIME,MysteriusConstant 的值是多少?它真的是常数吗?和如果不是我如何计算它是如何改变的?)

I have read a lot about how all is calculated but still haven't figure out the number I need to use to get it right (timeline * MysteriusConstant = ReaTIME, what is the value of MysteriusConstant? is it really constant? and if not how do I calculate how it is changed?)

谢谢阿隆

推荐答案

如果我正确理解您的问题,您基本上希望将每个 MIDI 音符的刻度转换为毫秒值,以便您可以沿着时间线直观地显示音符.

If I understand your question correctly, you basically want to convert the ticks for each MIDI note into a millisecond value so you can display the notes visually along a timeline.

所以首先,您需要使用分度和速度来确定单个刻度的值.该转换基本上如下所示:

So first, you need to use the division and the tempo to determine the value of an individual tick. That conversion basically looks like:

 [  1 min    60 sec   1 beat     Z clocks ]
 | ------- * ------ * -------- * -------- | = seconds
 [ X beats   1 min    Y clocks       1    ]

所以,在上面的转换中,X 是节奏,Y 是分度,Z 是从传入事件.您可以看到所有单位如何抵消,以秒为单位为您提供一个值.因此,该转换的精简版本是:

So, in the above conversion, X is the tempo, Y is the division, and Z is the number of clocks from the incoming event. You can see how all of the units cancel out, giving you a value in seconds. The condensed version of that conversion is therefore:

(60 * clocks) / (tempo * division) = seconds

请记住,此处以 seconds 给出的值是自 上一个 MIDI 事件以来的秒数,而不是从序列开始的秒数.您将需要保持此值的运行总计以构建一个连贯的序列.

Keep in mind that the value given here in seconds is the number of seconds since the previous MIDI event, not from the sequence start. You will need to keep a running total of this value to construct a coherent sequence.

这篇关于如何将midi时间线转换成应该播放的实际时间线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆