datomusic / duo-firmware

Firmware for the Dato DUO
7 stars 4 forks source link

Add potentiometer mapping functions #5

Closed DavidMenting closed 6 years ago

DavidMenting commented 7 years ago

Currently, potentiometer values are mapped to their paramters in a linear way. This does not fit well with most musical parameters. There should be a way to map values in a non-linear fashion, for example providing curves such as logarithmic and inverse logarithmic.

Optionally, this could be implemented like commercial logarithmic potentiometers, providing two sections of different linear mappings to approximate the logarithmic curve while providing better performance.

Should this be added on to analogRead() as an extra attribute? Or should it be a separate mapping function?