Skip to content
Dale Whinham edited this page Jan 3, 2021 · 6 revisions

As of version 0.8.0, you can connect buttons and/or a rotary encoder to your Raspberry Pi to control mt32-pi.

Controls are enabled by setting the scheme option in the [control] section of configuration file. Only one of the following schemes may be enabled at a time.

Control schemes

Currently, two "simple" control schemes are implemented. An MT-32-style 10-button scheme is planned, which may or may not make use of a GPIO port expander. The following schemes will eventually gain additional actions through combinations or long-presses. A menu system and other interactive controls are also planned for future versions.

simple_buttons

4 buttons via GPIO:

Control Action
Button 1 Switch synthesizer
Button 2 Switch MT-32 ROM or SoundFont
Button 3 Decrease volume
Button 4 Increase volume

simple_encoder

2 buttons and a rotary encoder via GPIO:

Control Action
Button 1 Switch synthesizer
Button 2 Switch MT-32 ROM or SoundFont
Encoder counter-clockwise Decrease volume
Encoder clockwise Increase volume
Encoder button Not yet used (shows a test message)

GPIO pin assignment

⚠ Note: No pull-up resistors are required for the buttons or encoder pins; the Raspberry Pi's internal pull-up resistors are enabled.

Rotary encoder

The rotary encoder has an additional option, encoder_type. When configured properly, one click of the encoder should increase or decrease the volume by exactly 1.

The default value of full assumes that one detent ("click") performs a full cycle of the Gray code.

  • If four clicks are needed for a single movement, try encoder_type = quarter.
  • If two clicks are needed for a single movement, try encoder_type = half.

A typical rotary encoder will have the following pinout:

  • If your encoder looks different, consult its datasheet.
  • If clockwise/counter-clockwise actions are reversed, swap the CLK and DAT pins.
Clone this wiki locally