PDA

View Full Version : B128-80 SID chip



billdeg
November 11th, 2005, 03:10 PM
I have been experimenting lately with the SID chip on the Commodore B128...You can send an audio signal, but not through the video cable (like on a C64). The audio is handled by a separate jack. You can get some crazy sounds. Has anyone in the forum written music programs for the B128 SID? I am going to try that song "popcorn" in the key of C, starting from middle A, see how that goes. I am working on timing the "rests" at present.
Let me know if anyone is interested in these sound programs and I will post them on my web site. With the extra memory theoretically you can do more with audio than the C64. I also would like to make a c64 to B128 audio translater program. Anyone done that before? There are plenty of resouces on the Net that describe the differences between the C64 and the B128 SID processing.

carlsson
November 11th, 2005, 03:42 PM
Other than for samples, what can you do more with SID if you have a lot of memory? Many C64 musics these days are multi-speed, meaning that the SID chip is written to twice or more times per frame instead of only once per frame as it used to be done. I suppose a 2 MHz computer will have time for even more calls per frame. It says that in 2 MHz mode, the SID chip is write only, but I thought that always was the case.

I know at least one SID music program which comes as source and to which there exists two versions, one for C64 and one for Plus/4 with SID card. Probably it would be reasonably easy (?) to adopt it for B128 too, with respect to whether the computer lacks raster interrupts and timing has to be done with VIA/CIA timers.

At least the SID in B128 is memory mapped. I know some computers who are equipped with AY chips through I/O ports, and that seems like a pain in the *** and also a bit ineffective way to address the chip if you need to do a lot of quick changes.

billdeg
November 11th, 2005, 04:12 PM
I agree. As for as deciding whether the B128 has a good sound production system, it really only depends on what you compare it to.

billdeg
November 16th, 2005, 07:25 PM
I just finished programming the song "popcorn" into my B128 and saving to a 8050 drive. It's tedious and I have been trying to streamline the process, but I am making progress. The note timing and voices are flexible enough, and one can basically make the computer sound like a c64. I am going to focus on building depth into the sound output by creating multiple voices.

carlsson
July 3rd, 2006, 08:28 AM
Wanna swap programs? I just entered this into one of my B128's:

10 BANK15:S=55808:POKES+24,15:POKES+5,9
20 GETA$:IFA$=""THEN20
25 POKES+4,32:POKES+1,ASC(A$):POKES+4,33
30 GOTO20

It is a very crude keyboard piano.. if I hold down CTRL key, I can almost make it to play music:

ABDB ABDB ABDB GBFB
ABDB ABDB ABDB GBFB
HBHB HBHB GBGB GBGB
FBFB FBFB EBEB EBCB
ABDB ABDB ABDB GBFB

(hey, I said it is crude.. very few notes at the bottom, then it will get very tight for upper ASCII values.. yes, in five minutes time I could come up with a much better keyboard piano)

Currently it is a bit awkward to transfer software though. I haven't tried the tape option, but a disk solution would include using XM1541 cable to 1541 floppy, then use my VIC-20 w/ IEEE-488 interface to transfer the files to 8250 floppy. Maybe I should accept to trade for one of the last C2N232, if it allows me to up/download files directly from the PC using a serial cable.

carlsson
July 3rd, 2006, 09:04 AM
Ok, a more complex (but significantly slower program):

10 BANK15:S=55808:POKES+24,15:POKES+5,9
15 N$="Q2W3ER5T6Y7UI9O0P":O=3608:NL=LEN(N$)+1
20 GETA$:IFA$=""THEN20
21 N=1:IFA$="X"THENO=O*2:IFO>14432THENO=14432
22 IFA$="Z"THENO=O/2:IFO<902THENO=902
23 IFN<NLANDA$<>MID$(N$,N,1)THEN=N+1:GOTO23
24 IFN=NLTHEN20
25 F=2^((N-1)-12)*O:H=INT(F-256):L=F-(256*H)
30 POKES+4,32:POKES,L:POKES+1,H:POKES+4,33
32 GOTO20

