Comments (8)
I will check if time is big enough lose for accuracy or affects the sync of the midi file.
from midi-unreal.
I played a file of 230 sec. and measured time between onStart
and onStop
. It plays about 240 seconds -> 10 sec longer. About 2 sec lost per minute. For something like a rhythm game it's pretty huge.
from midi-unreal.
I figured out that my way of calculating elapsed ticks is wrong if Tempo changes more that once. So, instead I introduced 2 variables: lastTempoTime
and lastTempoTick
, which are initially set to zero then updated every time the Tempo is changed (set to time and tick of the Tempo event). With that elapsed ticks are calculated this way:
mTicksElapsed = lastTempoTick+ msToTicks(elapsedTime - lastTempoTime, mMPQN, mPPQ);
It seems to work well.
from midi-unreal.
I have found a workaround that doesn't require much change. I had to apply a 4% increase in PPQ to get a more accurate playback. I tested this on a 16 minute song and the result was 1 second off the original time [using Media player to check the midi time]. Other songs I tried get like a total of 1 second off the original total time.
double MidiUtil::msToTicks(long ms, int mpqn, int ppq) {
return ((ms * 1000.0) * (ppq * 1.04)) / mpqn;
}
so I don't think its the tempo change but rather slower tick playback
Is is possible to send me the changes on git or through email so I can check vs my temp solution
from midi-unreal.
Ok, I added my changes. There is also couple of other things, like GetMidiNotes
(access to notes for BP) and ProcessTo
(like Process but time is controlled externally).
from midi-unreal.
found issues with your workaround...found 1 midi that jumps forward while playing, another does not end properly.
http://www.midishrine.com/oter/ffmix1.mid [skips]
from midi-unreal.
I introduced a variable that lets the user decide the speed playback
from midi-unreal.
I have fixed up the timing issue. I have removed the long to double conversion
from midi-unreal.
Related Issues (20)
- Mac/IOS Users Readme HOT 1
- Join in on the Development
- Speed of 1.0 plays MIDI file too fast HOT 1
- Android Build issue with ver2.51 - UE4 4.17.2 HOT 1
- Mac/IOS unavailable due to UE4 (4.21) engine compiler bug HOT 1
- Is it working together with the midi plugin from Epic HOT 1
- Midi component disappears on engine relauch
- Linux rebuild issue
- In C++ example code FBufferReader is not a istream HOT 2
- 4.23 Compatible?
- Compatibility with low-latency drivers (WASAPI / ASIO)? HOT 2
- License clarification HOT 1
- Midi files should have a right click->Reimport option
- Allow midi playback in reverse
- Make the event time (On Tick and Off Tick) available in Break MidiEvent
- Expose the current playback time of a midi processor (without having to wait for the next midi event)
- MIDI variables disappear after restart HOT 1
- Marketplace version is no longer available?
- Any timeline for updating this for UE 5? HOT 1
- Using midi to trigger events for non-real-time capture HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from midi-unreal.