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

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

问题描述

我研究了一段时间的主题现在还没有弄明白。 我使用midas3库(MIDI-的ActionScript3)导入MIDI闪烁。我得到一个时间轴上每一个音符项。我得到的分歧值(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).

我知道这是不同步的实际时间的原因是,当我想象的音符闪光灯作为简单的矩形 - 我检查,如果他们恰好出现哪些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 的节奏,的分工,而以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

请注意,在这里秒给出的值是秒以来的 previous 的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天全站免登陆