Simple melody library

Hi, for a project of mine I created a very simple library to play music tunes without using the delay function so It doest not block the processor while making noise :slight_smile:

I post it here if it's useful for anyone.

On the other side I want to use it to play audio notifications reacting to user actions as part of the user interface but I'm better programming than creating music and I can't make it sound good :slight_smile: :slight_smile:

Anyone has an idea to make a good combination of notes and tempos to make it sound good?

const uint16_t melody[3][4] =
{
{ 3830, 2028, 2550, 3830 },
{ 1800, 1100, 1500, 1800 },
{ 1000, 1200, 800, 1000 }
};

const uint16_t tempo[3][4] =
{
{120, 80, 40, 50},
{120, 80, 40, 50},
{120, 80, 40, 100},
};

Thanks so much for your contribution to the Arduino project!

I have a suggestion: When publishing libraries, it's best practices to place them in the root of the repository, rather than under subfolders as you have done. A popular library installation technique is to download the .zip files of the library GitHub generates (Clone or download > Download ZIP or the Releases page) and then use the Arduino IDE's Sketch > Include Library > Add .ZIP Library on the downloaded file. This requires the library to be in the root of the repository, not in a subfolder. If the library is not in the root of the repository this installation technique fails:

Specified folder/zip file does not contain a valid library

This is the standard repository structure used in all official Arduino libraries:

This move is also required if you wanted to add your library to the Arduino Library Manager index, which provides an even easier installation option.

I would recommend that you rename the repository to match the library name. You can do that by clicking the "Settings" tab on the home page of your repository.

In this case should I have a different repository for each library? I have more libraries to contribute my idea was to have all them published togheter in subfolders.

You definitely want to have one repository for each library. Putting all your libraries in a single repository is a huge mistake. GitHub offers unlimited repositories for free so there is just no good reason not to have one repository per library.