Hmm, interesting afta8. Not sure about dithering/noise algos, but I’ve done a little binary compare test myself. I took a simple 16-bit 44100Hz mono sample.
Asked Renoise to produce a wav file from this and extracted the 16-bit linear PCM sample data. I then ran through my above code to produce a aiff file and extracted the PCM linear data from that file. We are talking a sample size of 19810(bytes) / 2 = 9905 16-bit word size samples. Then I binary compared the two files. They are 100% identical. Now I’m not saying that that is conclusive in any way afta8. I suppose at the moment what I could possibly conclude is that if there is a rounding/error factor creeping in at some point, it is very small between that and a Renoise wav file?