While changing everything else I also modified most things regarding
gain or volume from using 0 to 100 (or -100 thru 0 to 100) to using 1
(or -1 to 1) with only one exception I can think of right now in the
autoVolumeControl(..); - I modified all examples I found .volume or
similar in to suit.
I found opportunity to write these changes, I did not have a chance to
test much more extensively than just compiling it. I will have a chance
to test them by about 24 hours time.
min and max resetting to 0 each reset wasn't as accurate in a shortened
sampling time as making them the opposite of their potential maximums.
removed conditional serial prints as well, they were a hangover from
trying to make AudioInputAnalog & AudioOutputAnalog cooperate in a 'non
standard' order for my current pet project.
Considered renaming Dpp() to what it is abbreviating, being
DataPeak2Peak, but not sure that is a good name anyway.
Adding route() made me review dap_enable() more closely and it wasn't
doing what I intended to do before, it was ignoring I2S coming back from
Teensy, DAP was sourced from ADC as was I2S_DOUT and DAC was sourced
from DAP; Teensy received valid data from ADC but data from Teensy was
just discarded if user selected it.
unsigned short .adc_hpf(uint8_t bypass, uint8_t freeze);
unsigned short .adc_hpf(uint8_t bypass);
bypass & freeze as defined on page 34 of the SGTL5000 datasheet.
Untested, will test it personally in next couple of days but sincerely
expect it will work so committing.
Todo: Test properly. Improve comments and possibly link to wiring
example(s).
While trying to find why assigning more than one set of coefficients for
AudioFilterBiquad results in no output I discovered my check for flag
before updating other than 1st set of coefficients was flawed so I fixed
it.
I also modified the way 'data' is assigned so the assignment only occurs
once per set of coefficients, possibly not the most efficient but I like
it better than my previous method.
These changes don't appear to effect the use of AudioFilterBiquad for a
single set of coefficients and, unfortunately, it doesn't make it start
working either - implementation of a second (or more than one) set of
coefficients still results in output being silenced but the update to
updateCoefs(..) is necessary so I am committing it.
deadly simplistic peak difference measuring object, after begin() just
goes through samples and find the maximum and minimum signed values,
natural behavior of begin() is to reset the max and min, member uint16_t
Dpp() returns maximum difference seen and .stop() does what it says.
'data' needs to be reset inside the 'flag' controlled loop or
*undefined* behavior is likely when user sets 'flag' and loop repeats
without resetting 'data' to beginning of block.