MusIT

MPTK: Use AudioSource


Audio Source Template

MidiFilePlayer and MidiStreamPlayer gameobject contains an AudioSource template. This audio source is used as a template to play each sounds in your Midi File Player. An AudioSource is instantiated when there is the need to play a new wave from the Midi file. AudioSource are automatically deleted at the end of playing.

You can customize this AudioSource to adapt to your need. Picture below is the default configuration deployed with MPTK. Go to Unity documentation to understand how to use it.

Tips:

  • By default Spatial Blend is set to 0. Set to a upper value to change volume accordingly with the distance to the Audio Listener and the Left/Right orientation.
  • Audio Source are created at run time when a new sound is need. So, change the template parameters at edit mode to be sure that changes will be taken into account for all sounds when playing.

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.

Get MPTK from the Unity store

If you like Midi Player Tool Kit, please leave a review on the Asset Store. It’s very appreciated!!!

Maestro MPTK on ChatGPT!

From different MPTK documentation sources DarkSky42 has created a custom LLM based on ChatGPT. You are now able to ask all the questions you want and get a good level of response, request code example, verify your source code …

Contact

If you have questions, please don’t hesitate to contact us via the dedicated Unity forum or our Discord  channel.

Reach the Discord archive by topic.

We are always happy to discuss your projects!