Woah, thanks synthjoe!
Perhaps you're alluding to my Compressed Trinity Samples thread?
Yep, that was it
It looks similar, but it is not the same thing at all - no coding is involved, these are linear values. How did you create this raw file? Using some floppy imaging tool?
I took CopyQM images as a starting point and converted them into dd images using the ExpandQM program (Open source, found via google)
What you're looking at is a multisample, meaning that you have several individual samples in one 'file' (in this case seven or eight, each one spreading one octave, if I'm not mistaken).
Yup, I guessed so. Thus the plural "sines" in the title
DSS-1 sample data is 'packed', meaning that to save floppy space they've stuffed two consecutive 12-bit samples in 3 bytes (24 bits). This means that starting from offset 349 (decimal) in your file, you should take the first byte (0x80) and append the high nibble of the next byte (0x0 from 0x09) to get a 12 bit value (0x800). Then you take the low nibble of this byte (0x9) and append it to the end of the next byte (0x81) to get the 12 bit value of 0x819. Take the next byte (0x83) and append the high nibble of the byte thereafter (0x2 from 0x2b) to get 0x832. Remaining 4 bits (0xb) appended to the end of the following byte (0x84) yields 0x84b. Rinse and repeat.
Thanks a lot for the very visual explanation.
You should get values (all hexadecimal): 800, 819, 832, 84B, 864, 87D, 896, 8AF, 8C8, 8E1, 8FA, 913, 92C, 945, 95E and so on. Yielding a perfectly nice sine wave.
Well, I get those values, but the work's not finished on that matter ! (Or am I? Example above serializes as 00 08 19 08 32 08 4B 08... I'll be checking Alchemist's source code when I have a moment)
Depending on your floppy imaging tool you might find that after 1024 bytes things get out of whack. This is because the DSS-1 uses sector interleave on the disk, but this seems to be implemented in hardware and therefore imaging tools cannot read data in a consecutive way. After 5 * 1024 bytes the 'skip' pattern should repeat, given that there are 5 sectors in a track on the floppy. In the image file you'll have sectors 1, 3, 5, 2, 4 following each other (1024 bytes each), so you'll have to reorder these blocks to restore the linear stream of data.
Now I couldn't have possibly guess that ! Heaps of thanks!
Having applied your desinterleaving pattern, the data organization looks more obvious. I still run into some inconsistencies tho (Off-by-some-pages adresses, the direction of the error not being constant, nor the very presence of it).
Hope this helps.
It sure does. I'll get back to the code later, this was a nice night
