Encoder Widget: clockwise → repeated MIDI note 1 (for example); counterclockwise → MIDI note 2

If I turn the encoder:
→ clockwise, I want my DAW to receive repeated MIDI note 1, on channel 1.
→ counterclockwise, repeated MIDI note 2 (same channel).

Is this possible?
Thank you!

1 Like

Yes, using the widget’s script property (assuming the widget’s target is already set):

if (value === 1) {
  send("/note", 1, 1, 127)
} else if (value === -1) {
  send("/note", 1, 2, 127)
}

Resources:

2 Likes

18 days have passed… Sorry for replying this late.

I tested the code and it works. Now I have to figure out how to make the encoder send fewer messages when I turn the encoder. In other words, I’d like to have the encoder turn smoothly (at 360 ticks / turn), but to behave like it had only 16 ticks. This would mean sending a note message at every 22.5 ticks.

These are the properties of my current encoder (with the code you suggested I should use):

1 Like

You can play with the sensitivity property to reduce the encoder’s verbosity (e.g. 0.05 would roughly do the trick)

2 Likes

Thank you Jean, you made my day !

1 Like