SIDBASIC

Latest release of SIDBASIC, software SID music player, it plays converted SID music on a pure Enterprise 128KB machine without any hardware addon.
The software is EXOS compatible. If your config has any file handling device ( floppy disk controller, SD Card ) then after pressing ESC file selection menu appears, if you have tape config just load the chosen M64 file.
It decompress 8KB data blocks during playing music, this was the key to be able playing full musics on a 128 KB machine.
Limitations: maximum M64 file length is 24320 bytes which can be loaded (5f00h), SYNC, High Pass, Low Pass filters are not implemented, digi effects can not be played back.
Combined waveforms are not working correctly: in this case the conversion is done with priority noise > sawtooth > triangle > square wave.

Controls:
1 - play music with internal Dave chip
2 - play music with external 8bit DAC card if exist
3 - raster bar on (it works only 50Hz playback speed musics)
4 - raster bar off
Esc - file selection

Some words about M64 files:
It contains a 16byte EXOS header: 00h, 4fh, compressed data size (word), IRQ frequency (word), number of interrupts (24 bit), 7 unused bytes(00h)
Compressed data of the following byte sequence for all SID registers in epcompress -raw -m2 -blocksize 8192 -maxoffs 16384 format
Every 8KB data block can contain data collected in max 682 interrupts, 4 converted register collected for all 3 channels in one interrupt, the end of the block (1ffeh-1fffh) contains the number of used interrupts in a block
00-01 byte: SID frequency registers (in case of noise shifted right by 4 bits)
02    byte: bit7 Ring mod, bit5-6 waveforms, bit0-4 SID emulated volume values based on envelopes
03    byte: pulse wave width

Thanks to István Varga for ideas, and following routines, and used tools:
Routines:
Unpack in 8KB blocks
Digi playback routine in interrupt
Generate ideal SID samples for each waveform
Tools:
epcompress  - Enterprise compression utility
epimgconv   - Enterprise picture converter
sid_dump    - get SID register raw data from SID files
sid_conv    - convert SID raw data to M64 format

Conversion of SID files to M64 format:

sid_dump.exe INFILE OUTFILE [LENGTH1 [LENGTH2...]]
sid_dump.exe INFILE OUTFILE [SONGLENGTHS FILENAME]

sid_conv INFILE OUTFILE [INTFREQ [BLKSIZE [NOADSRBUG]]]
INTFREQ (alapértelmezés: -1): megszakítás frekvencia, ha nulla vagy negatív, akkor a bemeneti file-ból olvassa, egyébként a parancssorban megadott értéket (Hz) használja. -2 esetén kétszerezi a burkológörbe emuláció frekvenciáját, ami azonban növeli a kimeneti file méretét (ha nem is a kétszeresére, de a néhány file amit teszteltem 44-65 százalékkal nagyobb lett).
BLKSIZE (2 hatványa 256 és 16384 között, alapértelmezés: 8192): a tömörítés blokk mérete, a szótár méret ennek a kétszerese (-blocksize BLKSIZE -maxoffs BLKSIZE*2). Nulla vagy negatív érték is az alapértelmezett 8K-t állítja be, mást a gyakorlatban nem érdemes használni, mert a kimeneti file lejátszhatatlan lesz.
NOADSRBUG (0 vagy 1, alapértelmezés: 0): ha nem nulla, akkor a SID burkológörbe idozítését megvalósító 15 bites számlálót nullázza a GATE bit felfutó élénél. A valódi hardver azonban nem így muködik, tehát ebben a módban rosszabb is lehet a konverzió, bár a C64-es lejátszók néha bonyolult trükköket használnak a bug elkerülésére, amiket az egyszeru 50 Hz-es felvétel nem tud reprodukálni. A kiszámíthatóbb idozítés mindenesetre néhány százalékkal javíthatja a kimeneti file tömöríthetoségét.


sid_dump runs PSID file on an emulated 6502 environment, it's output SID register raw data, stored by 50Hz, or other frequency based on original SID playback speed.
This file can be played by SID.COM (by István) after compression with epcompress (epcompress -raw -m0 -9 -blocksize 16384 -maxoffs 32768 INFILE OUTFILE, without -9 packing is faster, and the difference in size is minimal), which is a player for SID card for the Enterprise
PSID->RAW conversion can be done in other way by using SIDPLAY.COM (software SID player which plays musin on Dave with only square waves with one PWM) and sidrecn.lua script.

Example for conversion:
1st step get raw SID register data:
..\sidconv\sid_dump.exe MUSICIANS/T/Tel_Jeroen/Cybernoid_II.sid cybnoid2.raw DOCUMENTS/Songlengths.txt MUSICIANS/T/Tel_Jeroen/Cybernoid_II.sid

Name:           Cybernoid II
Author:         Jeroen Tel
Released:       1988 Hewson
Video standard: PAL
SID model:      MOS6581
IRQ frequency:  50.12 Hz
Done converting track 1: 17343 frames
IRQ frequency:  50.12 Hz
Done converting track 2: 451 frames

This step is required for playback for SID.COM
epcompress -raw -m0 -9 -blocksize 16384 -maxoffs 32768 cybnoid2.raw cybnoid2.raw

Compressing data
  100%

2nd step:
..\sidconv\sid_conv.exe cybnoid2.raw CYBNOID2.M64
Converting file...
  100%
Compressing data
  100%

And the file can be played back with SIDBASIC.COM