dwhinham / mt32-pi

🎹🎶 A baremetal kernel that turns your Raspberry Pi 3 or later into a Roland MT-32 emulator and SoundFont synthesizer based on Circle, Munt, and FluidSynth.
https://twitter.com/d0pefish
GNU General Public License v3.0
1.27k stars 79 forks source link

Rotatory Encode Reverse Option #104

Closed shaeon closed 3 years ago

shaeon commented 3 years ago

Hello I'm using Edu Arana PI-MIDI 1.3:

https://www.arananet.net/pedidos/product/pi-midi-1-3-a-baremetal-mt32-emulator-using-raspberry-pi-preorder/

The problem its that here rotary encoder its working reverse, if you turn left up volume and if you turn right down volume.

I try find a option for reverse this issue but i can't find.

Can you add an option for can put reverse working in next version?

Thanks so much for your work!

dwhinham commented 3 years ago

Hi!

I can add this as an option, but we should also inform @arananet so that he can check the schematic / encoder.

@arananet: the prototype Pi-MIDI 1.3 that you sent me works with the correct direction - did anything change in the encoder wiring between the prototype and the final version?

If not, did you use a different part for the encoder? It may be a good idea to check this.

Thanks.

arananet commented 3 years ago

Hi Dale,

No, is the same as you got there, but it must be related to the actual encoder itself. They are from a different supplier. This is the schematic. Thanks Dale.

image

shaeon commented 3 years ago

https://user-images.githubusercontent.com/10370710/113720410-e26b5580-96ee-11eb-86ac-2e4067541fc3.mp4

I upload a video working with encoder.

dwhinham commented 3 years ago

Thanks both,

I guess the encoder must have a different pinout which is unfortunate, but not a huge problem - I can just add a config option to negate the direction.

Will be added in the next version. Thanks!

arananet commented 3 years ago

Thanks Dale!.

dwhinham commented 3 years ago

There is now a test build available here: https://github.com/dwhinham/mt32-pi/actions/runs/727192835

A new config option is available:

[control]

# ...

# Reverse the rotary encoder direction (if used by control scheme).
#
# Some rotary encoders may have their CLK/DAT signals swapped, resulting in
# a reversed rotation direction.
#
# Use this option to correct the direction.
#
# Values: on, off*
encoder_reversed = off

You can just download the kernels artifact, update the kernels and edit your config to add the new option.

Thanks!

shaeon commented 3 years ago

Wow! So fast Dale!

It's work as expected. I download new kernel and put on encoder_reversed option in control and now my brain can be relax :)

https://user-images.githubusercontent.com/10370710/113988223-8835d600-984f-11eb-901d-5a8a77a68a2b.mp4

dwhinham commented 3 years ago

Great! Thanks for testing, it'll be included in the next release. 👍