Lixie-Labs / Emotiscope

Let your eyes enjoy the music too ✨ Extremely low-latency audio processing lets LEDs perfectly synchronize to your music's notation and tempo.
GNU General Public License v3.0
27 stars 5 forks source link

Should touch input use a very slow moving average instead of thresholds? #90

Closed connornishijima closed 1 month ago

connornishijima commented 2 months ago
if ( touch_val >= current_sensor_reading_ema * (SENSITIVITY ADJUSTMENT) ){
    // touch occurred
}

If so, touch inputs should be ignored for the first 5 seconds the unit is on to build up the moving average.

connornishijima commented 2 months ago

Same with ambient audio noise?

If a particular band of the GDFT hasn't gone below a certain value in 30 seconds, that should automatically become the noise floor.

larryqiann commented 2 months ago

I like the idea of "automatic baseline calibration" but I think it's important to address the use case where some music contains prolonged sections of content at a certain volume (or for audio where there is desirable background noise, such as talking in an outdoor environment).

connornishijima commented 2 months ago

I've just pushed a commit to the 1.1 branch that implements automated background noise removal with this method if you're curious to try it! Essentially:

If Emotiscope hears a note for more than about 10 seconds without the note changing, it grows a small "blind spot" where that bin is, which goes away with about 10 more seconds without exposure to that frequency. Constant hums like traffic outside, A/C units, or microwaves get filtered away even while music is playing, no user interaction needed.

connornishijima commented 1 month ago

Touch via moving averages has been pushed to 1.1 for anyone curious