(this program works on a C64/128 too, if you set S=54272 on line 10 and omit BANK)

Use Z and X to change octave, play with Q-P.

carlsson
July 3rd, 2006, 09:39 AM
Better program, but takes a bit more memory:

10 BANK15:S=55808:POKES+24,15:POKES+5,9
11 DIMK%(256):N$="Q2W3ER5T6Y7UI9O0PZX":O=3608:NL=LEN(N$)
12 FORI=1TONL:K%(ASC(MID$(N$,I,1)))=I:NEXT
20 GETA$:IFA$=""THEN20
21 N=K%(ASC(A$)):IFN=0THEN20
22 IFA$="X"THENO=O*2:IFO>14432THENO=14432
23 IFA$="Z"THENO=O/2:IFO<902THENO=902
24 IFN>NL-2THEN20
25 F=2^((N-1)-12)*O:H=INT(F-256):L=F-(256*H)
30 POKES+4,32:POKES,L:POKES+1,H:POKES+4,33
32 GOTO20

This was fun.. and it would be trivial to add another octave.

sjgray
February 3rd, 2009, 10:08 AM
Hi,

It's easy to convert C64 BASIC SID programs to the B128 or P500. Just change the SID starting address. On the P500 the notes will sound the same. On the B128 (and other B machines) the sound will be higher than the C64 due to the 2MHz clock. To compensate you also need to adjust the frequency values that are poked to the SID chip. Take the frequency and multiply by 0.54, then calculate the lo and hi values. I converted 6 or 8 songs this way.

Back in the late 80's I also attempted to convert an ML "sidplayer" to the B128. It was called Master Composer. I got it working mostly but every once and a while it pauses for no reason. I think the interrupt routine needs fixing. I haven't worked on it for a long time...

Steve

carlsson
August 11th, 2011, 12:38 AM
Haha, five years later and after seeing the listing cross posted on other forums, I spotted the typos or bugs if you like. On line 25, two of the subtractions obviously should be divisions in order to have the frequency calcuation to work.

25 F=2^((N-1)/12)*O:H=INT(F/256):L=F-(256*H)

Otherwise, it should be reasonably OK.

sjgray
August 11th, 2011, 09:39 AM
Well, you've made me realize how far behind I am in posting things on my page. So, I added a small section on my CBM-II page for my files. More to come as I sort out my disks....

1) BASIC4 player that plays Master Composer songs (MUS files). It's slow but it works mostly. I also have an machine language version with nice interface when I can find it...
2) BASIC4 Disk Doctor program for editing floppy disks (converted from pet version I believe and greatly enhanced).
3) BASIC4 Individual songs converted from the C64.

These were written around 1985. Enjoy!

http://www.6502.org/users/sjgray/computer/cbm2/index.html

Steve

billdeg
March 4th, 2016, 03:56 PM
Steve,
Can you post the machine language program version of the music play you've written so I can try it out? If I work on it I can send you what I have done.
Bill

sjgray
March 4th, 2016, 04:25 PM
Steve,
Can you post the machine language program version of the music play you've written so I can try it out? If I work on it I can send you what I have done.
Bill

Sure, I'll dig it up and post it on my page... As I recall, I disassembled the master composer player then relocated it to $F0400 to fit in the B-series free ram in bank 15. The MC song gets loaded into one of the upper banks 3 or 4 and played from there. So this meant I had to patch the player to use the $01 register to read data from the other bank...

Steve

sjgray
March 5th, 2016, 05:07 AM
The source is now posted.
I also posted disk images of some of my other software. Enjoy!

Steve

billdeg
March 5th, 2016, 09:07 AM
I am going to take your advice (from some now long-lost thread) and try to convert a C64 SID "jukebox player" to work on the B128. It would be great if something made for the SuperCPU was more or less compatible with the naturally faster B128.

Your sample code should be useful, thanks a lot.

b