[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Music Construction Set manual?
On Thursday, September 20, 2012 6:25:59 PM UTC-5, (unknown) wrote:
> On Thursday, September 20, 2012 3:58:41 PM UTC-7, Hot Rod wrote:
>
> >
>
> > Where does one find this "Mockingboard disk1" that has the player in question?
>
>
>
> http://mirrors.apple2.org.za/ftp.apple.asimov.net/images/hardware/sound/mockingboard/mockingboard1.dsk.gz
>
>
>
> option C from the main menu
>
>
>
> Rich
Ok, so I think I figured it out (mostly). In order to save the Mockingboard music files from Music Construction Set, you do a 'BSAVE filename' instead of a 'SAVE'. Using BSAVE creates a single file with an address of $1000 and length of $900; using SAVE creates the two files (one at $4000, and the .OBJ at $7400).
Now the gory details, and how to use it...
The player file that's on the 'Mockingboard 1' disk ('MCS') is the same player file that's on the first Music Construction Disk image (as 'MUSIC'), and which has the text file source disassembly. The difference is that the one on the Mockingboard disk is assembled to start at $8500, while the one on the MCS disk is at $4900.
To use the player from the Mockingboard disk, you BLOAD it as is (will load at $8500). But a few more things are needed. There's another file on the Mockingboard disk called PRIMARY; BLOAD that too (loads at $9000). Then the music file itself needs to load at $4000 instead of $1000 (more on that later).
There are two parameters that need to be set at $8512 and $8513 though. $8512 is the tempo (actually the time signature), and $8513 is 'decay' (not entirely sure what that controls).
Then to start the song, just do an $8503G. The monitor prompt will return, and music will be playing from from the Mockingboard.
Now, to stop it, you do a $C40E:40 <return>, but this will leave the last two notes still playing. This is where the PRIMARY file comes in. To stop each note, do a $9021G and a $904DG.
So in summary:
- BLOAD MCS
- BLOAD PRIMARY
- BLOAD <song file>, A$4000
- set $8512 and $8513 to the time signature and decay
- $8503G
- to stop:
- $C40E:40
- $9021G
- $904DG
Some caveats: the time signature should be able to be determined from MCS, but I didn't figure the exact mapping. The default seems to be $8512:4 3, which is 4/4 time and '3' as decay. You can see other songs use 2 2, 3 3, and I don't know what combos are valid. I BSAVED the Canon off the MCS disk, and 4 3 seems to work for it.
Since MCS only saves A$1000, L$900, it doesn't look like the longer songs fit into that. The ones on the Mockingboard demo seem to, but longer songs on the MCS disk don't seem to convert in short enough space.
At $8514-15 is the lo/hi address of treble clef portion of the song, while at $8516-17 is the bass clef (I think; could be swapped). Except you'll see these set as FE3F and 7E44; they are two bytes before the actual start due to the way the program handles the addressing. In theory, if you wanted to load the song file into $1000 instead of $4000, should just be able to change these values (e.g. FE0F and 7E14 instead). I didn't try it though.
But with this info, I was able to LOAD the CANON song from MCS, BSAVE it to another disk, MCS created just one file at an address of $1000, length of $900, which I was then able to play via the Mockingboard MCS file.
How'd I figure it out? I got lucky. I was comparing the music files on the Mockingboard disk, and it looked like there were two sets of note info combined, whereas the MCS files had separate files. The data looked similar though. And the player on the Mockingboard disk being the same as on the MCS disk suggested that there must be a way to create this one combined format. I was looking at other files on the MCS disk when I noticed some text at the end of the HELLO binary file: ",A$1000,L$900" - that matched exactly the file address and length I was after. So then the question was, where and how was this used? I also noticed a "BSAVE" in the nearby text, which was the other clue. So then I used AppleWin and the debugger to reverse engineer when that was used, and realized that the BSAVE alone (with a filename) was the only key (MCS fills in the rest automatically, thus the fixed length of $900).
The tricky part is going to be figuring out the values for $8512-13, and the size limitation.
Hope that helps.
]HR