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 Istvn 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 (alaprtelmezs: -1): megszakts frekvencia, ha nulla vagy negatv, akkor a bemeneti file-bl olvassa, egybknt a parancssorban megadott rtket (Hz) hasznlja. -2 esetn ktszerezi a burkolgrbe emulci frekvencijt, ami azonban nveli a kimeneti file mrett (ha nem is a ktszeresre, de a nhny file amit teszteltem 44-65 szzalkkal nagyobb lett).
BLKSIZE (2 hatvnya 256 s 16384 kztt, alaprtelmezs: 8192): a tmrts blokk mrete, a sztr mret ennek a ktszerese (-blocksize BLKSIZE -maxoffs BLKSIZE*2). Nulla vagy negatv rtk is az alaprtelmezett 8K-t lltja be, mst a gyakorlatban nem rdemes hasznlni, mert a kimeneti file lejtszhatatlan lesz.
NOADSRBUG (0 vagy 1, alaprtelmezs: 0): ha nem nulla, akkor a SID burkolgrbe idoztst megvalst 15 bites szmllt nullzza a GATE bit felfut lnl. A valdi hardver azonban nem gy mukdik, teht ebben a mdban rosszabb is lehet a konverzi, br a C64-es lejtszk nha bonyolult trkkket hasznlnak a bug elkerlsre, amiket az egyszeru 50 Hz-es felvtel nem tud reproduklni. A kiszmthatbb idozts mindenesetre nhny szzalkkal javthatja a kimeneti file tmrthetosgt.


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 Istvn) 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