Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Maestro Midi Player Tool Kit - Good news for your rhythm game !

Discussion in 'Made With Unity' started by BachmannT, Apr 14, 2018.

  1. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    **********************************************************************
    Please leave a kind review on the Asset Store. It's very motivating!
    **********************************************************************


    Assets: Free MPTK and Pro MPTK

    Info 09 Marsh 2024

    Version 2.11.3 in progress:
    - ExtendedText attribut for lyrics and all META text
    If the value is true, Text for META (e.g. lyrics) will be write with UTF8 encoding. The default is false.
    The MIDI standard only allows ASCII characters for this META, but with this extension you will be able to read and display characters like Korean, Chinese, Japanese and even French accented letters
    To enable reading of UTF8 characters from an MPTK MIDI player, set the MidiFilePlayer#MPTK_ExtendedText attribut to true.
    This is an MPTK extension of the MIDI standard, so if you read your MIDI file with another application, you may not find your original text.

    Example of text:
    Code (CSharp):
    1. Example of text:
    2. mfw.AddText(track: 1, tick: absoluteTime, typeMeta: MPTKMeta.Lyric, text: "only ASCII");
    3. mfw.AddText(track: 1, tick: absoluteTime, typeMeta: MPTKMeta.Lyric, text: "リリックテキスト");
    4. mfw.AddText(track: 1, tick: absoluteTime, typeMeta: MPTKMeta.Lyric, text: "抒情文字");
    5. mfw.AddText(track: 1, tick: absoluteTime, typeMeta: MPTKMeta.Lyric, text: "가사 텍스트");
    6. mfw.AddText(track: 1, tick: absoluteTime, typeMeta: MPTKMeta.Lyric, text: "français éôè");
    7. mfw.AddText(track: 1, tick: absoluteTime, typeMeta: MPTKMeta.Lyric, text: "Norsk språk");
    Info 12 February 2024
    Version is soon available on the Unity store with technical improvement and a new feature:

    • Technical improvement:
    • All MPTK sources are provided, which is great for understanding how MPTK works. However, a drawback is that when a change is made, even in your own script, the entire MPTK is recompiled, leading to unnecessary delays. The upcoming version split the sources into three assemblies, resulting in better separation and improved efficiency for your creations.
    • If your app doesn’t define any assemblies, this change won’t affect anything (just better building perf!). However, if you do have assemblies, you’ll need to reference the MidiPlayer.Run assembly in your own assembly (in general, only MidiPlayer.Run).
    • New feature (Pro only):
      • The upcoming feature will allow you to create an MPTK runtime without including a SoundFont. With one line, an enhanced API will facilitate downloading, caching, and loading a SoundFont while your application is running. Another benefit is that you’ll be able to offer different sets of instruments to your users, which is perfect for implementing your in-app purchasing feature.
      • Look at this post for detailed information.
    Info 12 December 2023
    • Version 2.11.1 available on the Unity store with two fix.
    • Remove weird using inserted by Unity.
    • A "using UnityEngine.Purchasing" has been added to the script fluid_voice.cs. It's not the first time, does anyone have an explanation why Unity sometime adds unwanted using directive?
    • Align MIDI list events in demo TestMidiFileLoad.

    Info 4 December 2023

    • Version 2.11.0 available on the Unity store!
    • Maestro MPTK attained the age of maturity. This new version is mainly focused on consistency and simplification. I hope you will appreciate it!
    • Unfortunately, API consistency affects existing projects. A helper is available to assist you with the migration. We tried to minimize your changes and provide a complete documentation.
    • See News! for more details.
    • helper here



    Info September, 24 2023


    Info August, 28 2023

    • 5 Years Old Anniversary!
      Discover all the gifts with the version 2.10.0 in the release notes here.

    Info August, 21 2023
    • Version 2.10 is ready and will be soon published!
    Info July, 28 2023
    • A new version will be soon available with cool new features! So the 2.9.2 will be a 2.10.0:
      • New attributes Measure and Beat associated to each MIDI events
        • Take care of Time signature change
        • OnBeatEvent
      • New class MPTKInnerLoop for accurate looping inside the MIDI player with
        • Start, Resume, End, Max
        • OnEventInnerLoop event.
      • New feature for the MIDI Editor
    • Warning: with Mac M1 and M2 architecture, in some case the DSP buffer length is not a multiple of 64: no sound will be produced or error will be displayed.
      • Try to change the 'DSP Buffer Size' in the Unity Editor menu 'Edit / Project Settings / Audio' with value 512 or 1024.
      • A dedicated Maestro error log message will be displayed with the next version.
    • Also, a strong update of the use case page: https://paxstellar.fr/use-case/ It's a good start point to understand Maestro!
    Info May, 17 2023
    • Warning: if you are publishing an app for Android and using IL2CPP and
      set managed code stripping, you will not get music in your app. That will be corrected in the next version. Nevertheless, if you have an urgent need, contact me, I will push you the change to be done (quite simple).
    • Version 2.9.2 is in progress:
      • Add Preserve attribute to disable Unity linker strips (see above).
      • Add MIDI real time message to MidiKeyboard plugins.
      • TestMidiKeyborad: better design + play a MIDI file with an external synth.
      • MIDI Editor: calculate and display real time related to the tempo change.
    Info May, 12 2023
    • Version 2.9.1 available!
    • MIDI Editor: Add loop points with UI [Pro] + new keyboard shortcut
    • New looping attributes: MPTK_TickStart, MPTK_TickEnd, MPTK_ModeStopVoice, MPTK_TickPlayer.
    • Regression corrected, restore FLUID_ATTEN_POWER_FACTOR to -531.509f (some voices was not played at low velocity)
    • Apply Speed change also on notes duration.
    • Better musicality, thank to MPTK_CutOffVolume default value set to 0.0001f, was 0.05
    • MidiLoop demo update
    • version 2.9.2 on the rail ...
    Info April, 30 2023
    • Horrible regression with the last version. The change of the FLUID_ATTEN_POWER_FACTOR value was not a good idea.Thank Silverknight to inform me and for the help to correct. I will restore to the previous value ASAP.
    • In the meantime, you can change this value in fluid_conv.cs to -531.509f. I apologize for this issue.
    Info April, 23 2023
    • After 6 months of hard works, Maestro version 2.9.0 is now available on the Unity store.
    • Two major upgrades
      • Add a MIDI Editor in Unity Editor. It's a base version with the most valuable features.
      • Full rewrite of MidiFileWriter2 class [Pro].
        • Now based on MPTKEvent.
        • New features: add MIDI File insert and join features with MPTK_ImportFromEventsList in realtime.
    Have Fun!​

    Info April, 14 2023

    • Issue corrected!
    • Maestro MPTK not available on the Unity asset store, free and pro :(
    • I opened an issue and keep you inform.
    Info February, 20 2023
    • Version 2.9 will be soon published. The base class of the MIDI reader/writer has been rewritten. That was mandatory for the sequencer (and a lot of works!). But the first benefit was for the MidiFileWriter2 class.
    • MidiFileWriter2 has been largely rewritten. Now based only on MPTKEvent it's easier to create a MIDI file by script.
    • For example, it's now possible to join MIDI files when MIDI is playing! A new demo about this features will be also available.
    • BTW, the sequencer is behind the schedule. A first version will be available but with limited possibilities (no saving, no velocity edit, ...). That will be an opportunity to talk with you about the future of the sequencer!
    • Have Fun!
    Info December, 28 2022

    • Just an overview of the future of Maestro: a MIDI sequencer in edit mode. For now, it's just a POC (far away of a beta) to check that it's possible in editor mode. The result is ok, but there is still a lot of work to be done!!!
    • Done:
      • importing MIDI files
      • real time MIDI player in Unity edit mode
      • real time editor
      • start from scratch and build your music
      View attachment 1172301
    Info October, 04 2022
    • Some disturbance on the site paxstellar.com, please visit this site https://www.paxstellar.fr/to get all the information you need!


    Info September, 27 2022
    • V2.89.5 is available!
      • Now playing MIDI is also possible in editor mode. It will be more easy to check your MIDI without running an app. Perhaps the premise of a built-in MIDI Sequencer Editor? See a short video here.
      • Add some stat calculation from MIDI file in the editor. It's also very useful to understand how to process a MIDI file without running an app.
      • New MVP demo: read a MIDI file, add some MIDI events, and write in a MIDI file with a few lines of script (see SimplestMidiWriter). Pro version.
      • Corrected: MidiFileWriter2.MPTK_LoadFromFile is now working.
      • Method MidiLoad.MPTK_LoadFile is now available only in PRO version.
        MidiKeyboard (connect an external synth) is now available for CPU Silicon (M1, M2, ...) on Mac. Pro version.

    Info September, 10 2022
    • Good news for the WebGL compatibility, a Unity issue is open. We need your up-vote to accelerate the process. Thanks.
    • V2.89.5 is quite ready to be deployed. I like the editor extension able to play a MIDI ... without running any app, I hope you too!
    Info August, 20 2022
    • V2.89.5 is in progress ...
    Info July, 15 2022
    • V2.89.4 is available!
      • New SoundFont Import: select sample format (experimental).
      • New MVP Free: TheSimplestMidiGenerator, a "Hello world" demo.
      • Replacing obsolete Unity API functions.
      • MPTK_Play is now available for MidiFilePlayer and MidiSpatializer prefab (Pro).
      • Improvement of the pause on distance when Spatialization is on.
    Info May, 29 2022
    • V2.89.3 is available!
      • Update to integrate the last version of Oboe (Fight Android Audio Latency)
      • Change tempo by script with MPTK_Tempo very easily. Ex:MPTK_Tempo = 120 (before, only MPTK_Speed was able to change the speed)
      • New MVP example to show how integrate in a few lines of script a MIDI device (Maestro Pro).

    Info April, 22 2022
    • Hello Maestros! Just to inform you for some possible disturbance to access Maestro MPTK site https://paxstellar.fr
      I'm migrating this web site to another web hosting company and registrar. I hope that you will not have too much issues! Take me inform.

    Info Marsh, 21 2022
    • V2.89.2 is available!
      • Update MidiFilePlayer inspector: add filter on the popup MIDI list for selecting a MIDI.
      • Corrected MidiStreamPlayer which was not able to spatilize the sound (Unity Spatialization).
      • Update TestMidiStream: demo how to play MIDI events with the keyboard. 0-9: play notes, Arrow keys: change preset.
      • Apply Sample Rate setting when loading SoundFont to be able to play Vorbis samples (Thank to Paul).
      • Add exception detection on all callback (like OnEventNotesMidi) to help detecting error in your script.
      • New design for MIDI and SoundFont Setup Windows. Now works fine with MacOS :)
    Info December, 08 2021
    • V2.89.2 is in progress!
    • New page on the web site for sharing with us your creation. Contact us!
    Info November, 30 2021
    Info October, 11 2021
    • Version 2.89.1 is available!. It's a patch version, some fixes and quick enhancements.
      • Add helper link for the MidiFileLoader inspector and a related page on the web site.
      • Add delayed start to MPTK_Play (Pro version)
      • Add delayed stop to MPTK_Stop (Pro version)
      • Add short script demo for MIDI looping
      • Correct instantiation for all MPTK OnEventxxxx to avoid crash in rare cases.
      • Corrected: Preset change for channel 9 was disabled
      • New kind of demos are also available: MVP (for Minimum Viable Product) has just enough core features to effectively deploy the product, and not more. Very efficient to understand how using Maestro.
        • MVP Free: MidiLoop and TheSimplestMidiLoader
        • MVP Pro: Spatializer3D for spatializing MIDI by tracks in a few lines of code
    Info September, 6
    • Finally it's a version 2.89.0 because there is a lot of new functions! See below:
    • OnMidiEvent can be used like a preprocessor of the MIDI events: it's possible to change the value of the MIDI events in real time . [Pro]
    • MPTK_TransExcludedChannel method useful to exclude a channel for transposing (in general, channel 9 for drums).
    • MPTK_keepPlayingNonLooped properties: when set to true, NoteOff or Duration for non-looped samples are ignored and the samples play through to the end.
    • Synth rate can be set to any value from the inspector or with MPTK_SynthRate.
    • Output rate and buffer size can be modified when playing but only for test purpose.
    • Added changing output rate and buffer size for iOS, but stay experimental.
    • MPTK_ChannelPresetChange: apply bank and preset change even if not available but return false.
    • MPTK_ChannelForcedPresetSet: apply bank and preset change even if not available but return false, able now to force bank.
    • MPTK_RealTime properties: real time since the start of the MIDI.
    • MPTK_KeepEndTrack properties: when set to true, meta MIDI event End Track are keep. Default is false.
    • MPTK_TickLastNote properties: tick position for the last note-on found.
    • MPTK_PositionLastNote properties: real time position in millisecond for the last note-on found in the MIDI.
    See Version release for a full description.
    Have Fun!​

    Info August, 24
    Info July, 23
    Info July, 19
    • version V2.88.3 in progress ...

    Info June, 21
    • Oyez! Oyez! Version 2.88.2 is available!
    • Very important, please read if you have issue when updating: package manager is buggy with some Unity versions. Try to use the latest LTS Unity version possible. For today:
      • With Unity 2020: LTS Release 2020.3.12f1,
      • With Unity 2019: LTS Release 2019.4.28f1
    Info June, 18
    • Finally, we choose Unity 2019.4.28 to ensure a good stability. Obviously, Maestro remains also compatible with higher Unity versions.
    • We hope the version 2.88.2 will be available beginning newt week.
    • Have Fun!
    Info June, 17
    • Finalizing the spatialisation by tracks took longer than expected ... but the version is now ready.
    • Helas, we got a minor setback when publishing version 2.88.2 with the 2017. Unity team say : "New assets should not be submitted through Unity versions earlier than 2018.4.0 LTS"
    • While we are at it, we decided to move Maestro to a recent Unity version: the LTS 2020.3.0 or 2019.4.28.
    • We hope that any developers need to use an earlier version !

    Info May, 22
    • Version 2.88.2 on the road!
    • Get a look here on this discord server dedicated to Maestro app's. It's a funny place for talking about new version, explain your need, exchange between users. But I'm a newbie with discord, I need your help to animate this server and your advice. You are all welcome!!!
    • Some new methods added:
      • MidiFilePlayer.MPTK_ReadMidiEvents
      • MPTKEvent.MTPK_GetSynthParameterDefaultValue, MTPK_GetSynthParameterLabel, MTPK_GetSynthParameterListGenerator, MTPK_ClearSynthParameter [Pro].
      • MidiFileLoader.MPTK_SearchMidiToPlay
    • Demo SpatializerFly: new look and capacity to defined 3D sound by midi tracks on top of midi channels.
    Info April, 19
    • Version 2.881 is available! Fast review!
    • A user report some difficulties to update with this new version. Contact me if you have difficulties or error after updating. Unity Package Manager seems not absolutely reliable.
    • Main new functions
      • Midi Meta Event KeySignature and TimeSignature are now processed!
      • Look at the new entry in the MPTK menu: version detail and quick access to documentation and a new windows give a quick access to the 15 demos available.
    View attachment 836614

    Info Marsh, 23
    • Version 2.88 is on the way !
      • Soon, a little change for the name "Midi Player Tool Kit" name ... to be continued.
      • Always more accuracy for the midi player:
        • Better calculation of the real time of each midi events . Now, takes into account Tempo Change.
        • A new properties with each midi events give you the time of the event. See RealTime in MPTKEvent class.
      • A lot of improvements for MidiFileWriter2!!!
        • Get automatic creation and ending of tracks.
        • Create a list of midi events and play it with the internal MPTK midi sequencer (no temp file created).
        • Dedicated methods to create each kind of midi event
      • Thanks for your comments, talks, mails, that help me to make MPTK better!!!

    Info December, 29
    • Version 2.87 Pro is available !
    • New features available :
      • New MPTK event triggered by the audio engine. Absolutely essential if you are writing something like a sequencer or a rhythm game. Generated Music becomes very accurate !
      • Read a full description here.
      • Update of the "Midi Euclidean Rhythms" demo. Mainly to check the added event but also with a lot of good function to play music.
    Info December, 02
    • Oyez! Oyez! version 2.86 is available. Thank to a very quick validation in 3 hours by the Unity team this morning.
    • Main new features:
      • Android: Ready to fight latency with the integration of the Unity asset Oboe. No code to write, just bought Oboe! [Pro].
      • Synthesizer: Real time synth parameters modification. Now you can hange the default SoundFont generator value (ADSR, LFO, Effect, ...) by script for each voices [Pro].
      • Midi Device: To reduce latency with Midi keyboard, add possibility for reading midi events from a device with a callback [Pro].
      • See "version change" for other features.
    • Look here for Oboe integration in MPTK https://paxstellar.fr/oboe-fight-android-latency/
    Some screen shot ...

    Synth parameters available for real time change:
    View attachment 747475

    This demo (with MPTK Pro) is useful to test latency but also the MPTK synthesizer voices run time effects and running different players at the same time. So, there is two prefabs MidiStreamPlayer for the drums and one MidiFilePlayer for the midi running at the same time.

    An APK is available for those who want to test on their Android. Ask me by email, i will send you a link to the APK Euclidean Rhythm. Of course, I would be very happy to have your return.


    Info November, 16
      • New class MidiFileWriter2 but the previous (MidiFileWriter) is maintain until the next major version. MidiFileWriter2 proposes a more consistent behavior with the others classes of MPTK and new helpful functions.
      • Warm your keyboard! https://paxstellar.fr/class-midikeyboard/ Midi output device capabilities on top of Midi reading has been added [Pro]. As usual, a demo (simple) is available.
      • And as usual, some issues corrected, see Release Notes.
      Have Fun!
    Infos october, 02
    • We had a talk with a person wondered if a sequencer is available with MPTK. The answer is yes and no! Yes there is a Midi Sequencer able to play Midi file in background, and no, there is not an User Interface to create you own sequence. We considered that there is a lot of free sequencers able to do that better than with Unity which is limited with it's Graphical User Interface (GUI). But the question is open! Please, give your opinion if you think that a GUI Sequencer in MPTK could be interesting. Thank by advance for your response.
    Infos september,18 (a lot of news!):
    • Please, have a look to this Important update on the MPTK web site : Scripting with MPTK. I hope that will help persons who want to develop scripts with MPTK.
    • If you want to update MPTK to 2.841, please remove your previous version: delete folder MidiPlayer from the project tab. I apologize for that, but sync update don't remove source file which are deleted in the new version, so conflict are detected.
    • Version 2.841 s available on the store :)
    • Horrible! The design of the two editors windows, Midi File Setup and Sound Font Setup, was ugly with Unity 2019 and 2020. Thank Unity to modify the default style of GUI!!! Corrected with this version.
    • You often ask for this function: add all Midi from a folder. Done!
    New design for Midi File Setup and Sound Font Setup




    Version 2.84 is available on the store :)
    • Now switching between Midi playing is immediate.
    • Add functions to facilitate integration with Bolt [Pro]
    • Start and Stop playing gradually (ramp-up) [Pro].
    • Now Midi play also with Time.timeScale = 0.
    • And globally, a lot of enhancements on the demos (7 for free, 6 more with the pro version).
    Have Fun !

    Version 2.83 is available on the store :)
    • This version adds great enhancement for spatialization. MPTK is ready for Virtual Reality and Augmented Reality applications
    • The spatialization by channel/instrument [Pro] defined the position of each instruments in the 3D world.
    • Have a look the the video below: you can fly inside a whole orchestra and listen for each instrument individually. The demo is available with the Pro version.


    Main 2.82 new functions:
    • Builder for music range and chord which is useful for algo music - [Pro]
    • Integration with PlayerMaker and Adventure Creator - [Pro]
    • Spatialization capabilities, ready for your Virtual Reality project. [All versions]

    Main 2.81 new functions:
    • Add fluidsynth effects for standard SoundFont effects and integration with Unity effects [Pro]
    • Add integration with Cinematic Sequencer - Slate [Pro]
      Watch here a quick tuto:


    and the dedicated page on the MPTK web site.

    Version 2.7
    • Midi Sequencer totally rewrited from the awesome fluidsynth: better processing of midi pause, change position, change tempo, speed, ...
    • Separate thread: better performance for complex Midi when a lot of samples are played simultaneously. Parameters are availables to adjust the level of performance need.
    • Load SoundFont from the web or desktop while running. It is no longer necessary to load the SoundFont in the DB before playing [PRO]
    • Start playing from the first note.
    • Pause when focus loss. Essential for smartphone !
    • Set default interpolation mode to Linear for a better sound (previous version was set to None).
    Also, for advanced needs, three preprocessors directives are available to help understanding the performance:
    • DEBUG_PERF_AUDIO
    • DEBUG_PERF_MIDI
    • DEBUG_STATUS_STAT
    The demo TestMidiFilePlayerScripting has been adapted to display the performance KPI.


    Version 2.65 available:

    ⭐ Add Midi input functions (Windows and MacOS only) [PRO]. Thank to the new Prefab MidiInReader and the API to read a Midi keyboard. Integrate your Midi keyboard in a few clicks!
    ⭐ Change Unity Audio buffer size and synth rate for again better tempo accuracy, better sound, low latency.
    ⭐Full rewrite of the MidiListPlayer Inspector [PRO]. Now you can play part of a Midi, choose time to start and stop, choose overlap before the next Midi in the list.
    ⭐See also the new demo based on Euclidean Rhythm Algo. It's a rhythm box that could become a complete application.
    ⭐ Preview of the new Midi file setup : new function to analyze the midi file, new design of the page, ....
    ⭐Correct an issue with the Sustain control which can generate CPU overload
    ⭐Add Pitch change midi event

    See below demonstrations ...

    Build a Rhythm Box:


    Build a Midi Game:


    Midi Player Tool Kit is a package able to play music from Midi files in your application or from your own algo. There is no need of external component or device.

    Thank to SoundFont for adding hundred sounds of instruments for playing Midi files
    • No scripting C# or JS is mandatory: specific inspector defined all your needs directly in Unity editor. See an overview here (V2).
    • Add Midi Audio Source Prefab in your scene as much as you want.
    • Add Midi files (from the web or from your composition) as much as you want.
    • Play / Paused automatically based on distance.
    • API available (V2) to integrate MPTK in your application.
    Version 2.7 beta on the road, could be available beginning February

    ⭐Add capabilities to load soundfont on the fly from local device or from the web [PRO]. It's now possible to use MPTK without loading a soundfont in the resource folder.
    ⭐Add new attributes to evaluate accuracy and performance for Midi Playing and SoundFont Synthesizer.
    ⭐Midi Sequencer and SoundFont Synthesizer are now autonomous (played in separate thread): more accuracy, better performance.
    ⭐Replaced deprecated WWW method with UnityWebRequest for MidiExternalPlay prefab [PRO].
    ⭐Corrected timing accuracy with MacOS.
    ⭐Corrected bad sound when changing tempo or position when playing



    Have Fun !
     
    Last edited: Mar 9, 2024
  2. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi
    Version 2 available. Check API here.
    Have Fun !
     
    Last edited: Mar 6, 2019
  3. Denis2018m

    Denis2018m

    Joined:
    Feb 11, 2018
    Posts:
    2
    Hello Bachmann! Thank you for the interesting asset. You write: "...Midi Player Tool Kit converts SoundFont to a simpler format with not all the functionalities of SoudFont..." Would you please tell, which exactly functional of SoundFont is modified in Unity, or will be not available?
     
  4. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi Denis2018m,

    Included : key range, velocity range, pan, sample, loop sample, OverridingRootKey, FineTune, CoarseTune
    not included : ADSL, Chorus, Reverb, Frequency Modulation

    Mainly, all heavy CPU consumming generator are not implemented.
    [Edit: All functions now implemented in MPTK V2!]

    Best regards
     
    Last edited: Apr 6, 2019
  5. CodeIsTheAnswer

    CodeIsTheAnswer

    Joined:
    Jul 16, 2013
    Posts:
    4
    Is there a way to dynamically "feed" the player with data instead of sending a prebuilt file?
    for example, what if I want to play a few chords instead of an entire song?
    thanks,
    Mark
     
  6. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi
    If I well understand your question, you want to play music without a Midi file ?
    The last version 1.5, can be used to play notes with the API. For each notes you have to defined : note, instrument, duration, volume, ....
    Have a look to this two demo in the package :
    • TestMidiStreamSimple : very simple (and horrible!) music generator. Usefull to understand how to use the MidiStreamPlayer Prefab.
    • TestMidiStreamGenerator : a more complex music generator with some algorithm. Could become in futur a new asset in the store ;-)
    BR
    Thierry
     
    Last edited: Jun 10, 2018
  7. Defero

    Defero

    Joined:
    Jul 9, 2012
    Posts:
    200
    Hi,

    interested in the plugin for the music tiles type game. The api link is broken to see if it would be possible.

    Regards
     
  8. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi,
    I apologize for this broken link. A new release has been published monday, I hope it would be available soon on the Unity Store.

    Here the new url : https://paxstellar.fr/

    BR
    Thierry
     
    Last edited: Mar 6, 2019
  9. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi
    API here :
    https://paxstellar.fr/
     
    Last edited: Mar 6, 2019
  10. wangzy_88

    wangzy_88

    Joined:
    Sep 12, 2012
    Posts:
    14
    Hi BachmannT,

    I'm very happy that there is a free midi toolkit in asset store, I tried it but found a problem. Is the OnEventNotesMidi event only appear in PRO version? I can't find it in free version.

    Thank you very much!
     
  11. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello wangzy_88,
    I'm happy if you are happy !
    I can confirm that OnEventNotesMidi is also available on the free version.
    I'm publishing a new version today (1.7), you could have a look to the new demo "Demo CatchMusic" where this event is used.

    Best Regards
    Thierry
     
  12. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello
    The OnEventNotesMidi will be available with the version 1.7
    The documentation was incorrect : see now here https://paxstellar.fr/

    Version 1.7 will be available soon (published on Unity store June, 29)

    Have Fun
    Thierry
     
    Last edited: Mar 6, 2019
  13. wangzy_88

    wangzy_88

    Joined:
    Sep 12, 2012
    Posts:
    14
    Hi Thierry,
    Thank you for your answer!
    I can't find the 1.7 version now but I think the reason is asset store has upload delay. Anyway I'll watch it:)

    Have a good day!
    wangzy_88
     
  14. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi
    1.7 available !
    Thank to Unity for the efficient publishing process !
     
  15. wangzy_88

    wangzy_88

    Joined:
    Sep 12, 2012
    Posts:
    14
    Hi Thierry,

    I tried the 1.7 version and I must say it's very good! The new demo is interesting too!
    Now I have two new questions:
    Can I read the notes of midi without playing it?
    Can I get the real time(since play start) of note? I found that the AbsoluteQuantize isn't what I want.

    Thank you!
    wangzy_88
     
    Last edited: Jul 9, 2018
  16. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi wangzy_88

    Yes ! from the inspector of MidiFilePlayer, have a look to "Direct Send to Player". If not checked, no sound are played.
    From the script, use properties MPTK_DirectSendToPlayer of a MidiFilePlayer component.

    Yes ! Have a look to this properties of MidiFilePlayer.
    /// Time from the start of playing the current midi
    public virtual TimeSpan MPTK_PlayTime

    it's a TimeSpan, use MPTK_PlayTime.TotalMilliseconds to get the time in milliseconds

    ps: thank for your good comment ;-)

    Best regards
    Thierry
     
  17. wangzy_88

    wangzy_88

    Joined:
    Sep 12, 2012
    Posts:
    14
    Haha, I'm happy that you like my comment!
    And what I really want to do is read the midi info in Editor, I want to let midi file to tell me the notes, but player will listen mp3 or wav, they sound better than midi.
    Anyway I can play midi once and record the info, but if you have a better suggest, I'll be very happy.:)

    PS: I found another way, use ReadMidiEvents() in MidiLoad, but I can't get the real time too.

    Have a good day!
    wangzy_88
     
  18. yamomoniy

    yamomoniy

    Joined:
    Jul 13, 2018
    Posts:
    2
    Hi,
    Is there a way to do the following process with this kit?
    • transposing (changing) key of music
    • mapping each channel of MIDI to a specified channel of output device
      • I want to map each instrument to each channel of 7.1ch surround output device.
    Thanks,
    yamomoniy
     
  19. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello yamomoniy

    For your questions :
    1) Yes, MPTK can transpose key of music. See inspector of MidiFilePlayer or API if you want also to transpose by script.
    2) No, for mapping each channel of MIDI to a specified channel of output device. MPTK don't use midi device to play music.Music is played with waves extracted from Soundfont. No need of external device. But, could be an idea for a future version !

    Best regards
    Thierry
     
    Last edited: Jul 14, 2018
  20. yamomoniy

    yamomoniy

    Joined:
    Jul 13, 2018
    Posts:
    2
    Hello Thierry-san,

    I see. Thank you for your kind support!

    Best regards,
    yamomoniy
     
  21. alexrshare

    alexrshare

    Joined:
    Jul 19, 2018
    Posts:
    2
    Hi Thierry,

    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:
    1) Sync a background music track (wav, mp3, whatever)
    2) 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.

    I'll share my solution with you if I find one :p

    Thanks again for your hard work!

    Best,
    Alex
     
    Last edited: Jul 19, 2018
  22. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    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.

    Best regards
    Thierry
     
  23. alexrshare

    alexrshare

    Joined:
    Jul 19, 2018
    Posts:
    2
    Hi Thierry,
    thanks for your reply!

    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.

    Best,
    Alex
     
  24. weisuolong

    weisuolong

    Joined:
    Jun 12, 2017
    Posts:
    7
    hi 。can i play guitar bass drum three instruments with one sound?how can i do that 。
    editor sound font only can select one instrument 。。
     
  25. weisuolong

    weisuolong

    Joined:
    Jun 12, 2017
    Posts:
    7
    i got i must join sf2 together to use ,but how can i use them split?
     
  26. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello, split defined in SF2 are also managed by MPTK
     
  27. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello, I don't understand "can i play guitar bass drum three instruments with one sound". Could you be more detailed ?
     
  28. CelesteEvrad

    CelesteEvrad

    Joined:
    Apr 21, 2017
    Posts:
    1
    Any plans to support the sfz format?
     
  29. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hi, one try have been done.For now I have an issue with the wave format of SFZ.
     
  30. weisuolong

    weisuolong

    Joined:
    Jun 12, 2017
    Posts:
    7
    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?
     
  31. D12Duke1

    D12Duke1

    Joined:
    Feb 14, 2016
    Posts:
    103
    I scrolled down a few pages and I do LOVE what you've done with the MIDI Toolkit.
     
  32. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello
    No, MPTK is not a Midi Sequencer able to take your input to create Midi. MPTK is a Midi file reader to play music. BR
     
  33. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    You are welcome ;-)
     
  34. weisuolong

    weisuolong

    Joined:
    Jun 12, 2017
    Posts:
    7
    ok but i need to record music by note! can you show me some roads?
     
  35. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    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
     
  36. weisuolong

    weisuolong

    Joined:
    Jun 12, 2017
    Posts:
    7
    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
     
  37. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    ;-)

    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.
     
  38. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    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

    And a lot of enhancement !

    Have Fun
     
  39. CodeIsTheAnswer

    CodeIsTheAnswer

    Joined:
    Jul 16, 2013
    Posts:
    4
    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?
     
  40. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    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.
     
    Last edited: Oct 13, 2018
  41. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello all,
    I have temporaly deprecated the MPTK package to correct an issue. Will be available soon !
     
  42. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    1.93 available !
    Corrected an issue : the path to the SoundFont was lost when changing the project path.
     
  43. keeves_test14

    keeves_test14

    Joined:
    Dec 5, 2016
    Posts:
    13
    can you please guide me how to work with this plugin?
     
  44. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Sure ! but your question is quite large! Have you read the documentation here ?
    Have you some specific questions ?
    Best Regards
     
  45. CreepyInpu

    CreepyInpu

    Joined:
    Oct 9, 2014
    Posts:
    23
    Does this give you access to the lyrics embedded in midi files to display then while the song is playing ?
     
  46. keeves_test14

    keeves_test14

    Joined:
    Dec 5, 2016
    Posts:
    13
    How to use this plugin for piano tiles game? We need to generate tiles according to the midi note's duration
     
  47. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Yes ! the lyrics are displayed in the Inspector. You can also get them by the API: MPTK_TextEvent from MidiFilePlayer object.
     
    Last edited: Oct 31, 2018
    otomus likes this.
  48. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    If I well understand, you want to generate some graphics asset (piano tiles ?) with notes (duration) from a Midi ? Have a look to the demonstration in MPTK package: CatchMusic


    Also, I'm working on a more interesting version that could be on Unity as a other package:
     
  49. FujiSunflower

    FujiSunflower

    Joined:
    Nov 7, 2018
    Posts:
    1
    Hi. Defaut Alto Sax [065] can't play in correct time. But the Soprano Sax [064] can play.
    My environment is Midi Player Tool Kit For Unity free with Unity2018.2.14f1.
    I used MidiStreamPlayer.prefab.
    I find Audio Source of Soprano check "Loop", but one of Alto don't.
    Finally, your asset is very easy to use. Thanks! h1.png h2.png
     
    Last edited: Nov 7, 2018
  50. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    385
    Hello rn9dfj3.
    Thank for your comment ! For your remark, I will check this asap, but i'm going in holidays tomorrow, so perhaps not before one week.
    BR
    Thierry