(Back to the original topic)
The removal of (artificial) internal clipping to -1,0...1,0 was discused on audacity-devel in January 2009.
(Partly based on that discussion,) I'd like to make notes that can be perhaps useful sometimes.
(subject '[Audacity-devel] Just to see if I could...fix clipping'; suitable keyword for search on nabble: 'clipping' ).
***
1. [When clipping was avoided]
Ofcourse internal clipping to -1,0...1,0 can be avoided when 32float is used, but not otherwise.
That means that one has to be carefull with non-32float cases:
- input/output (obviously, hardware has limits, I include it here just for completness)
- effects that eventually could be 16bit or 24bit (A. This should not be the case of internall effects - if clipping appears there and persists after 'amplify' with negative dB, it should be considered a bug and I think developpers would like to hear and repair it. B. I do not know how much this applies to LADSPA and VST effects.)
- tracks that are 16bit or 24bit
- in Preferences, Default Sample format
2. [Default Sample format's documentation]
BTW Default Sample rate format in Preferences needs update in documentation.
Somewhere was suggested that after change perhaps restarting audacity or creating new project might be needed (wrong?) which is certainly confused condition, both cannot be the decissive moments.
Documentation
http://www.audacityteam.org/manual/inde ... references says "which will be used each time Audacity is launched, or each time a new project window is opened." (wrong?) which is not much better.
It seems to me (1.3.6a5) that it is used immediately, whenever a new track is created. Perhaps true would be
"which will be used whenever new track is created, in particular when a new track is created for recording, Mix and Render (?), Import and perhaps_anything_more" (because it is not effective to change tracks format after it contains any data already). Perhaps the following might be true (-devel postings supports this case), which is not as easy to test for me:
"Default sample rate is also the sample rate to which the sound card is set, if possible;" and perhaps "for this asspect, however, changes are effective after(or not?) you to restart(or what?) Audacity"
3. [exceptions regarding clipping avoidance]
There are the following "strange" things (which are actully reason of this post) which cause exceptions to
1..
This can, e.g., confuse as when we decide to 'test' clipping/nonclipping.
1. <<non-32float cases: tracks that are 16bit or 24bit>>
16bit track has (usually) 16bit underlying implementation (ofcourse, if I do choose 16bit only if I need to save space!)
but sometimes the underlying representation can hang on 24bit or 32float - this can happen e.g. when copying the sound from 32float (the data is not copied, only 'referenced')
[citation from audacity-devel: But it seems like if you change or copy a float clip to int, the underlying float representation stays float.]
2. Sound card is expected to give data in -1,0...1,0 range.
If I understand well, in a case there was
observed that Audacity recieved data out of this range from sound card.
[citation from audacity-devel: The fact that I was able to recover from a clipped recording means that one of these two things is going on. This should mean that port audio is giving us >1.0 values.]
It was attributed either to A. 32float sound card giving (more-or-less) meaningful data even when clipping or B. portaudio sound input/output library.
I would add that the cause eventually could be also C. sound cards drivers, either by a bug, or by any of the fancy features as de-echo, DC-offset removal, AVC or D. sound card drivers (again) doing a correction to analogue part of card (an equalization, a kind of jitter correction...) or E. sound card drivers (again) doing a requested sample rate conversion (that includes a filter, right?)
4. Notes (this overlaps with
2.)
Default Sample rate format in Preferences:
Either it means INTERNAL (and
then it should be called "Internal" or "Default(=for new tracks???) and internal)
or it means indeed Default (for new tracks? or exactly what) (and then it seems to bemissinterpretted on -devel (which is unlikely)
audacity-devel citation: I am however sure that audacity can be and is used with the bit depth in
the preferences set to 16-bit, working with 16-bit integer data )
I am sorry I cannot tell what is in source code (seeing that long time ago) but I think audacity does not have three engiens (16,24,32bit), so probably all computations (I would guess including internal effects) are done 32float.
Currently I think it is
- sample format for new tracks
- sample format for sound card input/output (if possible)
while internal is 32float (used for all (or almost all?) computations)
and I have no idea about exports (should not have any influence?)