Using MIDI Controller Data?


#1

Hello,

I know there is etc.midi_notes[]. Is there something similar with controller data like etc.midi_control[] ?
Or do we have only controls 21 to 24 (equivalent to the knob settings)?

@.critterandguitari: would it be possible to implement it?

Best regards
Florian


#2

not, on etc no… but there is on otc.

etc would need an os upgrade to do it.


#3

The OS (arch Linux)? Or do you mean the etc module (the one that contains the functions like .knob3 - not the effect modules, that we handle)?

Florian


#4

no, i mean ‘etc_mother’, so the python code.

when i did it on OTC it was an easy change, but for ETC, it would also require C&G to create an ‘upgrade’ process (i don’t think this has been done before for etc!?)
… again not too difficult, and useful for the future.

(Id port the otc code over, but ive no way of testing it, nor developing the upgrader)


#5

you will only ever get CC 21-24 from the MIDI port on the ETC, all other CC numbers are filtered out in firmware and cannot be changed (at least without taking the case off and using a programming cable)… MIDI over USB could do any CC, but isn’t supported on ETC without updating software.


#6

Hi,

This entry is modified. Modified or added text parts are marked in italics…:

I managed to use more MIDI controllers at least on my laptop testsystem. I still get an error if I try it on the ETC “Exception IndexError: ‘list index out of range’ in ‘liblo._callback’ ignored”. I assume on the laptop the function for checking the builtin knobs is ignored. On the ETC checking for 16 knobs fails, because there are only 5 real knobs.

You have to have SSH access to the ETC, then you can edit the various python files which sum up to the ETC program (and more important: you can make backups in case you fail editing…)

I simply extended the count of “knobs” to 16 (I use a Doepfer Pocket Control, which provides 16 controllers). Most changes are, that I extended the range of a “for…”-loop from 5 to 16. And sometimes individual settings for each knob are required.

Here is the diff-list for the files from /root/ETC_Mother/ which I edited (left file is the edited version, the right file is the regular version):

################ etc_system.py #################
69,79d68
<     knob6 = .500
<     knob7 = .500
<     knob8 = .500
<     knob9 = .500
<     knob10 = .500
<     knob11 = .500
<     knob12 = .500
<     knob13 = .500
<     knob14 = .500
<     knob15 = .500
<     knob16 = .500
82,85c71,74
<     knob = [.2] * 16
<     knob_hardware = [.2] * 16
<     knob_snapshot = [.2] * 16
<     knob_override = [False] * 16
---
>     knob = [.2] * 5
>     knob_hardware = [.2] * 5
>     knob_snapshot = [.2] * 5
>     knob_override = [False] * 5
147c136
<         for i in range(0,16):
---
>         for i in range(0,5):
158c147
<         for i in range(0, 16) :
---
>         for i in range(0, 5) :
173,183d161
<         self.knob6 = self.knob[5]
<         self.knob7 = self.knob[6]
<         self.knob8 = self.knob[7]
<         self.knob9 = self.knob[8]
<         self.knob10 = self.knob[9]
<         self.knob11 = self.knob[10]
<         self.knob12 = self.knob[11]
<         self.knob13 = self.knob[12]
<         self.knob14 = self.knob[13]
<         self.knob15 = self.knob[14]
<         self.knob16 = self.knob[15]

################ midi.py #################
7c7
< cc_last = [0] * 16
---
> cc_last = [0] * 5
36c36
<                 for i in range(0,16) :
---
>                 for i in range(0,5) :

################ osc.py #################
8c8
< cc_last = [0] * 16
---
> cc_last = [0] * 5
27c27
<     for i in range(0, 16) :
---
>     for i in range(0, 5) :

################ osd.py #################
116d115
<     draw_knob_slider(screen, etc, 270, 362, 4)

################ etc_system.py #################
69,79d68
<     knob6 = .500
<     knob7 = .500
<     knob8 = .500
<     knob9 = .500
<     knob10 = .500
<     knob11 = .500
<     knob12 = .500
<     knob13 = .500
<     knob14 = .500
<     knob15 = .500
<     knob16 = .500
82,85c71,74
<     knob = [.2] * 16
<     knob_hardware = [.2] * 16
<     knob_snapshot = [.2] * 16
<     knob_override = [False] * 16
---
>     knob = [.2] * 5
>     knob_hardware = [.2] * 5
>     knob_snapshot = [.2] * 5
>     knob_override = [False] * 5
105c94
<     osd = True
---
>     osd = False
147c136
<         for i in range(0,16):
---
>         for i in range(0,5):
158c147
<         for i in range(0, 16) :
---
>         for i in range(0, 5) :
173,183d161
<         self.knob6 = self.knob[5]
<         self.knob7 = self.knob[6]
<         self.knob8 = self.knob[7]
<         self.knob9 = self.knob[8]
<         self.knob10 = self.knob[9]
<         self.knob11 = self.knob[10]
<         self.knob12 = self.knob[11]
<         self.knob13 = self.knob[12]
<         self.knob14 = self.knob[13]
<         self.knob15 = self.knob[14]
<         self.knob16 = self.knob[15]

################ main.py #################
128c128
< osd_is = True
---
> osd_is = False

################ midi.py #################
7c7
< cc_last = [0] * 16
---
> cc_last = [0] * 5
36c36
<                 for i in range(0,16) :
---
>                 for i in range(0,5) :

################ osc.py #################
8c8
< cc_last = [0] * 16
---
> cc_last = [0] * 5
27c27
<     for i in range(0, 16) :
---
>     for i in range(0, 5) :

################ osd.py #################
105c105
<     pygame.draw.rect(screen, etc.BLACK, (50, 355, 438, 55))
---
>     pygame.draw.rect(screen, etc.BLACK, (50, 355, 228, 55))
111,112c111,115
<     for i in range (0,16):
<         draw_knob_slider(screen, etc, 170 + (i*20), 362, i)
---
>     draw_knob_slider(screen, etc, 170, 362, 0)
>     draw_knob_slider(screen, etc, 190, 362, 1)
>     draw_knob_slider(screen, etc, 210, 362, 2)
>     draw_knob_slider(screen, etc, 230, 362, 3)
>     draw_knob_slider(screen, etc, 250, 362, 4)

The setting starts the OSD immediately. If you don’t like that, keep the
“osd = False”

And last but not least here is a test-mode (requires a font.ttf in the directory of your mode):

import pygame
import pygame.freetype

pygame.freetype.init()

def setup(screen, etc):
    pass

def draw(screen, etc):
    font = pygame.freetype.Font(etc.mode_root + "./font.ttf", 30)
    for i in range (0,16) :
        unistr = unicode("Knob"+str(i+1)+": " + str(etc.knob[i]))
        (text, textpos) = font.render(unistr, etc.color_picker())
        screen.blit(text, (600,100 + (i * 30)))

#7

just to re-interate what owen said… ( as i understood it)

this will only work on the USB interface, not on the DIN (serial) interface as the STM controller filters others CCs

outside of this, id recommend doing as Ive done in OTC, and simply create a new CC array, where you store the last values - i don’t see much advantage of creating ‘virtual knobs’ , seems like more effort, and the resulting modes are no more/less compatible.