[Newbie] Rotary encoder confusion

Hello,

Just started with Midibox. First, I want to build a controller for controlling various CC parameters in my VST’s. Got the first kits from Smashtv an soldered everything together.

Burned the bootloader to the CORE_STM32F4 Module and loaded the Midibox NG app.

Connected a DIN and a small LED display to the CORE_STM32F4 Module.

 

First test: print “Hello World” to LCD …works…
Second test: Connect a button …works…
Now it is time to connect a Rotary encoder…
All seems to work.

With the following small program:

RESET\_HW LCD "%CEncoder Values" # Hardware configuration ENC n=1 sr= 1 pins=0:1 type=detented1 # Events EVENT\_ENC id=1 fwd\_to\_lcd=1 type=CC chn= 1 cc= 16 range=0:127 lcd\_pos=1:1:1 label="^std\_enc"

I get the folowing output in the debug-screen:

[1934162.881] MBNG\_ENC\_NotifyChange(1, 1) [1934162.882] [EVENT] id=ENC:1 hw\_id=ENC:1 bank=0 fwd\_id=DISABLED:0 type=CC value=1 label=^std\_enc [1934163.305] MBNG\_ENC\_NotifyChange(1, -1) [1934163.305] [EVENT] id=ENC:1 hw\_id=ENC:1 bank=0 fwd\_id=DISABLED:0 type=CC value=1 label=^std\_enc [1934163.466] MBNG\_ENC\_NotifyChange(1, -1) [1934163.466] [EVENT] id=ENC:1 hw\_id=ENC:1 bank=0 fwd\_id=DISABLED:0 type=CC value=0 label=^std\_enc [1934163.650] MBNG\_ENC\_NotifyChange(1, -1) [1934163.651] [EVENT] id=ENC:1 hw\_id=ENC:1 bank=0 fwd\_id=DISABLED:0 type=CC value=0 label=^std\_enc

The LCD outputs only a 0 or a 1. What am I doing wrong that the value does not increment or decrement? When I slide the CC16 slider in the virtual keyboard, the LCD takes over the correct value. And as soon as i touch the encoder the values flip back to 1 or 0.

When I set the range to a map the values on the LCD show the values from the map correct and increment en decrement correctly.

I hope that someone can shed some light on this subject… :wink:

Cheers,
Kees

Hi Keeze

I don’t see a fwd_id in your config and the output seams to Disable it somehow. I don’t know if that is the problem, but maybe you can add a fwd_id to test.

RESET\_HW LCD "%CEncoder Values" # Hardware configuration ENC n=1 sr= 1 pins=0:1 type=detented1 # Events EVENT\_ENC id=1 fwd\_id=881 fwd\_to\_lcd=1 type=CC chn= 1 cc= 16 range=0:127 lcd\_pos=1:1:1 label="^std\_enc"

fwd_id can be anything you don’t already use… this sample = 881

Regards, Novski

Hello Novski,

Tnx for your reply!
I added the suggested fwd_id, but than the program stucks saying:

[11261.264] AUTOLOAD 'ENC' [11261.264] [MBNG\_FILE\_C:6] ERROR: invalid fwd\_id controller name in EVENT\_ENC ... fwd\_id=123 [11261.264] [MBNG\_FILE\_C] Event Pool Number of Items: 0 [11261.264] [MBNG\_FILE\_C] Event Pool Allocation: 12 of 65536 bytes (0%) [11261.275] Patch 'ENC' loaded from SD Card! [11261.278] [MBNG\_FILE\_R] /ENC.NGR (optional run script) not found

Cheers,
Kees

I could be completely wrong (I am not a C-coder), but in lines 233 - 247 of mbng_enc.c I find:

 s32 value = item.value; if( item.min \<= item.max ) { value = event\_incrementer; if( value \< item.min ) value = item.min; else if( value \> item.max ) value = item.max; } else { // reversed range value = event\_incrementer; if( value \< item.max ) value = item.max; else if( value \> item.min ) value = item.min; }

so value is replaced by event_incrementer and not added? Or am I completely wrong…

value = event_incrementer; vs value += event_incrementer;

Digging further..

Kees

Good find, thanks for the information! :slight_smile:

This bug came in with the changes for interpolation maps.

It’s fixed in this pre-release: http://www.ucapps.de/mios32/midibox_ng_v1_035_pre2.zip

Could you please check if it works at your side? Then I will publish the “final v1.035” at my webpage

Best Regards, Thorsten.

Hi Thorsten,

I confirm that this issue is solved! All works great, a big thanks from Holland! :-)

Keep up the good work!
Cheers,

Kees

Great! :slight_smile:

V1.035 is now officially released.

Best Regards, Thorsten.