Added support for a new stereo format that allows for the independent
playing of two seperate channels, so that it reduces clicking, and a note
is only seperated from the next one when it is supposed to be in the actual
song.
This version is completely backwards compatable with the
old MONO format, but the new mono format makes it so the old version
won't mistakenly play these files. I have also migrated to a 100%
HTML based readme, because it looks better and is easier to read/update.
This zip also includes all the sound files currently available for Calcmod 2.2
to date, complete with source code so you can look at them and understand how
to write your own sounds.
The header is about the
only consistent thing. There are no specific note values in the mono format.
In the mean time, here is the header format:
#define tempo xxxx ;where xxxx is a tempo value >= 60 BPM
#define mono
#include "tempo2.inc"
#include "notes2.inc"
ret
.db "Calcmod",0
.db "Description",0
.dw 1,0
.db 2
The rest of the program consists of a series of data values, and
here is what they stand for:
note(pitch,length)
The first number, "pitch" is the pitch of the note, and the
second number, "length" is the duration of which it will be played. And
there is no legnth words, but to distingush the end of the song, the LAST
line is:
note($FF,$FFFF)
It doesn't matter where that is in the song, but it will consider
that the last pitch and stop playing.
Note: I have discontinued documentation on the old Mono format because it has become obsolete
Stereo Format (Old):
Here is the header, and everything makes much more sense now:
#define tempo xxxx ;where xxxx is a tempo value >= 60 BPM
#include "tempo2.inc"
#include "notes2.inc"
ret
.db "Calcmod",0
.db "Description",0
.dw 1,0 ;so the old CalcMod doesn't play this stereo format.
.db 1
That is the header, and then the rest of the program is a series of data values, made easier to understand
with a #define macro i have in the notes2.inc file. Here is how it works:
note(left,right,lenghth)
The first part, left is the note that will be heard in the left channel. The next value,
right, is the note that will be heard in the right channel. And the third value,
length, is how long those 2 pitches will be played. Then to distingush the end of the song,
this needs to be the last "note":
note($FF,$FF,$FFFF)
And it is useless to put any information past that, because the player will stop dead in its tracks.
Stereo Format (New):
Here is the header, and everything makes much more sense now:
#define tempo xxxx ;where xxxx is a tempo value >= 60 BPM
#define stereo
#include "tempo2.inc"
#include "notes2.inc"
ret
.db "Calcmod",0
.db "Description",0
.dw 1,0 ;so the old CalcMod doesn't play this stereo format.
.db 3
.dw channel1 ;points to the seperate Channel 1 Data area
.dw channel2 ;points to the seperate Channel 2 Data area
That is the header, and then the rest of the program is a series of data values, made easier to understand
with a #define macro i have in the notes2.inc file. Here is how it works:
channel1:
note(note,lenghth)
...
channel2:
note(note,length)
...
The first part, note is the note that will be heard in that channel.
And the last value, length, is how long that pitch will be played.
Then to distingush the end of the song, this needs to be the last "note":
note($FF,$FFFF)
Please note that in this format, the first occurance of note($FF,$FFFF) will end
the song.
None that I know of... that does NOT mean, though, that there
are none. I have not found any, but if you find one, email me at
pmarks@employees.org . I am also not responsible for anything that this
program may consequentially do to your calculator.