Pages: [1]   Go Down
Author Topic: MIDI Control Change Messages not working  (Read 1193 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there, I've built a Arduino circuit, with a number of POTs which I am attempting to send MIDI ControlChange messages with.  When I connect it up to Logic Pro or other DAWs it behaves peculiarly, jumping from 0 to 127 rather than smoothly moving between them. 

The MIDI section of my code looks something like this:

  byte midiMap0 = (analogVal0,0,1023,0,127);//map to 7-bit midi value range
  MIDI.sendControlChange(16,midiMap0,1);//(control number, control value, channel)

Can anyone see where I am going wrong?

Thanks
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear Userman123,

Can you please put the rest of the code
and could you show a diagram connection of your Pot
it would be easier to help you

Best Regard,

Xarolium
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, dont mean to hijack this thread but i kind of have a similar problem.

Iv'e been lurking around this board for quite some time now and had alot of fun with the Arduino over the last couple of weeks (mainly controlling leds in different ways, automating them e.t.c)
until i came across an Instructable where someone built an Arduino based Midi Controller (http://www.instructables.com/id/Arcade-Button-MIDI-Controller/).

I thought i might give that a shot, downloaded the code and it worked right out of the box.
But downloading a code doesnt mean you learn anything about the stuff you are building so i wrote i simple sketch to read one pot wich then sends a serial message through usb to my serial - midi converter.

Code:
int potval = 0;

void setup() {
Serial.begin(31250);
}

void loop(){
potval = analogRead(0)/8;
midiCC(1,16, potval);
}


// This function sends a Midi CC.
void midiCC(char channel, char control, char value){
Serial.print(channel, BYTE);
Serial.print(control, BYTE);
Serial.print(value, BYTE);
}

Looks simple but it doesnt work.
When i fire up serial - midi and then use the learn function in traktor it sends alot of different notes on different channels and the RX on s2midi is blinking red (which should mean that the serial signal is faulty and can't be converted right)

I really want to understand the way the signal has to be put out to make it midi compatible, so there has to be something i completely missunderstood here.

Can anyone help me out here?

regards
Patrick

p.s: I'm using an DFRduino atmega1280

//eidt:
by the way, to the guys who already built stuff like this:
How is the input latency on something like this and how does it deal with rapid fader movements?
« Last Edit: November 22, 2011, 05:03:07 am by Kelevra83 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok i managed to fix the problem. The main thing was that the analogvalue wasnt devided right because of a typo.
Here is what i came up with:

Code:
int control = 0;
int controlstore = 0;

void setup() {
Serial.begin(31250);
}

void loop(){
control = analogRead(0) / 8;

if(control != controlstore){
 Serial.print(0xB0, BYTE);
 Serial.print(1, BYTE);
 Serial.print(control, BYTE);
  controlstore = control;
}}
 

Tried it out and it worked well, the next thing is that i have to figure out a way to send 14bit midi control change messages because pitchfaders need a really high resulution.
Has anybody done that before?

regards
Logged

Pages: [1]   Go Up
Jump to: