Creating music programmatically

Great, i made music on Gamebuino Classic and with Arduboy.
I hope that your fixes will works and more than all, a good tutorial to make it.
I all cases, thanks alot Eriban for your works in this domain.
Its one of the inexploited capacity of the Meta.
I hope that for some of us, there will be more time with confinment.

@jicehel wich tool did you use to make music ?
is it possible to use atmlib on gb ?

To make music on classic i define const for notes and enter value for blanche, noir, ronde duration. It was really old school music. The had thing is to continue to play music and maintain the game running…
It was easy to play music i have had problem when i tried to combine the music and the game as i managed it manually.
I don’t know but i think you can manage ATMLib as @Sorunome managed it when she done Arduboy crosscompiling (Arduboy crosscompiling -- By Sorunome).
She done it:

I have not looked more on her works so cant say more about it. If she read that, i hope she will answer better than i can.

The ATMLib port doesn’t do any audio stuff, it just adds dummy functions for that to make sketches compile, sadly.

So i can’t answer but a library seems good i think:
It seems to be a fin add. What you think about it ?

Another option is GBTracker : if somebody manage to get it work (on the Meta)

Yes it’s great. We could at less do same than classic with META. We had discussion about that long time ago here: Music examples for original gamebuino - By exocet
In other subjects to resume the answer was to play wav or sound fx


I must admit that I have some problems making ALL my 22KHz conversion working with the gamebuino.
Can you confirm that this track works for yo without bringing any modifications ?

@gibs, sorry, due to being busy and the forum being regularly offline I did not manage to download your WAV file in time. I just tried, but it is not available anymore.

I have started extending the Gamebuino library with more advanced music generation support. Progress has been promising, and I am happy to share the first results today: Music Demo. It’s still using a bit more CPU cycles than I would like, so my next steps will be to try to optimize it further.


Here is the file again, if you want to try:

Update: I made good progress with my music generation code, and consider it done for now. I added a new instrument, but also made many fixes and improvements. The results can be heard in the updated Music Demo. It includes 17 tracks by 7 artists. In total more than 22 minutes of music. This demonstrates what is possible. If there is sufficient interest, I can add documentation on how to use it.

My next step, however, is to try and integrate this into my Bumble Bots Repair game, so that it features music without having to download separate WAV files. I expect it will be challenge to get CPU utilisation below 100%. I may have to refactor the drawing logic, who knows…


Yes, i haven’t test on my Meta yet but i have look at the code and the music generation.
I like how it’s readable and easy to make.
Many thanks Eriban and of course i could be very interested by a documentation to use it even i think i could quickly understand because source of your program is very clear.
Thanks alot Eriban

for me it’s not work, player lauch fine and respond to key but is not output anything :confused:

Great job Erwin!

The sound comes out great, the bass is a bit weak in volume, but it’s overall a great success!

A technical user guide would be really welcome, of course, but, even more, your next challenge:

Create the composition software that goes with it! :stuck_out_tongue_winking_eye:

Create the composition software can be done one a PC too to make a music.h to integer it in main prog.

Not sure why it does not work for you. Did you check the volume settings? If it is set to “mute”, it will not work.

Thanks Steph. Creating composition software is quite a bit of work, and is not yet part of my plans actually. However, as jicehel alluded, you can already use the PICO-8 software to compose music. It has a built-in composer and I have created an export script to convert PICO-8 music to work with my music generation code. Unfortunately PICO-8 is not free, but I think it’s well worth the fifteen dollars. I have been using it to prototype all my Gamebuino games for example. It also has a built-in sprite and map editor, which lets you quickly try out ideas.

1 Like

I was just teasing you… I can imagine that’s a lot of work. On the other hand, it’s great to be able to use the PICO-8 composer and then convert our creations into the format required for the Meta. Thanks again for your work Erwin.

omg i’m so lame that was it %)
nice sound, pretty fun to listen these alex kid song, back from ages :- D

never checked this setting before, i may have a look at where value is saved to became compatible too if possible