I have noticed that there seems to be a bug that the end of the song data is not used during playback.
See as an example the attached song, where I have the same four notes played twice in a row. However, only the first time, all four notes are played, whereas the second time only the first three notes are played.
Or am I doing something wrong? (Simply Ctrl+C, Ctrl+V the source into the emulator).
I have noticed that there seems to be a bug that the end of the song data is not used during playback.
See as an example the attached song, where I have the same four notes played twice in a row. However, only the first time, all four notes are played, whereas the second time only the first three notes are played.
Or am I doing something wrong? (Simply Ctrl+C, Ctrl+V the source into the emulator).
You made just a minor error. You are not loading all the data to memory. 64 bytes of music plus 9 bytes of header data so you have to change the FOR loop to read total of 73 bytes.
You made just a minor error. You are not loading all the data to memory. 64 bytes of music plus 9 bytes of header data so you have to change the FOR loop to read total of 73 bytes.
Ah silly me ?
Here's a short song made for the Music Player Library. Again simply Ctrl+C Ctrl+V it into the emulator. Feel free to modify and use it everyone if you see fit.
Here's a short song made for the Music Player Library. Again simply Ctrl+C Ctrl+V it into the emulator. Feel free to modify and use it everyone if you see fit.
Wow, this is great tune. Can I include it on my blog (of course with full credits)? Perhaps there will be more that I could add and build a little library of songs for the player.
I've come around to trying out the possibility to create custom instruments. I am having a couple of issues.
The Volume setting seems to be at the position of what's called "sustain", and the "Volume" setting doesn't seem to change anything
For the ADSR, are the parameters doing what they should?
What is the additional sustain parameter supposed to do? How long continuous notes are held?
I'm utterly perplexed by the result the attached test file is giving me.
Also, in your blog you say there's 5 predefined instruments, but actually there are 6, so I guess it's only 2 free slots (but it doesn't matter since we can poke into existing ones).
Thanks in advance
Edit: To clarify what I was trying to do with that file. Basically I wanted a short, percussive envelope (an Attack-Decay envelope so-to-say). Because that wasn't turning out how I expected, I began messing around, setting the volume to 0 and making the sound "continuous" which both didn't happen.
Hmm this is indeed unusual result but also parameters are a bit unusual and it would require some time to debug to understand what exactly is happening.
To achieve a short percussive envelope I would use setting like this:
Triangle wave
AD = $10 - very short attack, no decay
SR = $08 - no sustain, medium long 200ms release
Not continuous
Max Volume = 63
Sustain Volume = 63
LR = 3 - my documentation should state that 11 is binary for left and right channel so decimal 3, will update my post
Please let me know if this creates the effect you were going for? I will try to find some time over the Weekend to investigate strange result your settings created.
I need to apologize because yesterday, I haven't properly looked at your documentation. Now I understand that the two ADSR bytes give four durations, and the sustain level parameter is the extra one. That is useful to know, and I will try again with that knowledge. But the "looping" I was observing yesterday seems to be a bug.