Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/controllers/midibox_ng_v1/cfg/tests/mackiec4.ngc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
RESET_HW

# "Rotate me" instruction on display above the specific C4 encoder (1st Encoder in top row)
EVENT_SENDER id= 1 bank=0 type=SysEx stream="0xf0 0x00 0x00 0x66 0x17 0x30 0 ^label 0xf7" label="Rotate me!"

# Receives movements of C4's 1st Encoder in top row
EVENT_RECEIVER id= 1 type=CC chn=1 cc=0 emu_enc_mode=C4Enc emu_enc_hw_id=1

# Virtual Encoder that gets modified by the C4-Encoders relative CC messages
EVENT_ENC id= 1 fwd_id=SENDER:101 type=CC chn=1 cc=0 range=0:127 value=0

# Encoder value display on C4
EVENT_SENDER id=101 type=SysEx stream="0xf0 0x00 0x00 0x66 0x17 0x30 0x38 ^macdis 0xf7"

# C4's startup screen must be cleared on top display
EVENT_SENDER id= 201 type=SysEx stream="0xf0 0x0 0x0 0x66 0x17 0x30 0x00 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xf7 0xf0 0x0 0x0 0x66 0x17 0x30 0x38 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0xf7"
4 changes: 4 additions & 0 deletions apps/controllers/midibox_ng_v1/cfg/tests/mackiec4.ngr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if ^section == 0
trigger SENDER:201 # clear C4's top display
trigger SENDER:1 # print instruction in top display's upper row above 1st encoder
endif
26 changes: 26 additions & 0 deletions apps/controllers/midibox_ng_v1/src/mbng_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,32 @@ s32 MBNG_ENC_NotifyChange(u32 encoder, s32 incrementer)
item.value = event_incrementer > 0 ? 0x01 : 0x7f;
break;

//Mackie C4 special case - maps differing rotation accelerations of C4 encoders to varying in-/decrement step-lengths
case MBNG_EVENT_ENC_MODE_C4ENC:
if(event_incrementer > 0){
switch(event_incrementer){
case 1: item.value = 0x01; break;
case 2: item.value = 0x04; break;
case 4: item.value = 0x08; break;
case 8: item.value = 0x0c; break;
case 12: item.value = 0x0f; break;
default: MIOS32_MIDI_SendDebugMessage("event incrementer > 0 default case");
item.value = 0x01; break;
}
}
else{
switch(event_incrementer){
case 1: item.value = 0x41; break;
case 2: item.value = 0x44; break;
case 4: item.value = 0x48; break;
case 8: item.value = 0x4c; break;
case 12: item.value = 0x4f; break;
default: MIOS32_MIDI_SendDebugMessage("event incrementer < 0 default case");
item.value = 0x41; break;
}
}
break;

case MBNG_EVENT_ENC_MODE_INC01_DEC41:
item.value = event_incrementer > 0 ? 0x01 : 0x41;
break;
Expand Down
Loading