Control-Surface icon indicating copy to clipboard operation
Control-Surface copied to clipboard

reset transposer

Open benwadub opened this issue 3 years ago • 2 comments

Post your code hi Pieter , hope you are fine? I just seen in an exemple that pushing transposer up and down at the same time will reset the transposer, how could I reset my encoder transposer when pushing on the push button of the encoder that is wired to pin 3 please?

CCButtonLatched button1 = {3, {120, CHANNEL_16}};
// Instantiate an encoder to change the transposition
EncoderSelector<transposer.getNumberOfBanks()> selector = {
  transposer,
  {4, 5},
  4,
  Wrap::Wrap,
};

benwadub avatar Nov 27 '20 20:11 benwadub

If you look at the documentation for the EncoderSelector constructor, you'll see that the second argument is of type EncoderSwitchPinList, which has the switchPin as a third optional constructor parameter.

EncoderSelector<transposer.getNumberOfBanks()> selector = {
  transposer,
  {4, 5, 3},
  4,
  Wrap::Wrap,
};

tttapa avatar Nov 27 '20 22:11 tttapa

You mean that if I write like this my button will automatically become a reset button for the encoder selector?

benwadub avatar Nov 28 '20 06:11 benwadub