maxint-rd / MmlMusic

Arduino library to play multi-track MML music using different sound devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create release so that this can be added to the Arduino Library manager?

sridharrajagopal opened this issue · comments

Hi,

Awesome library! We've created a derived class ProtoStax_MmlMusicPlayer that was inspired by your PWM player but allows one to create multiple instances using multiple available timers.

We'd like to add that (and your library) to the Arduino IDE Library Manager for easy access and installation. For that though, you'll need to create a release (that matches the version in your library.properties).

Can you please create a release in your repository? I can then do the needful to add it to the arduino/library-registry repository for you!

Best Regards,
Sridhar

Hello @sridharrajagopal - thank you for your reminder and for your initial post. I did read your message, but didn't have the time to give you the well-deserved detailed answer that I intended.

Nice to see that you have successfully used my library. At the moment I don't have the time to take a closer look at your implementation. I was wondering though what your use case is to have multiple instances, so I enjoyed the clarification on your Github page. I would like to spend some more time on that to see how I would use the concept of having multiple instances. The current implementation of my library supports playing multiple tracks on the channels of a multi-voice device, but track synchronization is not very good.

Often I'm a bit reluctant to add my libraries to the Arduino manager, as I feel that the library might not be mature enough and I'm not able to provide a lot of support. I did add my TM16xx library, but that one took a couple of years. Perhaps improving multi-track synchronization isn't that critical. (Most times I use it myself only to drive a simple buzzer. I use it in almost all of my ESP projects, as it provides an easy way to give audio feedback).

Adding a release to the repository is easy enough, but adding the library to Arduino wasn't too complicated either. I wil see if I can find some time later this week to give it some attention. (Feel free to ping me again if I stay quiet, as it may have floated to the background once more ;-)

Hi @maxint-rd - thanks for your reply (and thanks for your library)!

One point in favor of adding it to the Arduino library is that it leverages the Arduino Library manager and makes it a little easier for the user. I was getting ready to add my library but it would also need yours, since it is extending your library. Otherwise, there is no point in adding my library alone to the Arduino libraries! :-)

Yes, the use case is essentially for firing off different music bits asynchronously - adding background music and effects to an endless runner game are what got me started. The example sketch is just playing melody and chords for a song (I also liked your callback feature, which I used to display (somewhat) synchronized lyrics on an LCD screen on the main loop).

There could also be an implementation that has a single instance that uses multiple timers to achieve playing multiple tracks on a multi-track MML score, but my use case was slightly different, as I wanted the ability to play different scores at different times. It also allows for playing multiple-tracks simultaneously by making multiple calls to multiple instances (as I've done in my example sketch) - the very slight timing difference is within the limits of human time and the synchronization seems fine (at least for two instances).

One clarification that would be nice in your library documentation is for dotted notes - I found from trial and error that it would be

C.4

for a dotted quarter note (vs. C4. which I assumed initially).

Thanks again for your library, and I can help with any maintenance/issues as much as I can!

Best Regards,
Sridhar

Here are a couple of examples - DoReMi from the example sketch, and also Scarborough Fair

https://www.youtube.com/shorts/gVNseo0EZnU
https://www.youtube.com/shorts/W-eOEGlqLPo

-Sridhar