I’ve just found your asset and it looks very promising! Thanks so much for sharing it!
I’m now studing the code and I’m trying to find a way to get a frame rate indipendent and sample accurate player, maybe implementing it into OnAudioFilterRead.
I’m developing a rhythm game so my needs are:
Sync a background music track (wav, mp3, whatever)
Play MIDI and get events to handle gameplay
Since the gameplay is music based, the MIDI has to play no matter what, even if the frame rate drops drammatically, so I can’t rely on WaitForSeconds because it’s fps dependent.
Hi alexrshare
Seems a very good project that you have ! And thank for your kind comment.
Have you see the demo CatchMusic in MPTK ? It could be interesting for you : a midifile is loaded but midi events are not played immediately. A unity event is defined to receive list of midi events at each midi ticks (if there is midi events!). So you are independant of frame per second.
I’ve already seen CatchMusic demo.
Setting “V Sync Count” to “Don’t Sync” in Quality Setting and, just for testing, adding Application.targetFrameRate = 1;
in Awake method, of course the video is refreshed every 1 second but also the MIDI is played every second, which is what I want to avoid.
yes。details i know how to do that!
but i have one requirement。how can i play one song to a midi file
this plugin can do that?
i play some key just like c d e f g then i can export to a midi file out put?
Ok, perhaps I better understand your need. It could be an interesting function if you are using MPTK to generate note in real time. I will plan this evolution as soon as possible.
Best regards
thank you ! five stars wait for you! (。-ω-)zzz
and i will try ,found have some code on you code,maybe it can work
just like MidiEventCollection PrepareForExport
perhaps, you could contact me on my private adresse mail (see MPTK Unity Store) to better describe your project. Writing midi file is not a complex task, technically speaking, it’s more tricky to understand how integrate this function with MPTK and keep consistency of the whole. There is a lot of approach possible ! Thank.
Hi all
The version 1.9 Pro is waiting for the Unity review. Could be available in a few days. New functions available:
Added new MidiListPlayer GameObject able to lead Midi play list
Added new class to write Midi file from MPTK
Added capacity of playing multiple waves for one note when SoundFont contains overlapped zone
Added processing of the Panoramic SoundFont parameter when playing waves
Added processing of the Attenuation SoundFont parameter when playing waves
Added ReleaseTime change with MidiStreamPlayer Inspector
I REALLY like what you have built and intend to use it for several music games. But, when I create a midi file
using Band In A Box, and play it using the Free MPTK, it sounds like an old fashioned midi game from the 1990’s. But, when I play the same song on my computer as a midi file, it sounds full and correct. Is this caused by the soundfonts used in the free version? If I purchase the PRO version will this allow me to select fonts which will sound more natural and professional?
Hello I’m sorry for the delay in response. There is no Unity notification when a new comment is publish.
To answer : MPTK use a simplified SoundFont model to avoid heavy calculation and installation of other components. Some Midi don’t sounds like a synthesizer or a computer but generally, the sound is good !
Please send me your Midi or a link, I will have a look to understand the issue.
I’m working on a version 2 to implement some effects as filters, chorus, adsr, … to get sounds near a classical synthesizer, it’s quite complex ! So, the price of the Pro version will increase … of course with no change for current owner of the Pro! They will get the update for free.