Show Posts
Pages: [1]
1  Development / Other Software Development / Re: USB MIDI driver working for UNO. Turn your UNO into a MIDI device. on: January 23, 2013, 11:23:42 pm
Well I know it look redic now,   I took it from this forum somewere and rewrote it some.
regarding all the unsigned ints and stuff i just tested out everything because i cant get it to work.
Im pretty new to coding so I really need help smiley 
can you help?
2  Development / Other Software Development / simple 6 pot arduino midi-over-USB-controller problem on: January 23, 2013, 02:38:05 pm
Hi, I really need som help figuring this one out. I feel stupid, It surley is something very simple that Ive missed.

1:
I got 6 pots connected to Arduino UNO, my program reads the pots, divide results with 8
and sends BYTES with "0xB0" + "potnumber" +"potvalue" (se posted code).
2:
I put the Arduino in DFU-mode and run the USBdevice dot BAT file "makeMidi.bat".
3:
Arduino shows up as an MIDI-device.
4:
I open Ableton to MAP a Pot to the volume-controller.
5:
Each time i do this It works and map the pot to the volume-slider, but instead of scrolling the volume slider up/down
It changes the pitchbend from 8/16 to 16/16  or CC notes from 1-127 depending on if im using arduino MIDI liberary or MIDI liberary that comes with USBdevicewin.
6:
Ive tried my own code plus 3 other codes that I found online only to get the same results.
7 :
Ive tried to re-write the midi-message in several ways, Ive tried both "serial.write" and "serial.print" and sending one "empty" byte between
And always get the same results.

What am I doing wrong????


With following code i get a fast respond in ableton and I can map my 6 pots to different channels,  but instead of change the volume that I mapped it to it change MIDI CC notes.

Code:
//#include <MIDI.h>
#include <usbDevices.h>

#define numPots 6  // numer of pots
#define b 1        // this is the delta needed in

unsigned int currentPot[6] = {0,0,0,0,0,0};   
unsigned int pot[6] = {0,0,0,0,0,0};
byte controlChange = 0xBC; //0xB0 or 176

void setup() {
 usb.init(midi);
 // MIDI.begin();
 //Serial.begin(31250);
}                         
void loop() {
  for(unsigned char i=0; i<numPots; i++) {
    currentPot[i] = analogRead(i) / 8;   
    if(abs(currentPot[i]-pot[i]) > b) {
      sendMidi(controlChange, i+1, currentPot[i]);
      pot[i] = currentPot[i];
    }
  }
}

void sendMidi(byte controlChange, unsigned int controlNum, int val) {
//MIDI.sendControlChange(controlNum, val);
 
Serial.write(controlChange);
Serial.write(controlNum);
Serial.write(val);
  // Serial.write(unsigned char(controlChange));
  //   Serial.write(unsigned char(controlNum));
  //     Serial.write(unsigned char(val));
  }
 
 
 
 



3  Development / Other Software Development / Re: USB MIDI driver working for UNO. Turn your UNO into a MIDI device. on: January 23, 2013, 02:32:49 pm


What Im doing wrong? 

Scenario 1: If I use arduinos MIDI lib , I get "pitchbend" 8/16 - 16/16 as a result in ableton
Scenario 2: if I dont use MIDI lib I get "CC notes" from 1-127 i ableton

(If I have any HEX outside "0xB0 - 0xBF" neither of scenerios works)





#include <usbDevices.h>

#define numPots 6  // numer of pots
#define b 1        // this is the delta needed in

unsigned int currentPot[6] = {0,0,0,0,0,0};   
unsigned int pot[6] = {0,0,0,0,0,0};
byte controlChange = 0xBC; //0xB0 or 176

void setup() {
 usb.init(midi);
 // MIDI.begin();
 //Serial.begin(31250);
}                         
void loop() {
  for(unsigned char i=0; i<numPots; i++) {
    currentPot = analogRead(i) / 8;   
    if(abs(currentPot-pot) > b) {
      sendMidi(controlChange, i+1, currentPot);
      pot = currentPot;
    }
  }
}

void sendMidi(byte controlChange, unsigned int controlNum, int val) {
//MIDI.sendControlChange(controlNum, val);
 
Serial.write(controlChange);
Serial.write(controlNum);
Serial.write(val);
  // Serial.write(unsigned char(controlChange));
  //   Serial.write(unsigned char(controlNum));
  //     Serial.write(unsigned char(val));
  }
 
 

 
 

4  Using Arduino / Project Guidance / Re: Arduino UNO based midicontroller via USB to Traktor on: March 19, 2012, 08:47:39 pm
5  Using Arduino / Project Guidance / Arduino UNO based midicontroller via USB to Traktor on: March 19, 2012, 08:45:48 pm
HI!

I just hooked up  16 pots via Sparkfuns multiplexer to Mr. UNO
Here's the code   (from a superb turorial by BILDR)

http://codepad.org/RtmmVUSh


I have it all workin and I get response in the serial monitor.  

Now I need help and guidance to understand
the midi protocol
http://hinton-instruments.co.uk/reference/midi/protocol/index.htm#pt1

which midi-code should i use if i want a pot to control an effect i traktor, is it Control Change, mode change, pitchbend or perhaps velocity?

An example would be superduper nice, and how do I implement this in my code?


please help me understand this or just point me in right direction..


thank you so mutch
Pages: [1]