Doremi is a music playing system for Unity games that makes it easy to include seamlessly-looped music with multiple variations. You will need to download DOTween in order to use Doremi (which you should have anyways, it’s great!)
Doremi is very much a work in progress. It may well have some bugs and issues. If you find any, please report them so we can fix them (or fix them and make a pull request)!
- Attach a
DoremiPlayercomponent to a Game Object in your scene.
- In your Project view, create a new
DoremiMusicasset via “Doremi Audio Engine > Multichannel Loop”.
- Place the
AudioClips of the variations for your track in the
Loop Start Samplesto the sample point in your music where the loop should start, and set
Loop End Samplesto the sample point in your music where it should return to the loop start point.
DoremiMusicasset to make your music play!
Begins playback of the
track, defaulting to variation 0.
Stops playback, losing the music’s position. In order to resume playback, you must call
Play(), which will start the music from the beginning.
Pauses playback. The music’s position is not lost, so you can call
Resume() to resume playback from this point.
Resumes playback from the point where it was paused.
SetChannelVolume(int channel, float volume, float duration = 0f)
Sets the song variation
volume over the course of
Fades the music to a volume of 0 over the course of
Returns the current position, in samples, of the music. Note: While it is possible to modify this value in order to “seek” through the music, this is not stable and should not be used.
Returns the normalized current position (where 0 is the beginning of the music, and 1 is the loop end point).
true if the music is currently in the loop portion, and
Setting this property will set all variations to a volume of
0 except for the variation specified, which will be set to a volume of
AudioClips for each variation of the music track.
The point in the music, in samples, where the music should loop back to the loop start point.
The point in the music, in samples, where the music should loop back to, when the loop end point is hit.