Author Topic: CPC Sid Player?  (Read 242 times)

0 Members and 1 Guest are viewing this topic.

Offline LambdaMikel

  • 6128 Plus
  • ******
  • Posts: 1.648
  • Country: us
    • Homepage
  • Liked: 899
  • Likes Given: 678
CPC Sid Player?
« 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 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?
« Last Edit: 19:54, 15 October 19 by LambdaMikel »

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 959
  • Country: fr
  • Liked: 919
  • Likes Given: 141
Re: CPC Sid Player?
« Reply #1 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!
Targhan/Arkos

Arkos Tracker 2 - alpha 7 now released! - Follow the news on Twitter!
Disark A cross-platform Z80 disassembler/source converter

Imperial Mahjong
Orion Prime

Offline LambdaMikel

  • 6128 Plus
  • ******
  • Posts: 1.648
  • Country: us
    • Homepage
  • Liked: 899
  • Likes Given: 678
Re: CPC Sid Player?
« Reply #2 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


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

Offline LambdaMikel

  • 6128 Plus
  • ******
  • Posts: 1.648
  • Country: us
    • Homepage
  • Liked: 899
  • Likes Given: 678
Re: CPC Sid Player?
« Reply #3 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?
« Last Edit: 23:34, 15 October 19 by LambdaMikel »

Offline BSC

  • CPC6128
  • ****
  • Posts: 205
  • Country: de
  • Yay! I became a 6128. Hope it wraps ..
    • my (Android) mobile game
  • Liked: 261
  • Likes Given: 219
Re: CPC Sid Player?
« Reply #4 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

Sounds just like to right tool for you.  ;D

Offline LambdaMikel

  • 6128 Plus
  • ******
  • Posts: 1.648
  • Country: us
    • Homepage
  • Liked: 899
  • Likes Given: 678
Re: CPC Sid Player?
« Reply #5 on: 00:11, 16 October 19 »
Excellent, indeed

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
« Last Edit: 00:20, 16 October 19 by LambdaMikel »