Platform Compatibility

MPTK is full operational on Windows, Mac OS, IOs and Android

But there is some limitations:

  • WebGL
    • No sound playing due to WebGL limitation:
      • Lack of a good threading behaviors.
      • Investigation in progress …
    • Other functions as reading/writing midi events work correctly.
  • Difficulties with some Midi
    • The synthesizer is build in C#. It’s a conversion from the fabulous fluidsynth from langage C.
    • Advantage: MPTK is running on a a lot of devices and it’s easy to add interesting functions.
    • Drawback: C# is less efficient than C. Sound, like piano, with long release time could generate a lot of samples to be played at the sames times. When a lot of samples are played the DSP becomes very busy and sound is bad.
    • Workaround: MPTK monitor the DSP load and release earlier some samples in case of overload.
  • iOS
    • Test ok on iPhone 7 and 8
    • Changing Synth rate is not enable for iOS devices. It seems that the sound devices don’t like changing the default synth rate: 24 kHz by default.
  • Android
    • Test ok but it’s better to use a recent Unity version (last tested on 2019.3)
    • Follow this Unity tuto. If possible, use JDK/SDK/NDK/Gradle deployed with Unity.
    • Tested with these API:
      • Android 5.0 and 9.0
      • API Level 21 and 28
      • .NET 4.x

Before buying, check with the free version, if the free is ok for your need then the pro will be!

Wave Looping

See here more information about the wave looping limitation with WebGL.

Take an example with a sound like a piano. When a piano key is hit (note on), the sound is played from the start of the wave:

  • first the attack+decay phase (a very short phase),
  • then the sound plays the sustain phase until the key is released (note off),
  • then the sound plays the release phase, generally a short phase,
  • then the sound is stopped.
From Wikipedia

See here more information how a synthesizer runs (in particular with envelope).

Note: information about looping is defined in the wave file with dedicated attributes defined when the wave is recorded..

Unfortunately, WebGL don’t use these looping information: the sound is playing from the start to the end of the wave until the key is released: all the steps are repeated: attack / decay / sustain / release. It’s like if you hit the piano key a lot of times! It’s a very weird result.

Note: some sound don’t loop. Generally, it’s the case for the percussion sounds.

Timing accuracy

  • Midi is read (act as a sequencer) and audio is played (as a synthesizer) in two system threads, not in the Unity thread.
  • Change Unity Audio Parameters: synth rate and buffer size to adapt to your need.
    • lower buffer size lower the latency.
    • higher rate rise the CPU load and therefor the lower the timing accuracy.
  • Avoid using Unity Update() and Unity Coroutine to create rythmic music. They are not stable enough for create music. Rather use, system thread or system event.

Impact on performance