Yes, certainly.
Sadly no, because there was a different bug in early versions of Audacity that caused 24 bit sample values to be calculated incorrectly and that didn’t get fixed until well into 1.3.x versions.
Nyquist code to generate a sequence of every 24 bit sample value (about 6 min 20 seconds duration):
;; generate ramp with one sample at each 24 bit value
(abs-env
(control-srate-abs *sound-srate*
(pwlv -1 (/ (power 2 24) *sound-srate*) 1)))
Nyquist code to read sample values in 24 bit format. All values should be integers. The sample values are displayed with one decimal place just to show that they are integers.
;; print 24 bit value for x number of sample
(setq x 20)
(setq *float-format* "%1.1f")
(setq output "")
(dotimes (i x)
(setq output
(format nil "~a~%~a" output
(* (power 2 23)(snd-fetch s)))))
(print output)
Note: Nyquist runs in 32 bit float. If dither is enabled and the track that it is generating into is less than 32 bit float, the output will be dithered.
Test results:
- Generate samples into a 32 bit float track.
The samples test as sequential integer values. Example output from 4min into the track :
2195392.0
2195393.0
2195394.0
2195395.0
2195396.0
2195397.0
2195398.0
2195399.0
2195400.0
2195401.0
- Generate samples into a 24 bit track, dither = none.
Same results as 1 (as expected). Example output from 1 min into the track:
-5742608.0
-5742607.0
-5742606.0
-5742605.0
-5742604.0
-5742603.0
-5742602.0
-5742601.0
-5742600.0
-5742599.0
- Generate samples into a 24 bit track, dither = triangle.
Sample values are still integers (as they must be for 24 bit) but there is a degree of random variation in the values due to the triangle dither.
Example output from 4min into the track :
2195392.0
2195393.0
2195394.0
2195394.0
2195396.0
2195398.0
2195398.0
2195399.0
2195400.0
2195400.0
- Generate samples into a 32 bit float track. (the sample values are in sequence).
Export as 24 bit with dither = none.
Import the track and test the sample values.
The sample values are still integers in sequence as expected.
Example output from 4min into the track :
2195392.0
2195393.0
2195394.0
2195395.0
2195396.0
2195397.0
2195398.0
2195399.0
2195400.0
2195401.0
- Generate samples into a 32 bit float track. (the sample values are in sequence).
Export as 24 bit with dither = triangle.
Import the track and test the sample values.
The sample values are still integers in sequence. Dither has not been applied.
Example output from 4min into the track (Note that the sample values are identical to test number 4) :
2195392.0
2195393.0
2195394.0
2195395.0
2195396.0
2195397.0
2195398.0
2195399.0
2195400.0
2195401.0
- Modify the generator code so that we get some fractional values:
;; generate ramp from -0.25 to +0.25
(abs-env
(control-srate-abs *sound-srate*
(pwlv -0.25 (/ (power 2 24) *sound-srate*) 0.25)))
Modify the sample reading code so that we get 2 decimal places by changing (setq float-format “%1.1f”) to (setq float-format “%1.2f”)
Generate samples into a 32 bit float track.
The samples test as sequential half-integer values. Example output from 4min into the track :
548848.00
548848.25
548848.50
548848.75
548849.00
548849.25
548849.50
548849.75
548850.00
548850.25
- Export the track from test 6 as 24 bit with dither = none.
I would have expected integer results rounded to the nearest value but we actually get rounded down values.
Example output from 4min into the track :
548848.00
548848.00
548848.00
548848.00
548849.00
548849.00
548849.00
548849.00
548850.00
548850.00
- Export the track from test 6 as 24 bit with dither = Triangle.
We would expect integer results with a degree of randomness to the values due to the dither.
We actually get results identical to test 7 - the values are rounded down.
548848.00
548848.00
548848.00
548848.00
548849.00
548849.00
548849.00
548849.00
548850.00
548850.00
- Same as test 8 but with dither = shaped.
Again we get identical results as test 7.
\
- Same as test 8 but with dither = rectangle.
Again we get identical results as test 7.
Conclusion:
Exporting 32 bit float audio to “signed 24 bit Integer PCM”, using “Other uncompressed files” always rounds down the sample values and dither is never applied.