Open Theremin V3 - invert volume function?

Posted: 5/2/2021 4:32:13 PM
Aleatorus

Joined: 11/13/2020

Purists will cringe, but has anyone tried, or can suggest the Arduino code to look at, to invert the volume control?
i.e. Hand proximity away from the volume antenna, silence, move hand towards the antenna, the volume increases.

Posted: 5/2/2021 5:08:51 PM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

I didn't test it. I rather like the traditionnal volume control. But it should be easily done by something like this:
In "application.cpp" line 290, replace "tmpVolume = vol_v >> 4;" by "tmpVolume = 255 - (vol_v >> 4);"

Posted: 5/3/2021 6:40:09 PM
Aleatorus

Joined: 11/13/2020

I didn't test it. I rather like the traditionnal volume control. But it should be easily done by something like this: In "application.cpp" line 290, replace "tmpVolume = vol_v >> 4;" by "tmpVolume = 255 - (vol_v >> 4);"

Many thanks, I'll try it. Being a keyboard player, it seems more intuitive to me for it to operate like that, so I'll see if it's worthwhile or not.

Posted: 5/19/2021 1:01:18 PM
Aleatorus

Joined: 11/13/2020

I've finally got around to testing it and it works fine, I think I prefer it this way. One thing to bear in mind is that the volume control action is also inverted, which I'm not sure can be altered in the code.

Posted: 5/20/2021 8:00:00 AM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Hi,

To revert Volume Potentiometer action, it is quite the same principle:

application.cpp line 173:

Replace "volumePotValue  = analogRead(VOLUME_POT);"
by "volumePotValue  = 1024 - analogRead(VOLUME_POT);"

Posted: 5/20/2021 6:41:01 PM
Aleatorus

Joined: 11/13/2020

Many thanks!

Posted: 5/20/2021 9:20:50 PM
Mr_Dham

From: Occitanie

Joined: 3/4/2012

Oups...  "volumePotValue  = 1023 - analogRead(VOLUME_POT);" is more correct.

You must be logged in to post a reply. Please log in or register for a new account.