View Full Version : Encoder, pots and switch programming Midi CPU
JBLAZE
02-04-2011, 10:53 AM
Hello
I'm planning on building a midi controller to control a software sequencer.
Here are my parts:
4 encoders with push buttons built in. Used for filter control and to turn them on/off.
4 potentiometers. Used for Master volume, pan etc.
8 push buttob switches. Used for transport control.
I would be grateful if someone could help me with the code writing of 1 of each of the components.
That way I would know how to do the rest.
Thanks
Jim McDougall
02-05-2011, 12:13 AM
John and I can help. What we would need is for you to document what each these controls should send as a midi message inculde CC# where appropriate. as follows;
Encoder 1 - encoding up message, encoding down message
Encoder 1 pushbutton on message
Encoder 1 pushbutton off message
repeat for each encoder
Pot 1 CC#
repeat for each pot
Buttons 1 - 8
Button on message, Button Off message
I presume you are building a control surface for your DAW. If you are not sure what to send, I have the references for both Makie MCU and the JL Cooper CS-10 2 as guidelines
JBLAZE
02-05-2011, 10:18 PM
Jim.
Thank you for getting back to me so promptly.
Yes I am building a generic control surface with "freely" assignable controllers to control mainly Logic Pro.
Here is what you asked for:
Encoder 1 - encoding up message, encoding down message Set to CC#22
Encoder 1 pushbutton on message CC# 23
Encoder 1 pushbutton off message CC# ? 23 as well?
Encoder 2 - encoding up message, encoding down message CC# 24
Encoder 2 pushbutton on message CC# 25
Encoder 2 pushbutton off message CC# ?
Encoder 3 - encoding up message, encoding down message CC# 26
Encoder 3 pushbutton on message CC# 27
Encoder 3 pushbutton off message CC# ?
Encoder 4 - encoding up message, encoding down message CC# 28
Encoder 4 pushbutton on message CC# 29
Encoder 4 pushbutton off message CC# ?
Pot 1 CC# 7
Pot 2 CC# 10
Pot 3 CC# 20
Pot 4 CC# 21
Button 1 CC#15
Button on message, Button Off message - yes
Button 2 CC#84
Button on message, Button Off message - yes
Button 3 CC#85
Button on message, Button Off message - yes
Button 4 CC#86
Button on message, Button Off message - yes
Button 5 CC#87
Button on message, Button Off message - yes
Button 6 CC#88
Button on message, Button Off message - yes
Button 7 CC#89
Button on message, Button Off message - yes
Button 8 CC#90
Button on message, Button Off message - yes
With the exception of pot 1 & 2, I have assigned all the others to Undefined CC#, as Logic allows me this option.
I hope this helps.
Thanks.
Jim McDougall
02-06-2011, 01:10 AM
I am afraid that you have to be more specific. For example, here is the command set for the Jl Cooper Cs10-2
All messages from the CS-102 are Controller commands on
MIDI channel 16. These messages are all of the form:
0BFh cc vv
where cc = switch or wheel number and vv = value.
cc Name vv
00h Mute button 1 00 = release, 7Fh = depressed
01h - 06h Mute button 2 - 7 00 = release, 7Fh = depressed
07h Mute button 8 00 = release, 7Fh = depressed
08h Mode button 00 = release, 7Fh = depressed
09h Shift button 00 = release, 7Fh = depressed
0Ah F1 button 00 = release, 7Fh = depressed
0Bh F2 button 00 = release, 7Fh = depressed
0Ch F3 button 00 = release, 7Fh = depressed
0Dh F4 button 00 = release, 7Fh = depressed
0Eh F5 button 00 = release, 7Fh = depressed
0Fh F6 button 00 = release, 7Fh = depressed
10h F7 button 00 = release, 7Fh = depressed
11h F8 button 00 = release, 7Fh = depressed
12h F9 button 00 = release, 7Fh = depressed
13h Rew button 00 = release, 7Fh = depressed
14h FF button 00 = release, 7Fh = depressed
15h Stop button 00 = release, 7Fh = depressed
16h Play button 00 = release, 7Fh = depressed
17h Record button 00 = release, 7Fh = depressed
18h Left Wheel button 00 = release, 7Fh = depressed
19h Right Wheel button 00 = release, 7Fh = depressed
1Ah Up cursor button 00 = release, 7Fh = depressed
1Bh Down cursor button 00 = release, 7Fh = depressed
1Ch Left cursor button 00 = release, 7Fh = depressed
1Dh Right cursor button 00 = release, 7Fh = depressed
1Eh Footswitch 00 = release, 7Fh = depressed
40h Fader 1 Range 0 to 7Fh
41h - 46h Fader 2 - 7 Range 0 to 7Fh
47h Fader 8 Range 0 to 7Fh
48h Boost/Cut Range 0 to 7Fh
49h Frequency Range 0 to 7Fh
4Ah Bandwidth Range 0 to 7Fh
4Bh Send 1 Range 0 to 7Fh
4Ch Send 2 Range 0 to 7Fh
4Dh Pan Range 0 to 7Fh
60h Wheel 2s compliment using 7 bits of data
With the exception of 40h through 4Dh which are continuous controllers(sliders/rotary pots) and 60h (which is the jog wheel) all button send different sysex messages upon depress and release. Since I suspect the curent versions of ProTools still support the CS-10-2, we could use the above as the basis for defining the functions on your surface. Or since you want ot use encoders, then I presume you are going to use the learn function in Pro-tools.
Here is a link to the Mackie MCU protocols which is also supported by protools
http://home.comcast.net/~robbowers11/MCMap.htm
We could map using either of the above protocols.
Hope this clarifies !
JBLAZE
02-07-2011, 09:44 PM
Jim.
Thanks that’s what I need and was trying to explain - poorly. It makes more sense now, what information your after.
Just to clear up any miscommunications, (mostly by me) for both of us, I want to build a generic controller (if there is such a thing) that does not come with pre defined mapping, this is why I was using what I thought was undefined CC#’s (if this is possible). I want it to control Logic Pro, which has a “Controller assignment learn mode” - not Pro Tools
Here is part of the CS10-2 that you posted; I used it to create what I hope you are asking for.
cc Name vv
00h Mute button 1 00 = release, 7Fh = depressed
0Ah F1 button 00 = release, 7Fh = depressed
0Bh F2 button 00 = release, 7Fh = depressed
13h Rew button 00 = release, 7Fh = depressed
14h FF button 00 = release, 7Fh = depressed
15h Stop button 00 = release, 7Fh = depressed
16h Play button 00 = release, 7Fh = depressed
17h Record button 00 = release, 7Fh = depressed
40h Fader 1 Range 0 to 7Fh
48h Boost/Cut Range 0 to 7Fh
49h Frequency Range 0 to 7Fh
4Ah Bandwidth Range 0 to 7Fh
4Dh Pan Range 0 to 7Fh
Here are my changes:
cc Name vv
00h Mute button 1 00 = release, 7Fh = depressed
01h SOLO button 00 = release, 7Fh = depressed
02h CYCLE button 00 = release, 7Fh = depressed
03h Rew button 00 = release, 7Fh = depressed
04h FF button 00 = release, 7Fh = depressed
05h Stop button 00 = release, 7Fh = depressed
06h Play button 00 = release, 7Fh = depressed
07h Record button 00 = release, 7Fh = depressed
08h Fader 1 Range 0 to 7Fh
09h Boost/Cut Range 0 to 7Fh ENCODER POT
0Ah Frequency Range 0 to 7Fh ENCODER POT
0Bh Bandwidth Range 0 to 7Fh ENCODER POT
0Ch Pan Range 0 to 7Fh
If possible encoder buttons to be used as “shift” keys to scroll through the eq’s boost/cut, frequency and bandwidth parameters.
I also have a 5th encoder, which I would like to use as a Jog wheel, which I think you have as:
60h Wheel 2s compliment using 7 bits of data
This is for a university project, which when finished I will be making a bigger version for myself, so thank you in advance for your help!
Just to clarify the discussion a little bit (and not necessarily just for JBLAZE and Jim):
Any CC message traveling through a MIDI cable has a "CC number" 0-127. (It also has a "value" 0-127 which corresponds to "knob position" or "on/off", etc.)
The MIDI spec defines the "conventional meaning" for each CC number, but any device (or software package) can take any CC number and use that CC for whatever function it likes.
So, the MIDI CPU (or any MIDI controller) will send each CC command using a specific CC number. But the software is free to assign the CC number to whatever function (or "meaning") that the publisher would like. (The software can also allow the user to assign the functions for each CC number.)
“Controller assignment learn mode” just means that the software will accept any CC number and allow you to give it the meaning of your choice.
I think the bottom line is that we can use the MIDI CPU to generate commands with arbitrary CC numbers. Then JBLAZE can assign (and at any time, re-assign) them to specific functions on the Logic end.
So, here's JBLAZE's original request, and a sample MIDI CPU control terminal configuration that will make it happen:
Hello
I'm planning on building a midi controller to control a software sequencer.
Here are my parts:
4 encoders with push buttons built in. Used for filter control and to turn them on/off.
4 potentiometers. Used for Master volume, pan etc.
8 push buttob switches. Used for transport control.
Let's use MIDI CPU CT 0-7 for the encoder input. Each encoder is connected to a pair of control terminals (0,1; 2,3; 4,5; 6,7).
CT 8-11 can be the pushbuttons for the encoders. (momentary action)
CT 12-19 can be the transport pushbuttons. (momentary action) We can also accomodate latching if necessary.
CT 20-23 will be used for the potentiometers (analog input).
The control terminal configuration sysex looks like this (instructions for sending to the MIDI CPU here (http://forum.highlyliquid.com/showthread.php?t=280)):
// Fixed Header
F0 00 01 5D 04 01
// Layer 00h
00
// CT 0-7: Encoder input, CC 0-3
00 00 14 00 00 11
01 00 14 00 00 11
02 00 14 00 01 12
03 00 14 00 01 12
04 00 14 00 02 13
05 00 14 00 02 13
06 00 14 00 03 14
07 00 14 00 03 14
// CT 8-19: Switch input, CC 4-15
08 00 56 00 04 00
08 01 7F 00 00 00
09 00 56 00 05 00
09 01 7F 00 00 00
0A 00 56 00 06 00
0A 01 7F 00 00 00
0B 00 56 00 07 00
0B 01 7F 00 00 00
0C 00 56 00 08 00
0C 01 7F 00 00 00
0D 00 56 00 09 00
0D 01 7F 00 00 00
0E 00 56 00 0A 00
0E 01 7F 00 00 00
0F 00 56 00 0B 00
0F 01 7F 00 00 00
10 00 56 00 0C 00
10 01 7F 00 00 00
11 00 56 00 0D 00
11 01 7F 00 00 00
12 00 56 00 0E 00
12 01 7F 00 00 00
13 00 56 00 0F 00
13 01 7F 00 00 00
// CT 20-23: Analog input, CC 16-19
14 00 04 00 10 07
15 00 04 00 11 08
16 00 04 00 12 09
17 00 04 00 13 0A
// Footer
F7
I simply chose an arbitrary CC # for each control. Of course these can be changed.
Also, the encoder pushbuttons use a different CC number than the encoder rotation. Not sure if this is what you need, but we can tweak this as well.
Let me know if this was helpful. :)
JBLAZE
02-09-2011, 10:37 PM
John
Thanks very much, You have done more than I had expected, it seems to make sense now that I see it. I'll let you know how it works out.
Once again, thank you both very much.:)
JBLAZE
05-02-2011, 12:26 AM
Hello John.
Thanks for your help previously but I have a problem. I tried to load the sysex code into the midi cpu using sysex librarian after converting the code you created for me. I don't think I was able to load the code. I tried to use my controller with Logic Pro 8. The rotary encoder increments and decrements but it either jumps straight to 0 or 127 values nothing in between. The potentiometer does the same and the n/o switches don't stay on. Am I doing something wrong? Was I not suppose to load the whole code at once?
Thanks in advance.
Jim McDougall
05-05-2011, 12:59 AM
Yes the whole block john published should be one load. You can verify whether it was loaded or not by using your sysex librarian to retrieve a dump from the MidiCPU see the manual for how to do this. Then look at the dump. You will be able to see whether the new configuration data was loaded
Hi Jim, would you mind writing some sysex for me that would allow one midi cpu to support 12 encoders (with no push buttons obviously). Again, same as the OP, I don't mind which midi messages are sent (just use CC's 1-12 if you like).
Thanks in advance :)
JBLAZE
05-07-2011, 11:37 AM
Jim
I got it working before your reply, but thanks anyway.
Mil0,
// Fixed Header
F0 00 01 5D 04 01
// Layer 00h
00
// CT 0-7: Encoder input, CC 0-3
00 00 14 00 00 11
01 00 14 00 00 11
02 00 14 00 01 12
03 00 14 00 01 12
04 00 14 00 02 13
05 00 14 00 02 13
06 00 14 00 03 14
07 00 14 00 03 14
This is the code that i used to control 4 encoders. You can see the pattern, just carry it on for 12 encoders, then add.
// Footer
F7
Remember to remove the comments before converting.
(Hope I'm not over stepping my role here! Moderators)
Thanks again guys!
Jim McDougall
05-10-2011, 04:19 AM
Good job ! Everybody shares so there are no boundaries to overstep. We all learn from each other.
Glad you were successful !
Okay, so this is what I've pieced together from various other threads:
// MIDI CPU Control Terminal Configuration
// 12 x Rotary Encoder Input
// CC #s 0 thru 15
// Fixed Header Identifies the Control Terminal Configuration Message
F0 00 01 5D 04 01
// This byte identifies the configuration "layer".
// Layer 0 is the "primary" layer.
00
// Control Terminal Configuration Chunks
// Each chunk is 6 bytes: nn tt mm ch d0 d1
// nn = terminal number
// tt = transition
// mm = mode
// ch = channel
// d0 and d1 are mode-specific parameters
// Control Terminal #0
// nn = 00h
// tt = 00h (always use tt=0 for encoder modes)
// mm = 14h (rotary encoder, CC)
// ch = 00h (channel set by jumper)
// d0 = 00h (CC #0)
// d1 = 11h (CC value comes from this encoder, not somewhere else)
// CT #0-1 - CC #0
00 00 14 00 00 11
01 00 14 00 00 11
// CT #2-3 - CC #1
02 00 14 00 01 12
03 00 14 00 01 12
// CT #4-5 - CC #2
04 00 14 00 02 13
05 00 14 00 02 13
// CT #6-7 - CC #3
06 00 14 00 03 14
07 00 14 00 03 14
// CT #8-9 - CC #4
08 00 14 00 04 15
09 00 14 00 04 15
// CT #10-11 - CC #5
0A 00 14 00 05 16
0B 00 14 00 05 16
// CT #12-13 - CC #6
0C 00 14 00 06 17
0D 00 14 00 06 17
// CT #14-15 - CC #7
0E 00 14 00 07 18
0F 00 14 00 07 18
// CT #16-23 - Encoder buttons, CC #8-15
10 00 56 00 08 00
10 01 7F 00 00 00
11 00 56 00 09 00
11 01 7F 00 00 00
12 00 56 00 0A 00
12 01 7F 00 00 00
13 00 56 00 0B 00
13 01 7F 00 00 00
14 00 56 00 0C 00
14 01 7F 00 00 00
15 00 56 00 0D 00
15 01 7F 00 00 00
16 00 56 00 0E 00
16 01 7F 00 00 00
17 00 56 00 0F 00
17 01 7F 00 00 00
// Fixed Footer
F7
Trying to achieve 8 encoders with push buttons... first 16 control terminals are the encoder directions and control terminals 17 to 23 are for the encoder push buttons.
any obvious mistakes?
thanks in advance :)
hmm well I uploaded the script to my midi cpu successfully... first impressions are that it seems to work okay in midiox except that each encoder direction turn causes two midi messages to be sent? one clockwise and one counter-clockwise?
any ideas?
edit: actually, I don't think it's a problem with my sysex... I notice that if I remove one of the pins from the midi cpu it still behaves strangely. Basically, if I turn clockwise, it'll output midi... but if I turn counter-clockwise, it will still output midi, even though that terminal isn't connected to the midi cpu!! what's going on?!
edit2: ah right, so if you don't wire both terminals on an encoder, the encoder will output midi when turned in both directions! weird. Once I'd soldered all 3 terminals properly, the encoder behaves much better. Because I was using female breadboard patch cables, I'm guessing that the electrical connection wasn't very solid. At some points, whilst turning the encoder, there wasn't a proper stable circuit on all 3 terminals, causing erratic behaviour.
edit3: well, it's still outputting the same midi information, no matter which way I turn the encoder! Looking at the sysex, it seems like this is actually intended?:
// CT #0-1 - CC #0
00 00 14 00 00 11
01 00 14 00 00 11
surely it should be:
// CT #0-1 - CC #0
00 00 14 00 00 11
01 00 14 00 00 12
that way I get a different CC depending on the direction I turn the encoder?
This is what I get for the first 16 pins (8 encoders) in MidiOX:
http://gyazo.com/4400c9e8efd79ed8fea34d76e90077d1.png
which looks okay to me? the problem is when I use Traktor... this is what I get when I use midi learn:
http://gyazo.com/31b4469609ec0f93d220527dc67ab6ab.png
Both lines have the same midi cc# - even though I'm turning the encoder in different directions. Any ideas?
hrm, well judging by this post:
http://forum.highlyliquid.com/showthread.php?t=552
it seems I might have the wrong type of encoder... I've got the exact same problem mentioned in that thread.
can anyone link me to a recommended encoder that would work properly
edit: when I get home later tonight, I'll use SendSX to capture the output from my encoders and post it here.
Here's some potentially useful information from a thread on DJTT:
Hope this not too late
In Traktor You Have 2 option in Encoder Mode
1st. 7Fh/01h = 127/1 mean Value 127 to 65 is Decrement 1 to many step & Value 1 to 64 is Increment 1 to many step the 0 is Reset value (center) or we called "Relative (2’s Comp.)" that Novation RemoteSL Doesn't have this Mode and also Automap PRO too (In fact this mode is very Rarery use in my Experience)
2.nd Option is 3Fh/41h mean value 63 to 0 are decrement and value65 to 127 are increment value 64 is center or reset
Easy right
In Automap Pro You Can't Map Encoder mode (increment/decrement) to work with taktor
coz Automap pro have Only one Mode that Traktor Doesn't support Automap use "Relative (Signed Bit) Mode (Ableton live use this mode most)" mean 1 to 64 are Increment and 65 to 127 are Decrement then U need to use Normal Template in RemoteSL and Set Your Encode to REL1 (this mode is the 2nd option intraktor) in REL 1 it's Send Only 63,65 value then you no have Acceleration ,REL2 same mode but it's send 63-0 and 65-127 then when you turn knob fast it's move fast .....
By the way in mycase I don't like SL feeling of knob(especialy rubber buttons LoL) I use my Zero SL for Only one purpose...that Use it for Show FX Names (Automaitic Changing by Traktor) With out Automap Pro (I got 12 licenses and Automap Pro was useless for me)
Hi MiL0,
// CT #0-1 - CC #0
00 00 14 00 00 11
01 00 14 00 00 11
surely it should be:
// CT #0-1 - CC #0
00 00 14 00 00 11
01 00 14 00 00 12
that way I get a different CC depending on the direction I turn the encoder?
The first pair of configuration chunks are correct. The second one won't work correctly.
hrm, well judging by this post:
http://forum.highlyliquid.com/showthread.php?t=552
it seems I might have the wrong type of encoder... I've got the exact same problem mentioned in that thread.
can anyone link me to a recommended encoder that would work properly
edit: when I get home later tonight, I'll use SendSX to capture the output from my encoders and post it here.
Definitely--please turn just a single encoder clockwise for several turns, then counterclockwise, and post the stream of messages that is captured by SendSX. (It will be several lines of hex codes.) This will allow us to see whether the problem is in the messages sent by the MIDI CPU or in the Traktor setup.
Once we have that, we'll continue...
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.