If opening the default devices, need to add a listener for kAudioHardwarePropertyDefaultInputDevice etc and if those devices change, re-open the devices...
Comment...Question: Recently i'd asked about formula used in RS5k to map gain to velocity (askjf.com/index.php?q=6883s and based on your reply wrote a function to adjust velocity by dB. But what i found out was that although the calculated velocity values at 6 dB velocity intervals (i.e. 2, 4, 16, 32, 64, 127) did match the Loudness Meter JSFX readings, the intermediate values did not.Turns out that according to the Loudness Meter output, within each range gain isn't mapped to velocity uniformly, therefore division of 6 by the number of velocity units in the range (e.g. 6/16, 6/32, 6/64) to find out dB per velocity unit doesn't produce accurate results. The diviation could be up to 6 velocity units. So my question is if there's a formula you would be able share which takes into account this lack of uniformity in the mapping or if you could explain how it's calculated. Asked by Buy One (95.134.60.x) on October 15 2023, 2:00pm Reply on October 15 2023, 2:14pm (edited at October 15 2023, 2:22pm):
are you interpolating between these steps in dB or as a scale that is later converted to dB? Sounds like you're doing the former and you should be doing the latter.
e.g.
If you want to see the gain difference for each step, calculate sc and gain_db for the steps then look at the difference between each step's gain_db.
3 Comments...