![]() - A C64 music player and SID chip emulator - |
||||
|
||||
IntroductionBasically, SIDPLAY [1] is just an ordinary music player software. More specifically, SIDPLAY emulates the Sound Interface Device chip (MOS 6581, commonly called SID) and the Micro Processor Unit (MOS 6510) of the Commodore 64 [2] on your computer. It is a platform independent software which emulates these hardware components. Therefore it is able to load and execute C64 machine code programs which produce music or sound. In general these are independent fragments of code and data which have been ripped from games and demonstration programs and have been transferred directly from the C64. All you need is a supported operating system and audio hardware with average PCM waveform playback capabilities. A fast CPU and a 16-bit sound card are recommended for better performance and slightly better audio quality. SID emulation has its roots in the AMIGA programs The 100 most remembered C64 game-tunes (1990) and PlaySID (1990-1994) by Per Håkan Sundell and Ron Birk. After PlaySID v2.2, SIDPLAY was the second publicly available SID music player world-wide and the first one on several operating systems. Other SID emulators have been developed, but are not covered by these pages in detail. SIDPLAY is not based on any portions of sourcecode from PlaySID. It has been developed and programmed from scratch. As a result and also influenced by the different hardware that has been used during development, its SID emulator architecture differs significantly from PlaySID. SIDPLAY is not related to the music editing and playing programs on the C64, called Sidplayer by Craig Chamberlain and Stereo Sidplayer by Mark A.Dickenson. In the early days of the SIDPLAY project I was not aware of the existence of those C64 programs. I didn't want to start any confusion by choosing a similar name. Nevertheless, minor support for Sidplayer .MUS files is implemented, too. Various authors have made available ports of SIDPLAY on the most popular operating systems. Please respect the individual licences and wishes of each author, and carefully read version-specific release notes. If you would like to port the freely available emulator engine, which is written in C++, to any available hardware platform or operating system, feel free to do so. It would be nice if you would contact me to tell me about your plans. However, I don't mind if you put out any work silently. You are welcome to help with development of any kind, whether it be player front ends, tools, audio enhancements, or emulation improvement. The term ``sidtune''Apparently, the European part of the world refers to any piece of Commodore 64 music - where the SID chip is used to produce sound - as sidtune, while some of the American part of the world only denote music, which is made with the C64 programs Sidplayer or Stereo Sidplayer, sidtunes or just sids. In any SIDPLAY related document the term sidtune applies to any kind of SID music. This should be an obvious decision, considering that hardly any music from well-known C64 games and demos was made with either the two applications mentioned above, but each song is commonly called a sidtune. Especially it is not distinguished between ready-to-play files and music player machine code (and data) in a C64 program. For instance, you can hear someone saying ``I'm listening to the Commando sidtune'' instead of something like ``I'm listening to Rob Hubbard's music from Commando''. And another one writes ``I will mail you the new sidtunes I've managed to rip from games and demos''. Sidtunes for SIDPLAY and compatiblesMore than 10000 different sidtunes from Commodore 64 games and demos are available on the Internet. A lot even contain several sub-songs. These musics are still copyrighted by their original creators or by the company who owns the rights in the first release. As of 1996 a lot of the sidtunes are 10 years old. Some are even older, some are not a month old. Hence, spreading them together with the original credits is more likely to act as advertising than causing any consequential damage. Additionally, the maintainers of recent sidtune collections are in contact with a lot of (famous) C64 music composers and get invaluable support upon verifying the song credits and ownerships. Usually SIDPLAY is not distributed together with any SID music files. You need to download additional packages elsewhere if you are new to SID music. The links section is a good starting-point. My own favourite sidtunes are listed here. There is no better SID music collection available than the High Voltage SID Collection. Rather than purchasing expensive CD-ROMs which do often contain nothing else than MegaBytes of crap (for instance, lots of unsorted and outdated sidtune packages from the Internet, each one containing lots of repeats) spend some time on checking out the HVSC. You'll like it. Here are the HVSC News pages. Licence Agreement
NOTE TO DISTRIBUTORS OF FREEWARE, SHAREWARE,
PUBLIC DOMAIN SOFTWARE, CD-ROMS AND OTHER SIMILAR SOFTWARE
This licence applies to any of the official versions of SIDPLAY unless explicitly
stated otherwise by an official SIDPLAY author. Official versions are any releases
of this software that have been distributed or linked from the SIDPLAY Home Page,
respectively.
This software including all enclosed files is protected by the German and international
copyright laws. |
||||
Technical information
Emulator EngineMOS-6502/6510 Micro Processor Unit (MPU) interpreter:
|
The truth about SID
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If you think the emulation is better, you most likely are used to it and don't remember the sound of a real SID chip. Be assured that not even all of the old tunes (1983-1991) sound fully correct. Certain features could be added to the emulator at any time, but would not necessarily increase the accuracy of emulation. For instance, adding a cycle-accurate 6510 emulator to SIDPLAY would require to redesign its SID emulator. For some sidtunes this could even lead to a lower emulation quality. The wrong wayOn Usenet you can meet C64-emulator users who are certain that Adlib/OPL2/OPL3-based SID emulation is better due to its smoother sound. This is ridiculous. Those people are labouring under a misapprehension. Once and for all, the Adlib/OPL FM-chips cannot be used to produce SID-like sounds, effects and filters. They are too different. In the same newsgroup it has been said that SID emulators would do end-level filtering like some MOD players do. This is nonsense. SID filtering is applied to each individual voice separately after volume modulation, of course. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Impossible mission?Now, what would be necessary to reach an emulation accuracy of 100%? Or to re-phrase the question, where are the differences between a real and an emulated SID chip? Sampling - i.e. digitizing - the entire variety of sounds a SID chip can produce is not possible either. Hence the most common approach is to examine the SID's waveforms and envelope data via its readable voice/operator three and try to calculate similar data. This method seems to work fine for the reproduction of normal waveforms, synchronization, ring modulation, and a rough ADSR-envelope. Like the SID, filtering and volume modulation needs to be applied on top of the waveform data. But the SID's final audio output still differs due to D/A conversion, output amplification, side-effects and additional undocumented behaviour under certain circumstances. The combined waveforms vary with frequency and time and thus need a new emulation approach. Frequency-shifting a recorded combined waveform is not satisfactory. In case of very fast chip access as it is performed in multi-speed music players, the SID chip can show an unexpected behaviour. But even during normal operation a SID chip's behaviour does not always match the existing specification. What is the SID chip's correct and accurate behaviour? Since exact timing and detailed reproduction of the hardware's state is desired, a perfect SID music player would have to emulate the SID chip on the level of electronic engineering and would have to include cycle-accurate emulation of the complete C64 hardware and software. If that is not possible, the SID emulator engine would have to be cycle-accurate as well. It would have to be capable of changing internal state quickly, but still accurately. Considering exceptions, side-effects, and hardware limits, what is the SID chip's correct and accurate behaviour in all cases? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Features of a next generation SID emulator
PlaySID is also taken as reference, because it was the first SID music player
ever. Notice that cycle accurate CPU emulation is the key to emulation of
interrupts, all D418 sample players and any real-time stuff. Some of the
features listed in the right most column would just need to be implemented.
Internal differences between the current SIDPLAY code and a superior
emulator are not listed, for instance SIDPLAY's wavelength-based waveform
calculation.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Frequently asked questions
Songs not running in SIDPLAYIf you find a sidtune which does not play, you might have encountered
How to submit a bug report?If you happen to encounter a bug or anything unexpected, contact the author(s). It is very unlikely that the maintainer of a sidtune collection releases non-working tunes. So if you definitely can't get a song to work, try asking the individual maintainer of that collection for verification first. But don't forget to provide at least this information
Where to get sidtunes?The latest and best maintained sidtune collection on the Internet is the High Voltage SID Collection. Related information is located at the same site. You can choose between download of individual sidtunes, automated updates to the collection and always the latest complete collection. Additionally you can use a search engine to look up individual sids. Where can I find the ASM source code of SIDPLAY?You can't. Only the DOS version was written in ASM. The old assembler language sourcecode is available, but will not be published. Anyone with serious interest in creating a new SID player for MS-DOS could port back the 32-bit emulator engine. Can you help me playing SID music in my demo?Although the SIDPLAY emulator engine is not designed and optimized for usage in demos, intros and similar, it is possible to use its platform independent code. A 32-bit C++ compiler, soundcard drivers, and maybe a few portability adjustments are needed. How to transfer sidtunes from the C64?Check the links section on the SIDPLAY home page. There is at least one emulator related home page linked that explains how to process C64 files and where to get the necessary software and hardware. How to replay the same sidtunes on the C64?Since you ask this question you most certainly don't know 6502 machine code programming. There is a sidtune player for the real C64 available. It is compatible to the PlaySID one-file format. Else it has nothing much in common with SIDPLAY. Would you happen to know what the four tunes from SIDPLAY/DOS v1.10 are?
They can be found in any good sidtune collection. How to convert the sidtune file formats?Notice, you don't need to. In case of sidtunes that consist of more than one file, any format conversion is optional. As modern SID music collections come in one-file format only, this question might as well be removed from this FAQ. On the contrary, there are still old sidtune packages on the Internet. Such packages may contain files in any of the supported multiple-file formats. The file naming might be very unusual. And as there is no way to detect plain C64 data files, an unknown file might as well contain text or graphics, but just no music data. By default, but depending on the particular player front end, SIDPLAY searches your directory for the following possible file name extensions and tries to match a pair of files if the specified file is not in one-file format. This list may change at any time:
You have the possibility to configure other default file extensions. In case of two-file sidtunes you only need to provide file names which contain any of the extensions supported by the particular version of SIDPLAY you are using. It is recommended that you get accustomed to the *.sid extension for one-file sidtunes. Experienced users of SIDPLAY may want to do optional conversion when working on sidtunes. For instance, if you would like to change the song info or modify the ripped data. This may either be done from inside the player front end or with external utilities. How to extract old collections for PlaySID?Q: When I downloaded the song archives, I found out that I can't extract the .INF files from the .LHA files. Apparently, when I use DOS to extract them, LHA can't handle the fact that the files have a four character extension .INFO. How can I get the info files out of the LHA files? A: Use LHA x -a -m2 to extract the files from the LHA archives. When the extraction is complete you don't need to convert any files for use with SIDPLAY. But before proceeding, make sure what types of files the archive contained. This is necessary to successfully complete the following probably required renaming procedure:
How to extract the NemeSIDs Collection?With MS-DOS always use LHA x -a -m2 to extract the files from the LHA archives. While option -a allows files with any attributes to be extracted, option -m2 enables renaming of double filenames. Double filenames are caused by LHA cutting long filenames from the AmigaDOS file-system to the limited length of the (MS-)DOS file-system. When the extraction is complete you find a lot of files named psid.* in each directory. In some newer packages the filename is simply the name of the tune. Caution. A few files are read only or even hidden. You will have to manually change their file attribute to be able to see them. The main job will be to rename the files, so that SIDPLAY is able to find and list them. Adding a support file extension to each file should usually be enough. For some operating systems there are small helper utilities which are capable of renaming sidtune files automatically. 4DOS users may like to make use of the Psid EXtracting utility. The script and its documentation are available on most C64 emulation FTP servers. You are advised to upgrade to a more recent sidtune collection. How to make SID music?Get a SID music editor at Funet or any other C64-related FTP site. You are strongly advised to compose your music on a real C64 to ensure that it does not depend on accuracy of SID emulation. Alternatively, you can use any available C64 emulator with satisfactory SID emulation, for instance VICE. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PlaySID compatibility issuesIf you use SIDPLAY together with old music collections which have been made especially for PlaySID on AMIGA, you are likely to find troublemakers among the sidtunes. You are advised to stop using such old collections. They often contain lots of wrong credits and duplicates. Lack of bank switchingIf some tunes stay silent or sound strange in an undescribable manner, try toggling the PlaySID environment mode. It is a similar memory environment like PlaySID uses. It may sometimes be referred to as PlaySID compatibility mode. It is just provided to ensure compatibility even in the worst case. This mode is disabled by default, since it does not provide as flexible emulation as the native SIDPLAY mode does. It is not recommended to enable it by default unless you really encounter some PlaySID-specific sidtunes and you know what you are doing. In modern sidtune collections you usually don't need to disable any sort of bank-switching. Please note, that PlaySID's one-file format PSID is still the most common format used by sidtune collections. The musics in PSID format might have been converted from SIDPLAY's ASCII info file format without any loss of data. But the playback may cause problems due to a difference in PlaySID's and SIDPLAY's emulation and way of handling and initializing the music data. PlaySID pretends plain 64 kB of C64 random-access-memory to get rid of C64-bank-switching but does not allow the safe usage of the memory range under the SID address space. Some sidtunes use this memory for large data, e.g. samples in Chris Hülsbeck's ``Chip War'', and they sound damaged in PlaySID. The C64 uses bank-switching to map parts of the ROM and I/O address space into the limited physical address space of 64 kB. When SIDPLAY was developed from scratch, without any knowledge of PlaySID's inner workings, I decided to emulate partial bank-switching as well (although the current implementation level of SIDPLAY does not provide full support for code execution in ROM). The benefit of this decision is the ability
Attracted (or misguided?) by the plain C64 memory of PlaySID, rippers of hundreds of sidtunes totally neglected bank-switching in the changes they did to the music players. Luckily, there are only a few tunes where bank-switching would be required to successfully run them on a real C64 or SIDPLAY. Concerning the latter, the tunes just stay silent or in the worst case drop some notes or voices. For instance, Fred Gray's ``Army Moves'', ``Madballs'', ``Troll'' or Martin Galway's ``Mikie'' had been PlaySID-specific, but have been fixed to work correctly. As long as there are still PlaySID-specific sidtunes floating around in various packages on the network, you might have to temporarily enable the PlaySID environment mode to get a particular tune to work. Emulator dependent codeThere is another minor problem with PlaySID-specific sidtunes that can cause sidtunes to stay silent or malfunction. We discovered some sidtunes that assume the processors' registers to contain a constant value (zero) upon initialization. Those tunes don't run on a real C64 (where the processors' registers contain the last active value, which is unlikely to be zero). Inspite of this, SIDPLAY provides the song number in all three processor registers upon song initialization. This was proposed by some users in the early development stage of SIDPLAY/DOS. In PlaySID compatibility mode SIDPLAY behaves like PlaySID and uses only the Accumulator and clears X- and Y-Register. Sub-routines should correctly initialize all the registers and addresses they use. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Acknowledgements and greetingsPersons I would like to thank and greet (in random order): Adam Lorentzon for doing and maintaining the versions for Microsoft Windows. Andreas Varga for doing and maintaining the version for the PowerPC, reporting lots of bugs and for his SID Homepage. All the other authors on the various operating systems who make SIDPLAY a multi-platform SID music player. Per Håkan Sundell for finally revealing [3] parts of his PlaySID sourcecode related to the PlaySID-specific Extended SID Chip Registers, and of course for writing the first experimental SID emulator on AMIGA back in 1990 together with Ron Birk. The program which has started it all. Among the musicians I would like to greet Jens-Christian Huus, Chris Hülsbeck, Jeroen Tel, Martin Galway and Chris Abbott, as well as all the others who are contributing their old C64 work in form of complete collections. The Shark, creator and maintainer of the High Voltage SID Collection, which I consider to be the best sorted and most complete sidtune collection on the Internet. The HVSC team and active mailing-list participants or the major sidtune rippers: Wilfred Bos, Dennis ``Deadman'' Lindroos, Imre ``LaLa'' Olajos (Jr.). Jan Diabelez Arnt Harries, Guido Gouweloos, J. Fredrik Claesson, Kristoffer Johansson, Inge Pedersen, Gabriele Priarone, Warren Pilkington, Laust Brock-Nannestad and all the innumerable HVSC contributors. Agust Arni Jonsson, who showed up with a lot of enthusiasm for SID music when he started the first major sidtune collection project on the Internet, the NemeSIDs Collection. Jörn-Erik Burkert for the first wonderful SIDPLAY web page logo. Last but not least, I remember the following persons providing some sort of help, in no special order: George W. Taylor, Asger Alstrup Nielsen, Dimitri Ars, Tero Kilkanen, Joseph R. Salazar, David Strauss, Julien Clermonte, Åge Røbekk, Toni Nikkanen, Justin Scharvona, Patrick van Logchem, Christian Bauer, Sasa Stiasni, Björn Fischer, Peter Kunath, Geir Tjelta. This list is hopelessly incomplete. If I accidentally missed you, and you think you would deserve to be on this list, please apologize, but don't forget to drop me a line.
[1] Since I wanted the term SID to be part of the player's name there were't been too many alternative names: Dr.SID, SID-it!, (just) SID, SID Player (this is what the program itself is, but not a name :), PlaySID? (no, different emulation, a different program, a different name), SIDemu, SID2PC, SID Sound, SID Music, ... or maybe I was just too unimaginative. [2] The C64 was not the only computer that had the SID chip, but it was the most popular one. Second was the Commodore 128. In the early 80's a PC soundcard from Ensoniq had the SID chip as well. [3] The rumours, which stated that Ron and Håkan had fooled me with false documentation, were wrong! Whoever started such rumours misunderstood that the term fake-sample docs actually referred to documentation about C64 fake-samples. PlaySID introduced a set of extended SID registers, which aid in emulating a few ways a C64 is used to replay digitized sounds. |