I have been in contact with STG again about Music library brainstorm
The code we have so far is ready for testing against a tracker BUT
We need someone to help build a WEB based tracker (for creating music)
SO who can help us out: HTML5 + Sound
No more brainstorming, we need to create it now !!!
Because we are working very quiet on this, I haven’t put any updates on the forum concerning our work on the 4 channel Music Tracker. So how are things going? …
You all do know it’s possible:
My biggest concern has always been the size of the player AND the songs. So STG and I have discussed this long enough to come to a certain point were we decided we have a format that is usable.
The play routine is finished ! hurray ! But it is still impossible to create music for this play routine
The hardest part has started with us creating an editor. STG was able to make a browser sound generator, not playing samples, but actually generate the exact same sound the Arduboy will. Once this was finished we need the actual editor and to be honest we didn’t make much progress, until recently a good friend of mine joined our efforts.
So, we are creating an online editor, were you will be able to make/listen/export your music ready for use in your Arduboy (any Arduino) programs.
I’m going to show you a screenshot of the actual program WIP and probably will change a lot.
This is not a mock-up but the actual editor. Not much yet, but it gives a basic idea: channels, tracks and the part you don’t see yet: a piano roll where you can click notes.
It’s been a while and progress has been slow, BUT I managed to get STG’s work into a separate library AND it works … well the player works, but still we need to add in all the effects. For now only the volume effect is working. Other effects could be Arpeggio, Vibrato, Tremolo, …
Well this is what it sounds like
What you hear is 71 bytes … so a little song shouldn’t be bigger than 200 bytes
I think we have about most FX working in the tracker player:
VOLUME
FREQUENCY
ARPEGGIO
NOISE RETRIG
TRANSPOSITION
TREMOLO
VIBRATO
GLISSANDO
I’m currently working to get us as much example tunes/songs as possible explaining every FX separately.
Also the description and keywords are on my todo list.
The tracker player you all can use in your game is finished. I still need to correct some of the example songs (because of some changes I made in how to set Tempo). BUT yes ! The library is ready for use. I’ll make a separate post about the lib soon.
We also created a WEBplayer, that can play the same song format as the Arduboy tracker. You only have to drop your song.h file on the webpage and it will start to play.
SO … how to create music? Yeah well that’s still kind of very hard, because our editor isn’t ready yet.
BUT if you would like to create an editor your self, please do. you can use the webplayer to create something around it.
Add sound mute control that integrates with the audio class functions available in the Arduboy, Arduboy2 and Arglib libraries. Both the ArduboyTones and ArduboyPlaytune sound libraries do this by passing a pointer to the audio.enabled() function in the constructor. Doing this would probably mean eliminating the ATM object that you create automatically in ATMlib.cpp, instead letting the sketch create its own ATMlib object that provides a mute indicator function as a constructor parameter.
Yes, that’s what I was referring to in suggestion 2 above. It’s the EEPROM_AUDIO_ON_OFF location, which is in the same place in the Arduboy, Arduboy2 and Arglib libraries. It’s controlled the same way, using the audio class, in all three libraries.
If you use the Arduboy2 library, controlling mute is available via the SystemButtons() startup feature, so you don’t even need a menu item for it in your sketch if you don’t want to add it.
The intention is that all Arduboy compatible sound generation libraries work with the main library’s audio class functions to control mute globally amongst all sketches, and the state is saved across power cycles.
@MLXXXp yep going to make all those changes you suggested. Also, yes ATMlib should take advantage of the audio on off from EEPROM, just need to implement it.
I’ll keep you all posted when I have done those changes.
@boochow yeah, but why would you do that, just talk to the oscillator directly.
We’ve added functions to mute/unmute a channel, so you can make game sound effects using the oscillators.
I have submitted the Library to arduino, once it’s in I’ll post a new topic and I will make a dedicated webpage explaining “the what” and “the how”.
@JO3RI, Are you planning to do this? I see that you’ve added mute() and unmute() calls to the ATMlib class but it would be nice if you implemented a global mute that follows the state of the Arduboy, Arduboy2 and Arglib libraries’ audio class by using a callback to the audio.enabled() function, as ArduboyTones and ArduboyPlaytune do.
@MLXXXp this mute and unmute is something different. Those function mute 1 of the 4 channels, so that you can use the channel for a sound effect in the game (like shooting). They have nothing to do with the global sound on_off. This is how the Amiga games worked.
Normally global sound on_off should just work, because they set the pins from input to output … (I have to admit, I didn’t have time to test it yet)
@boochow creating those sound effects is up to the game coder, but I’ll provide examples in time.
Oké Oké here is a small example , only a sound effect, without a timer or muting the channel:
for (int n = 1000; n < 4000; n += 40) {
osc[CH_ZERO].vol = 63;
osc[CH_ZERO].freq = n;
delay(1);
osc[CH_ZERO].vol = 0;
}
So one would mute the channel, do a sound effect on that channel and unmute the channel again.