CPCWiki forum

General Category => Programming => Topic started by: LambdaMikel on 18:46, 15 October 19

Title: CPC Sid Player?
Post by: LambdaMikel on 18:46, 15 October 19
Anybody has a SID file player for the CPC? The sound will actually be produced by a real SID, but I need to be able to change the IO port. The SID registers are just being mapped into a range, starting from a given port.

Source code would also be fine, such that I can tweak it.

So, I am mostly asking for the SID file parsing. Another idea might be to use an open source PC program that can parse SID files, and translate this into a sequence of SID IO requests. Anybody has a sense of how difficult it is to emit a Z80 program from a SID file? Is there a lot of logic in a SID file, or is it merely stating which SID registers to set to what value at what time point?




@Targhan (http://www.cpcwiki.eu/forum/index.php?action=profile;u=110) is it possible to do this with Arkos Tracker? Import a SID file an have it create a Z80 MC program that plays the SID at a specific IO port on the CPC?
Title: Re: CPC Sid Player?
Post by: Targhan on 22:40, 15 October 19
AT2 does not manage SID, not right now.

I don't understand what you are trying to achieve, though. There are many ways to produce SIDs, even on a AY/YM, but are you talking about that kind of SID? "sid registers" does not really mean anything. So maybe what I'll talk about here is off topic.

One thing you can do is explore the YM format by Leonard and see how SID is encoded, but the format will only give you hints about what timer to use. Then it is up to YOU to chop real-time the square envelope, via volume or the mixer (already two ways of doing SID), according to the period of the notes being played. Doing it on CPC+ helps, thanks to the timer (Offset has already an available player, one of the latest demo on CPC+ uses it... 15 years after Offset release his player (which shows how much SID raises interest...)).

On CPC old, BSC did another kind of SID, called SID-sample. Tiny samples are played. Make a search on the forum to get it. Once again, no one was really interested, sadly for BSC...
So the SID question is vast, highly technical, and basically, if you don't master assembly (and have a good ear), you won't be able to do much!
Title: Re: CPC Sid Player?
Post by: LambdaMikel on 23:23, 15 October 19

AT2 does not manage SID, not right now.

I don't understand what you are trying to achieve, though. There are many ways to produce SIDs, even on a AY/YM, but are you talking about that kind of SID? "sid registers" does not really mean anything. So maybe what I'll talk about here is off topic.



First, thanks for answering! Well, given that I am talking about a hardware SID Player,  SID REGISTERS should be pretty obvious what it means, but you can take a look at what has been accomplished so far - I just thought it might be nice to have a SID file to Z80 ASM converter for this  ;)


https://youtu.be/zLsgOHT1fmA (https://youtu.be/zLsgOHT1fmA)


So, I don't care for any kind of "SID Emulation" - I just want a player that plays and uses the real thing in hardware. UNFORTUNATELY I am beginning to understand that in order to play SID files, you need to emulate 6510 / 6502...
:-X :-\ :'(


Cheers
MIchael
Title: Re: CPC Sid Player?
Post by: LambdaMikel on 23:32, 15 October 19
PS Btw, I can play BASIC C64 SID "demos" simply by converting the POKE s+... to OUTs+... and change s to the right Speak&SID port address, as shown with the SID Demo in the video which I simply type in from the C64 Reference Manual. I guess that is not as easy with SID files unfortunately, because of the machine code part in them... I wish it was "data only". Like in a MIDI file. Know what I mean?
Title: Re: CPC Sid Player?
Post by: BSC on 23:52, 15 October 19
There was a SID player converted from the Enterprise 128 (or so) a few years ago which, if I am not mistaken, included a 6502 emulation to be able to play SID files (with the .sid extension).
You should easily find it using the search function of the forum.

As far as I understood, .sid files always contain a play routine in assembly, probably because there are so many different trackers available, so that's something that you most likely
will not be able to avoid. But if your emulation intercepts writes to the sid memory addresses, it should be fairly easy to send the register values somewhere else. 

I did some quick search on the webs and found this: https://github.com/simonowen/sidplay (https://github.com/simonowen/sidplay)

Sounds just like to right tool for you.  ;D
Title: Re: CPC Sid Player?
Post by: LambdaMikel on 00:11, 16 October 19
Excellent, indeed

https://github.com/simonowen/sidplay/blob/master/sidplay.asm (https://github.com/simonowen/sidplay/blob/master/sidplay.asm)

should be possible to adjust for Speak&SID... Thanks a lot! Will try that.

It even has something like

sam_sid_port:  equ  &d4             ; base port for SAM SID interface