I got the exact same result as last time.
I know lots about C++ but very little about ATMlib,
and I’m guessing this is an ATMlib problem
(i.e. something wrong with the format or the wrong function being called).
Just to make sure, you know that I’m using ATMlib2, right?
Yeah, I was looking at the examples on their github:
I don’t know enough about the sound format to know whether the issue is the wrong function being used, the sound format being in the wrong order, a bug with the file generator etc.
(I meant to post this hours ago but didn’t realise I hadn’t pressed the send button. Oops.)
been a while … I know.
@dxb @JayGarcia maybe it’s time we merge ATMlib and ATMlib2 into 1 library ?
But will probably have to discuss the song Format ? We originally made it as dens as possible, but that doesn’t mean we’re not open to improvement !
Hi @JO3RI! Great to have you back.
The new format can be smaller than the original one in some specific cases and in the “full featured” case is only marginally larger but it packs opcodes in a way that makes the decoder a lot smaller (and I believe it can be improved further). We should definitely discuss what to do with ATMLib2 (merge, name change, other options?).
Welcome back @JO3RI – you’ve been missed
@Cyndi4U, is there a Github repo i could clone & test stuff out in?
I’ll admit, I’ve done an absolute horrible job of finishing the work to publish ATMLib2 and would like to help as much as I can. it will be hugely easier for me if there was a Repo I could jump on and make changes with related pull requests.
I was also going to suggest you consider getting a github account, but wasn’t sure when to mention it.
If you’re going to be using the forums a lot and/or asking for help with code, it’s a very useful thing to have.
(I already have an unused account)
Here’s a github with all of the files in it.
Hi @Cyndi4U, I can see your problem – you’re not including the ATMLib2 sources.
This is a problem generated partially because I failed to finish the publishing activities to make it available to the general public. I’m going to clone your repo, stuff in the ATMLib2 (pre-published) code and will create a PR for you.
Created the PR:
SFX options work with A & B buttons respectively.
Example ATM files can be found here:
Upload them to https://labs.moduscreate.com/trackerEditor
So being pretty new to C and C++, I have little to no idea what you just did. I’m studying the code, but I can’t seem to understand how or what this is doing. Can I get a quick summary? (Sorry for taking so much time)
- Include the proper source files. I copied the source code to ATMLib2 to the local project. This issue is caused by the library not being fully published in the Arduino library repository.
- Properly implement initialization (
init()) function and play a song
Added: Sound.h & Sound.cpp
- These files are my homegrown interface to ATMLib2’s function
Sound.hSets up the prototype for the Static class (
Sound.cppIncludes the SFX and Songs
- Static method
Sound::play_soundTakes an integer that is mapped to the local constant array of SFX pointers.
Sound::play_sound(SFX_PLAYER_SHOOT);will play the first SFX item in that array.
SFX_PLAYER_SHOOTresolves to value of
- Static method
Sound::play_song(INTRO_SONG)plays the music mapped in the
play_sound's internal constant array of song pointers.
INTRO_SONGresolves to value of
- Static method
Sound::stfu()will stop the music.
Hope this helps =)
If you’re new to C and C++, I highly suggest reading this book:
It was absolutely eye opening to me, a non-traditional programmer.
I bought it second-hand, and didn’t pay full price.
also – There are college lectures online that will help you a ton: For example, these are lectures that are captures from an intro to computer science class at Carnegie Mellon University:
Update: The link above doesn’t seem to represent it’s true contents:
A few more references:
And (you’ll need this one day):
And lastly, plenty of useful stuff in the Arduboy magazine:
OMIGOSH IT HAPPENED AGAIN
One of the reasons I couldn’t figure out what it was doing what because the download I got was corrupted! Maybe my computer/internet doesn’t like Github
Git does checksum/hashing to ensure quality. :shrug:
Well … I decided to fix the delay bug after all.
The new release of ATMlib v1.2.5 will pop up soon enough in the library manager of the Arduino IDE.