Arduino Forum

Forum 2005-2010 (read only) => Software => Development => Topic started by: djccfm on Aug 17, 2010, 07:27 pm

Title: Help- using an arduino to make a midi controller
Post by: djccfm on Aug 17, 2010, 07:27 pm
Hey everyone, I'm new to the forum

I'm Chris

I'm having trouble getting my head around many things, this is my first ever time using an Arduino, And i would greatly appreciate your help

So here goes:

The project is to replicate Mathew Bellamays (from the band Muse) signature guitars that have a built in touch pad. http://www.mansons.co.uk/shopping/images/items/2375/2375_1_medium.jpg<--Image here
The touch pad controls a piece of audio sampling hardware called a http://www.kaosspad.co.uk/images/KaossPad_kp2.jpg<--(KAOSS PAD KP2 in my case) and it does this via http://en.wikipedia.org/wiki/MIDI<--MIDI, the Kaoss pad already has a touch pad built in, along with all the other features I wish to place in my guitar. the point of this is to access all the pads features via midi commands from analogue inputs in my guitar(the touch pad, momentary switch, and a rotary encoder for the effect selection.) as the pad is fairly unusable to a guitarist in its regular state.

I am not the first to want to do this, in fact I know of 2 people who have already done this, here are their videos on youtube:
http://www.youtube.com/watch?v=1p2PwtdcCNg"
<--bassman76jazz
http://www.youtube.com/watch?v=1p2PwtdcCNg<--
gazlang81

Both examples are made in almost an identical way, although I prefer bassmans approach as although he hasn't revealed much, his came after gazlang and he told me some of the improvements he did on gaz's design.

The overview of the project is:
-To convert an analogue input of a resistive touch screen into midi output signals that the kaoss pad will read.
-To add a Hold Button on the guitar that does the same as the hold button on the pad
-To add a rotary encoder that will allow me to change the effects of the pad on the guitar.
-Have a LED backlight that has a color pattern when not used, but then is responsive to the input of the touch screen.

In the next few steps I'll explain how far I've gotten.

To convert the input signals and to regulate the LED effects I will do the same as the 2 guys I mentioned and I will use a Arduino, I have chosen the http://www.arduino.cc/en/Main/ArduinoBoardProMini <--Arduino mini pro as it was bassman's recomendation. It runs on C++ (a language I know very little about) bassman has given me some tips over email about how the circuit board should be wired etc... so here is an extract of his email to me, and the schematics I have sort of done so far.

Email:
there is not really anything to the circuit, its just the screens four wires into the analog inputs of the arduino, the switch goes from ground to a digital input and the encoder connects to pin 2 and 4 (the interrupt pins) on the arduino the midi jack uses the tx pin and a ground and +5v pins and the led is connected to +5v and three pwm output pins. the pin numbers are arbitrary since they are controlled via the firmware. there are no extra chips, its just the arduino to control everything, the kit that gazlang81 makes uses the arduino mini, mine is the mini pro. as for the c code for the arduino I'm not willing to give this up just yet.

Schematics: (bare in mind I doubt very much that these are right)
(http://www.freeimagehosting.net/uploads/8bb603f296.jpg)

If the wires are in the wrong place or not connected at all, Its because I literally don't know any better or where to put them.

here are the components I'd like to use:

for the LED I'd like to use a http://thingm.com/products/blinkm<--BlinkM smart LED

The http://www.arduino.cc/en/Main/ArduinoBoardProMini<--Arduino mini pro

http://www.amazon.co.uk/NINTENDO-REPLACEMENT-BOTTOM-SCREEN-TOUCH/dp/B001AHJD3M<--nintendo DS lite touch pad

For the other components I don't know any specific things to buy etc...

Thats all I know about the hardware I need and how to build it.

now for the software for the arduino, I am literally clueless, although I have had somewhat experience with computer languages, I know close to nothing about C++. But what I have is a list of codes that will prove helpful to anyone who does know about C++

here are the links:

http:// http://www.muselive.com/forums.php?m=posts&q=36686:<--Resistive strip midi input for the digitech whammy pedal

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1197235191<--programing a touch pad as a midi input:

here is the manual for the Kaoss pad, In page 12 it has the midi chart(that will tell you what command each midi value is associated with).

http://www.korg.com/uploads/Support/KP2_OM_E_633661788715550000.pdf<--Kaoss pad manual.pdf

This is as far as I've gotten and all I know.

Also im not sure on how to program the LED but i think that might be much simpler

What I would like to achieve is the same that those 2 guys achieved in their videos. Thankfully the rest I can do and I'm quite good at. I'd appreciate any help at all and thank you very much for your attention whilst reading this.

many thanks

Chris
Title: Re: Help- using an arduino to make a midi controller
Post by: mowcius on Aug 18, 2010, 09:31 pm
Well I'll help you out a bit here, the touch screen needs 6 connections  :)
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Aug 18, 2010, 09:37 pm
but it only has 4 cables coming out of it, Y+,Y-, X+ and X-
Title: Re: Help- using an arduino to make a midi controller
Post by: mowcius on Aug 18, 2010, 10:33 pm
http://mnicolato.altervista.org/arduino/ardtouch.htm
6 wires needed. I have used one a bit myself.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Aug 19, 2010, 06:16 am
so what you use the same wire twice?

cus there are literally only 4 wires coming out of the touch screens in the videos I posed. but thanks for the link, its very helpful.
Title: Re: Help- using an arduino to make a midi controller
Post by: mowcius on Aug 19, 2010, 11:56 am
Yes you use 2 wires twice. You need 6 pins so you can change the pins around to be able to read vertical and horizontal positioning.

Mowcius
Title: Re: Help- using an arduino to make a midi controller
Post by: saaaaam on Aug 22, 2010, 02:27 pm
you can use an analog pin as well as a digital pin..
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Aug 23, 2010, 09:40 pm
thanks for all the tips so far.

so this is the code I've written to date:

Code: [Select]
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Touch panel wiring
// Connect to Arduino these wires (used to drive power)
#define Lo 2 // LEFT to digital output 2
#define Bo 3 // BOTTOM to digital output 3
#define Ro 4 // RIGHT to digital output 4
#define To 5 // TOP to Digital output 5

// Connect to Arduino these wires (used to read the touch position)
#define Ti 3 // TOP also to analog input 3
#define Ri 4 // RIGHT also to analog input 4

#define LED 13 // LED event
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// current touched
int touchX = 0;
int touchY = 0;
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


void setup()
{
Serial.begin(31250);//midi=31250   testing=9600
pinMode(LED, OUTPUT);
}

void loop() {
      if (touched())
                  {
                                    /*Serial.print("X=");
                                    Serial.print(touchX);
                                    Serial.print(" Y=");
                                    Serial.println(touchY); <-old code*/
                 
                 midiX = map(touchX,0,1016,0,127);  // maps the value range of the axis to midi 0->127
               midiCC(0xB0, 12, midix);  // sends midi control change for touch pad X axis
                 
                 midiy = map(touchy,0,1016,0,127);  // maps the value range of the axis to midi 0->127
               midiCC(0xB0, 13, midiy);  // sends midi control change for touch pad y axis      
             }
      while analogRead(Ti) > 0 || analogRead(Ri) > 0; //this while loop keeps the LED on whilst the touch pad is being touched
       digitalWrite(LED, HIGH);
      else
       digitalWrite(LED, LOW);
      }

// return TRUE if touched, and coords in touchX and touchY
boolean touched()
      {
      boolean touch = false;

      // Horizontal routine - set L to gnd and R to Vcc
      // set L = ground
      pinMode(Lo, OUTPUT);
      digitalWrite(Lo, LOW);
      // set R = Vcc
      pinMode(Ro, OUTPUT);
      digitalWrite(Ro, HIGH);
      // T e B high impedance (input mode)
      pinMode(To, INPUT);
      pinMode(Bo, INPUT);
      // wait a bit, then read from Top
      delay(10);
      touchX = analogRead(Ti);

      // Vertical routine - set T to gnd and B to Vcc
      // Set B = Vcc
      pinMode(Bo, OUTPUT);
      digitalWrite(Bo, LOW);
      // set T = gnd
      pinMode(To, OUTPUT);
      digitalWrite(To, HIGH);
      // R e L high impedance (input mode)
      pinMode(Ro, INPUT);
      pinMode(Lo, INPUT);
      // wait a bit, then read from Right
      delay(10);
      touchY = analogRead(Ri);
     
     

      // Only if coords are below 1000 and above 0
      if(0 < touchX < 1000 and 0 < touchY < 1000)
      touch = true;

      return touch;
}


void midiCC(char command, char value1, char value2){
 Serial.print(command, BYTE);
 Serial.print(value1, BYTE);
 Serial.print(value2, BYTE);
}


I haven't tested this cus I dont yet have all the pieces.

but what It should do is:

-read the touch coordinates of the X and Y Axis
-convert them to midi signals
-transmit the midi signal
-Stop transmitting the midi signal when my finger is off the pad
-have the LED on ONLY when you are physically pressing the touch pad

I am unsure about the midi signal I am sending aswell... cus I just can't read this stupid midi table... the ones i have coded to send are a calculated guess from attempting to read the table. (here is the table by the way, it is on page 11 http://www.korg.com/uploads/Support/KP2_OM_E_633661788715550000.pdf

the last "void" command in the code is also something I am unsure about. I know its necessary...but I'm struggling to understand how it works.

thank you all so much for your help.
Title: Re: Help- using an arduino to make a midi controller
Post by: PaulS on Aug 24, 2010, 03:04 pm
Quote
I haven't tested this cus I dont yet have all the pieces.

Then you shouldn't be writing a ton of code. Write code only for the hardware you have, and test each piece of hardware separately. Only when a piece works correctly independently should you move on and try to combine it with other hardware.

Quote
the last "void" command in the code is also something I am unsure about.

Learning the correct terminology will be helpful. There are functions in the code you posted, not commands. When referring to functions, the return type (void) is completely unnecessary verbiage.

Quote
cus I just can't read this stupid midi table

Well, this implies that you are trying to merge hardware you no little about, software you know even less about, with technology you don't understand. Is this a school project, by any chance?

If you focus on one aspect at a time, instead of jumping in the deep end, the whole process will be more pleasant. Get some hardware. Write some code to drive it, or be driven by it. Integrate that hardware with other hardware. Join the code to drive the new hardware with the overall application sketch. Don't move forward until you understand how the hardware and software that you have installed/written play together.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Aug 24, 2010, 07:27 pm
Quote
Then you shouldn't be writing a ton of code. Write code only for the hardware you have, and test each piece of hardware separately. Only when a piece works correctly independently should you move on and try to combine it with other hardware.


I see your point, but this code is mainly extracted from several links, and I know that those pieces of code work. So whilst waiting for the hardware, instead of plugging in code that I know will work, I thought I would try and create code that does the basic principle I want my code to do, But I do agree with you that trial and error is most probably the single best way of learning to do this.

Quote
Learning the correct terminology will be helpful. There are functions in the code you posted, not commands. When referring to functions, the return type (void) is completely unnecessary verbiage.


After I posted my latest post, I went and extensively researched that void function. I even asked a friend who was a programmer.  the problem I have is I don't understand the purpose/format of this line : "void midiCC(char command, char value1, char value2){" as I havent assigned a "command", a "value1" or a "value2", I even used the annotation midiCC twice... problem is every single piece of functioning midi interface code I've seen has it, but no where can I find an explanation as to why.

Quote

Well, this implies that you are trying to merge hardware you no little about, software you know even less about, with technology you don't understand. Is this a school project, by any chance?

If you focus on one aspect at a time, instead of jumping in the deep end, the whole process will be more pleasant. Get some hardware. Write some code to drive it, or be driven by it. Integrate that hardware with other hardware. Join the code to drive the new hardware with the overall application sketch. Don't move forward until you understand how the hardware and software that you have installed/written play together.


Your pretty much spot on with my knowledge. But no I'm not at school, I'm actually at university and this is not a project for my degree, This is a personal challenge/hobby I've set myself, as I've wanted to do this since I was about 15, but I only recently found out the proper way to do it. I've just finished my first year of studying mechanical engineering, sadly the only thing that my degree has as a transferable skill is basic programming (I have had to write code in MATLAB). But I've always been fascinated by electronics and I recently found that an arduino bridges that gap between hardware and software. Essentially I'm just looking to broaden my knowledge with this and electronics as I find them very intriguing.

Now when it comes to midi... IT IS HORRIFIC TO FIND A GOOD SOURCE OF KNOWLEDGE FOR IT... I have read through countless hours of junk about midi, starting from the very basics and going to the very complex, on other pieces of guitar equipment I have, I have found exactly the midi information I need. but simply this kaoss pad I feel has a very badly explained table.

personally I think midi is a terrible technology and they shouldn't have done it so early. cus now were stuck with it.

But if someone could help me understand how that table works, or even how that void function works. I would greatly appreciate it.

thanks to all.
Title: Re: Help- using an arduino to make a midi controller
Post by: PaulS on Aug 24, 2010, 08:22 pm
Can't help you with the midi table, as you know more about midi than I (care to).

The midiCC function, though, takes 3 arguments. The first is reference, in the function, using the name command. The second is referenced using the name value1. The third is referenced using the name value2.

You call the function this way:
   midiCC(0xB0, 12, midix);  // sends midi control change for touch pad X axis
   midiCC(0xB0, 13, midiy);  // sends midi control change for touch pad y axis
So, the function will write the 3 values (0xB0, 12, and midix or 0xB0, 13, and midiy) to the serial port, where the midi-controller is presumably listening.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Aug 24, 2010, 08:37 pm
Well I think that makes sense, Yeah thanks for the help.  :)
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Aug 26, 2010, 02:59 am
Hey Chris,
I'm new the forum and arduino as well, but I've been trying to accomplish the same thing. What I do know is Gareth's Hold Switch bypasses the "pad off" command sent.

Hope this helps!

Phi
Title: Re: Help- using an arduino to make a midi controller
Post by: bassman76jazz on Sep 09, 2010, 08:18 pm
don't listen to mowcius its a resistive touch screen with 4 wires and it uses 4 analog inputs with resistors to ground
Title: Re: Help- using an arduino to make a midi controller
Post by: mowcius on Sep 09, 2010, 11:04 pm
Quote
don't listen to mowcius its a resistive touch screen with 4 wires and it uses 4 analog inputs with resistors to ground

Umm, you must be new here.

That's not how things work around this forum. If you can provide some tried and tested code to show some method with only 4 analog inputs (and some pull down resistors) working then I will happily accept your statement.

Please don't say things like 'don't listen to'. It's not really in the spirit of this forum. I might just go and say something like, "don't listen to bassman76jazz, he's a noob with 1 post and doesn't know anything about what he's talking about" but under normal circumstances I would not ever say something like that.

Basically, please provide some more details on this method and try to be a bit more constructive on the forum in future.

Mowcius
Title: Re: Help- using an arduino to make a midi controller
Post by: unerhij on Sep 10, 2010, 04:13 pm
Im new here but have come accross this site that details how to use a four wire resistive touchscreen with an arduino and 10k ohm resistors to earth. I have not tested the code yet however.

I cant post the site up though as its my first post..
Title: Re: Help- using an arduino to make a midi controller
Post by: unerhij on Sep 10, 2010, 04:13 pm
http://kalshagar.wikispaces.com/Arduino+and+a+Nintendo+DS+touch+screen
Title: Re: Help- using an arduino to make a midi controller
Post by: mowcius on Sep 10, 2010, 04:43 pm
I see what they did, seems like a nice way to do it. Well thank you for providing a link.

Mowcius
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 11, 2010, 05:30 pm
Which one would you recommend I use? I does one have a clear advantage to the other?
Title: Re: Help- using an arduino to make a midi controller
Post by: mowcius on Sep 11, 2010, 06:10 pm
Quote
Which one would you recommend I use? I does one have a clear advantage to the other?

Well one uses 4 pins and one 6. I would not have thought it mattered. As long as they tell you the position, they presumably do what you want them to do.

Mowcius
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 12:06 am
ahh this is killing me!

so I decide to do the 6 wire method as I was already half way through doing it anyway, the computer reads the touch pad no problem.

the Kaoss pad however -.-"


it just wont...

If I change the midi signal to

midiCC(0xC0,0,touchX);

I can control the setting the touch pad is on (the command Im hoping to use for the encoder.)

but when I put it back to midiCC(0xB0,12,touchX);

its just wont bloody work! i have literally tried everything...im just completely out of ideas as to why its not working... Every single midi site ive gone to has basically told me that the command is correct.


pheh....a little help anyone?

xD

Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 02:22 am
so I just wrote and used a program that went through every single midi signal in the CC list... none of them triggered the touch pad, im really confused now...

midiCC(0-255,0-16,fixed constant)

thats the combination i went through.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 02:32 am
I know you're probably super frustrated, but just some troubleshooting:

Did you put the KP2 into MIDI control mode?

Gareth said something about mapping out the midiCC to a certain coordinate on the X-Y touch screen, although it seems that the program you made showed that it isn't the pad's fault.

I'm out of ideas for the moment. I'm rooting for you! Because I'd like to make one myself :)

Maybe try it with a DigiTech Whammy as well?

How's the LED control and the Hold switch going?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 02:42 am
i havent tested it on the whammy, but im assuming it will work, i may do that now and post the results.

the back light LED is actually alright to work with, the hold button im not sure about either.

the only midi message the kaoss pad has received so far is the effects change...and thats the easiest one to send as its only like 1 value.

argh i wish i knew what i was doing wrong.

anyway im gonna go try the digitech whammy.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 02:48 am
Was the KP2 in MIDI receiving mode?

Also, I think the Whammy is mapped differently, which is why Gareth's kit involves pressing the encoder to switch control between a Kaoss and a Whammy. One channel won't control the device it's not intended to.

But getting it with the whammy will be progress!
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 02:55 am
yeah um...it works lol... its just the kaoss pad that is a maHUSIVE beatch
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 02:57 am
Whammy works? Nice!
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 02:57 am
and midi receiving mode? how is that achieved? i didnt even know that existed
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 02:58 am
All right one sec. Let me pull out the old Kaoss Pad manual
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 03:06 am
Ok there's a few things and I'm not sure which to note, so I'll just quote it directly.

MIDI Edit Mode

Hold down the Tap/BPM key and press the Rec/Stop key. After approximately one second, you will enter MIDI Edit mode, and the MIDI channel will be displayed blinking in the Program/BPM display.

Setting the MIDI Channel

In MIDI Edit mode, the Program/BPM display will show the MIDI channel. At this time you can use the Program/BPM knob to change the MIDI channel.

MIDI message transmission/reception settings

Transmission and reception of each type of MIDI message can be turned on/off by pressing one of the keys listed below. Transmission and reception are enabled when the corresponding LED is lit. Transmission and reception are disabled when the LED is dark.

Changing the control number
By holding down one of the Program Memory 3-8 keys and turning the Program/BPM knob, you can change the control number setting. Although it is possible to select a control number that is already in use, it is not possible to simultaneously turn on transmission and reception for MIDI messages of the same control number.

Press and hold the Rec/Stop key for one second or longer, and the MIDI settings you modified will be stored

It will leave MIDI Edit mode if the touch pad is touched or the KP2 is idle for 10 seconds (without any operation)

http://www.korg.com/uploads/Support/KP2_OM_E_633661788715550000.pdf

Here's the KP2 Manual. Pages 8 and 9
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 03:10 am
yep ive read this, sadly its useless. ive done all this, it made me become even more sure that im right about the midi signals im sending. there is no midi receiver mode that i can see, it just receives and sends all the time. man this sucks... i wonder if its my kaoss pad?

oh and btw what did gaz say about the mapping? tell me all you know.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 03:14 am
Sure it doesn't work? From what I gathered looks like Program Memory 4, 5, and 6 need to be lit so that the KP receives X, Y, and pad on/off commands, but I could be wrong.

All I know is Gaz has 2 kits, one for a small screen and one for a regular screen. Each had to be mapped differently to send out the same range of MIDI values.

Just to check, the whammy did work? To Program Changes and everything?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 03:18 am
i only tested the whammy pedal itself, as i dont have the encoder wired up at the mo

and yeah they do need to be lit up.

that mapping thing I think is just to get a nicer feel for the pad, it would still work, but just in case ill take out the kaoss pads touch screen and use that to see what it does.

Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 03:22 am
What I do know is that MIDI Edit Mode must be entered to make those be lit. What I'm not sure is if that is necessary for reception; I've never dabbled with the Kaoss's MIDI interaction.

My guess is that something most be done differently, because judging from Gaz's kit the Whammy control is different from the Kaoss control.

What exactly IS Midi CC anyways?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 03:27 am
same problem
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 03:34 am
I'm going off of limited information, but anyway:

What CC messages does your pad currently send? Obviously the Whammy responds to it which is good.

The Kaoss Pad responds to 1- 31, 64-95. That's from the MIDI Implementation chart

This is from "Messages that can be received"

X Axis - Effect control 1 (CC#12) *1, *2
Y Axis - Effect control 2 (CC#13) *1, *2
Touch Pad On/Off -Effect depth 2 (CC#92) *1, *2

*1: The MIDI messages transmitted and received can be changed in a range of CC#1-CC#31, CC#64-CC#95, and PITCH BEND. ( ) is the factory setting.
*2: Ena/Dis and CC# settings are the same for both transmission and reception.

Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 03:39 am
Some good links you may or may not have encountered

http://www.indiana.edu/%7Eemusic/etext/MIDI/chapter3_MIDI4.shtml

Bunch of stuff

http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html

To help convert the numbers in the write-up above
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 03:41 am
Oh here we go. Took this straight from Gaz's eBay sale info for the kit

Controller MIDI Output

MIDI Channels:

The MIDI data for the Kaoss pad is sent on channel 1; while the data for the Digitech whammy pedal is sent on channel 2. Note that a receiver set to pick up MIDI data on channel 1 will ignore data sent to it on channel 2 and vice versa. Therefore the Kaoss pad will not respond to MIDI messages intended for the Digitech whammy because it should only be set to listen on channel 1. This means that both devices can be connected to the controller at the same time using a MIDI thru device.
The MIDI channel is changed by pressing the program dial shaft down. On start-up the controller sends on channel 1 (Kaoss pad) and switches to channel 2 (whammy) when the encoder is pressed. A second press switches the channel back to 1.

MIDI Data:

The controller is set to send MIDI data for the Kaoss pad default control settings. The Digitech whammy pedal will have to be set to channel 2 (see manual), but all other control settings should also be set to default for this device. See below. You can control any MIDI device that is configured to respond to these messages.

The controller sends the following MIDI data:

Channel 1 (default for Kaoss pad)

Pad On/Off                 CC92               0 and 127
Pad X Axis                 CC12               0-127
Pad Y Axis                 CC13               0-127
Program                      Program C       0-127


Channel 2 (default for Digitech Whammy)

Pad On/Off                 CC0                 0 and 127
Pad X Axis                 CC11               0-127
Pad Y Axis                 CC10               0-127 (Not used by whammy pedal)
Program                      Program C       0-127



Control:

Kaoss Pad - Channel 1.
The touch screen read by the controller sends MIDI CC to control the Kaoss pad similar to the on board screen, allowing remote real time effect control.
The momentary push switch allows bypass of the "pad off" command, thus emulating the hold function
The program dial sends program change commands. On start-up the program is set to 1. Turning the encoder shaft clockwise will increment the program, and anticlockwise will decrement the program. The program change will not allow increment above 128 or decrement below 1 (The Kaoss pad 2 only responds to program change commands between 0 and 99, so it is possible to overshoot the program control. If the program dial is no longer effecting program change, the turn it anti-clockwise until the program decrements).
Pressing the shaft of the program dial down will change the MIDI output to channel 2 and the Kaoss pad will no longer respond to the inputs.

Digitech Whammy - Channel 2.
The X axis of the touch screen will control the treadle position. The left extreme of the X axis corresponds to a toe up position, and the right extreme to a toe down position. The whammy does not respond to Y axis data, but has been included for use with other devices.
The momentary push switch allows bypass of the "effect off" command, thus emulating a hold function
The program dial sends program change commands. On start-up the program is set to 1. Turning the encoder shaft clockwise will increment the program, and anticlockwise will decrement the program. The program change will not allow increment above 128 or decrement below 1. However, the whammy pedal only responds to program change commands between 1 and 33, so it is possible to overshoot the program control. If the program dial is no longer effecting program change, the turn it anti-clockwise until the program decrements
Pressing the shaft of the program dial down will change the MIDI output to channel 1 and the whammy pedal will no longer respond to the inputs.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 03:56 am
thanks for the link, so yeah I try and use my kaoss pad to controll my digitech whammy, and I cant. im really starting to think ive missed something blatantly obvious or summin but i just cant find it.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 04:14 am
Just to clarify, your KP2 can't control the whammy but your X-Y Pad can?

My two guesses are:

-again, the reception mode. I think that plays a huge role.
-your x-y is set to control a whammy, and a separate channel will need to be programmed so that the correct KP2 numbers can be sent from your X-Y
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 04:58 am
to control the whammy I just changed the code a bit, I knew exactly what code I needed, but what im curiuous about is that touch pad on off function, does that mean i need to have the touch pad on in order for it to receive signals? its worth a shot...but ill try it tomorrow as im getting tired.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 15, 2010, 05:02 am
The touch pad on/off means that when you release your finger it is designated as "off"

The Hold switch bypasses the "off" command so that it's as if your finger stays there.


With the Whammy, releasing your finger is like hitting the silver switch that turns the effect off. Hitting the Hold button makes that effect stay active no matter what.

Good Luck!
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 15, 2010, 04:26 pm
ya it didnt work, phill do you have a kaoss pad and a digitech whammy pedal? cus if you do i need you to try something.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 16, 2010, 12:39 am
It's phi, and yes I do have both
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 16, 2010, 12:49 am
sorry Phi  <--coll name btw, reminds me of unreal tournament for some reason

btw i've advanced quite a bit with the code today, Ive gotten the rotary encoder working fully and properly communicating with the kaoss pad, the touch screen ive mapped out alot better aswell, and the LEd on the arduino reacts to both alterations.

anyway

can you connect them via midi to test something? if you dont have a cable, just find some thick wire, or thick solder to make the connections.

now what I need from you is to plug the midi OUT of the kaoss pad into the midi IN of the whammy.

turn on both, run a song with your mp3 player or laptop through to the whammys input jack, make sure the output sound cable(the one you connect to the amp) is connected to the "wet added" hole, hold the "tap/BMP" and the "rec/stop" button for a few seconds, until you enter midi mode (all the program change buttons should light up),

hold down program change button number 4, and with the program knob, change the number on the display to 11. let go of the button and tap it so that its LED is on, now hold down the "rec/stop" button again to save your settings, and you should be able to control the digitech whammy pedals treatle possition. If you can. let me know cus it means my kaoss pad is f**cked

cheers for your help btw.




Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 16, 2010, 01:27 am
Hey Chris,

Yeah I'll have to fashion a makeshift MIDI cable for this. Are there any alternatives? Could I connect my Kaoss Pad to my computer and do it from there?

My Kaoss doesn't have a screen either, I ripped it out to put in my guitar and it worked for a bit and ended in disaster. But anyway this could take awhile to happen. Might want to ask around the Muse Messageboards and other forums.

By the way, does the LED program follow the same config as Gaz's? Or similar?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 16, 2010, 01:39 am
if im not wrong, you can still test it using button program 6 and spinning the effects knob, just change that number to 12 and try,

the LED I haven't programmed yet, but basically for the LED the sky is the limit and its not that hard to code because of the nice software that its website offers.

for standalone (not touching the pad) the LED can change between about 30 colours in the space of 10 to 90 seconds. when touched i havent investigated yet. but it doesnt look too hard... but as im using my mini pro for everything else its hard to make the necissary connections to program it at the mo,

as for your kaoss pad, let me know if this function works, and why dont you buy a nintendo DS touch screen off the net? one of the new big DS's dont know what they are called, but the DS touch screen would work on your kaoss pad if you hard wired it straight in. but be sure to get the connector the ribbon cable plugs into too

also do you have an arduino by any chance? that way I could ask you to run a really simple program that would controll the kaoss pad...at least I think it should...

as ive tampered my fair share with my kaoss pad, im scared the midi doesnt work because the pads midi IN is bust, and not because my code is wrong.

let me know, cheers

Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 16, 2010, 01:43 am
Yeah my ribbon connector is broken too, so that seems out of the question. I've tried to solder directly to it, didn't work either.

No arduino as well.

Again, Muse Messageboards would be a great place. The community response is quick and plentiful.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 16, 2010, 01:58 am
I know im a member.

thats the point, you can get a DS touch screen from the net its ribbon connector aswell, solder the ribbom connector to your Circuit board, as long as you havent destroyed your circuit board it shoudl be pretty easy to do. i highly doubt you ruined your kaoss pad beyond repair, they are very tough pieces of kit.

and people on the muse forum are sick of hearing about this... dammit if only i had another kaoss pad to test this on...



Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 16, 2010, 04:46 am
Ah yes the DS breakboard, is that right? I'm not sure that will work considering I tried every wiring combination for the original touch screen, but eventually I will need a screen for the MIDI controller.

Sorry man. If I figure out something I'll get back to you
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 16, 2010, 05:03 am
theres 16 combinations, , but i think you will find, that they follow the order of the ribbon cable (as in what appears in left to right on the circuit board will be left to right for the touch pad...or right to left...but those are the 2 likely combinations.)

So I just wrote a code that controlled the digitech whammy fully, with on/off functions...treatle and also effect selection on the knob... im pretty sure its my kaoss pad thats being a little crap now lol.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 16, 2010, 05:17 am
Awesome man! Got the Hold button working?

Maybe you could try it out with other devices just to make sure?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 16, 2010, 07:47 am
what do you mean? and no, hold function is another midi signal the kaoss pad wont pick up.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 16, 2010, 07:55 am
Maybe try the MIDI controller with other MIDI devices just to double check your Kaoss's state of being.

And does the hold switch work with your whammy? basically releasing the finger should turn the effet off, and having the hold switch should switch between leaving the effect on when the finger is released and the opposite.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 16, 2010, 08:12 am
not for the whammy, the Y axis replicated the treatle possition, I mean the pedal doesnt go back to off if you leave it half way, so the same thing happens with the touch pad.

I added some dead spots on the touch pad and made the X axis what turns the effect on or off, very usefull actually, i can go straight to the max setting without having to deal with the treatle, plus the encoder is just bliss. I just wish i could get this stupid kaoss pad going...if that worked I would be able to install it in the guitar right now.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 17, 2010, 04:35 am
Sounds awesome Chris!

So let me guess this straight, you move your finger lengthwise as the X axis right? Would you be able to code it so that the X axis is treadle position and the Y axis is inactive? Also, do you have the hold button working for the Whammy?
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 17, 2010, 04:42 am
Hey here's what you can do, you got a Guitar Center or any guitar shop nearby? Bring your controller and ask if you can go there and try their KP3, with your controller
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 20, 2010, 04:26 pm
Quote
So let me guess this straight, you move your finger lengthwise as the X axis right? Would you be able to code it so that the X axis is treadle position and the Y axis is inactive? Also, do you have the hold button working for the Whammy?


The hold button is what I controll with the X axis for the whammy. yes i could just turn the X axis off and controll the treatle purely with the Y axis, but basically the touch pad has so many possible "buttons" that I thought i could use the X axis for something, and it works.

The encoder does work...but its not very clean, every once in a while it skips one effect... but thats just cus I stole some code off this site and didnt really alter it for my encoder how i needed to.

besides all this isnt my priority.

Another person on this forum is emailing me to try and sort this, and he has the same problem... so i know its not the kaoss pad.

it will just take time. but i wont be able to work on it for the next week.. so meh. ill see what i can do after.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 21, 2010, 06:04 am
Sounds pretty sweet Chris

Sorry to hear about the Kaoss Pad roadblock. Hopefully you'll get that worked out. I'll keep my eye out for any clues that Gaz may have carelessly revealed :)

As for the separate coding, that would be great if you could do that. I really like the way Gaz has his Whammy control set up.

"Stole" the code huh? Lol that just sounded funny to me.

All right, cheers and good luck!
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 21, 2010, 04:30 pm
you would still need to map the code for every individual touch pad

as the size changes anyway.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Sep 28, 2010, 05:10 am
Ah, so if I used the exact same DS touch pad it would work?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Sep 29, 2010, 01:37 am
it would work as well as mine, yes.

BUT i still cant get the signals to be transmitted to my KP2... completely out of ideas now.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Oct 07, 2010, 03:05 am
This is really strange. And you tried it on another guy's KP2 as well, right? Perhaps bassman would send you the code if you begged? Lol.
Title: Re: Help- using an arduino to make a midi controller
Post by: bernardin0 on Oct 21, 2010, 12:29 am
Hello! I'm from Portugal, i'm working in the same. How are your projects?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 21, 2010, 03:48 pm
hey buddy.

well so far I've gotten the code for the digitech whammy to work 100% and the kaoss pad only needs the touch pad to work. once that is done...I'm finished. I also wrote a code that if i press a button. I alternate between the codes.

I am half portuguese and speak portuguese fluently, so if you wanna get in touch with me via PM, maybe we could help each other out?

thanks.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Oct 22, 2010, 04:06 am
Haha! Small world huh?

May I suggest having the codes being switched via a press of the rotary encoder?

This is so awesome, props to you man. Big step forward from the start.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Oct 24, 2010, 11:29 pm
Hey all,
I got one of Gareth's kits ordered. Hopefully this will allow some insight on the mystery of the KP2's unresponsiveness
Title: Re: Help- using an arduino to make a midi controller
Post by: bernardin0 on Oct 25, 2010, 07:33 pm
Well, now you can help me with something?
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Oct 26, 2010, 01:01 am
hey Phi, how'd you get one of Gareth's kits? i haven't been able to contact him in like a year, seems he vanished from earth  :-/
Title: Re: Help- using an arduino to make a midi controller
Post by: bernardin0 on Oct 26, 2010, 01:03 pm
http://shop.ebay.co.uk/lango_81/m.html?_nkw=&_armrs=1&_from=&_ipg=&_trksid=p4340
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Oct 27, 2010, 06:31 am
Hello all,
First, to Super Matt, that link should work. If you email Gaz at the email advertised on his YouTube he should notify you when he has kits for sale.

bernardin0, what do you need?

And back to Chris, I may be pointing out the obvious, but each coordinate should send out 2 MIDI values at the same time (X and Y). Also, I'll have to double check, but the CC it's sent on is specific
Title: Re: Help- using an arduino to make a midi controller
Post by: bernardin0 on Oct 27, 2010, 01:44 pm
Phi can put your code for all work it out, like chris did.
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Oct 28, 2010, 02:10 pm
Really!? Does he still make them? It was rumoured that he stopped making those kits
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Oct 28, 2010, 11:27 pm
I've been making the same controller and I have the same problem as Chris. Everything works fine, diodes, MIDI sending. I have no problem with changing program via MIDI. But when it comes to sending MIDI CC12 and CC13, it just doesn't work. I have no idea what to do, I've tried everything.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 29, 2010, 06:42 pm
so now I know 3 people with the same problem... which leads me to think we are missing something very basic...possibly to do with the kaoss pad itself. Phi, does the kit work on your kaoss pad? and if so can  you tell us exactly how it acts...etc

thanks.
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Oct 29, 2010, 08:53 pm
I suspect that there is some little MIDI message that allows us to take MIDI control of the XY pad. That's why I asked Phi (via PM) if he could send me the MIDI messages that Gareth's kit send to KP (there is a program called MIDI monitor, it monitors every received MIDI message).
The best way would be to have MB-1 at home for one day to check everything. We could also ask some people on youtube who own that guitar to tell us every single message sent by the XY pad. But unfortunately most of youtube users don't respond to the messages sent to them.
For now, I've run out of ideas.

Btw. Chris, can you tell me how do you read rotary encoder position? I've tried couple of codes which I found online but none of them is fully working. They skip one or two positions from time to time. So I would be grateful if you could help me with this.

Cheers.
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Oct 30, 2010, 12:48 am
Weird. I've just noticed that KP2 receives MIDI message only on program 77 and only if my finger is over the center of the Y axis. Very weird.

EDIT: programs 10, 14, 19 also seem to work. But my finger also has to be somwhere above the middle of the Y axis. But they don't work as they should I think.

Now I know absolutely nothing.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 30, 2010, 05:05 am
thats better then nothing, if you wouldn't mind, could you post me that section of your code? see if its any different.

thanks.
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Oct 30, 2010, 01:19 pm
It's nothing special really.

void midiCC(char command, char value1, char value2){    
 Serial.print(command, BYTE);
 Serial.print(value1, BYTE);
 Serial.print(value2, BYTE);

  midiCC(0xB1, 12, sendX);  
  midiCC(0xB1, 13, sendY);



SendX and SendY are between 1 and 127 (using map()).

Make sure that in the MIDI mode, when you hold memory 4 - the number is 12 and for memory 5 - 13. Memory buttons 4 and 5 specify the MIDI X- and Y-axis, and they need to be set to MIDI CC 12 and 13.

Can you help me with that rotary encoder, I mentioned above? None of the codes I found isn't working properly, they're inaccurate.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 30, 2010, 01:41 pm
mine is 0xB0, so ill give yours a go and yes i can help with the encoder, i am actually just using one of the example codes for the encoder, It does work but you need two pull down resistors (10k resistors connected to ground) to stop the voltage floating. ill elaborate when i get the chance, im a bit busy today.
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Oct 30, 2010, 01:47 pm
The difference between 0xB0 and 0xB1 is that 0 means channel 1 and 1 means channel 2 (goes up to 15 which means channel 16). So if you use 0xB0, make sure that you have MIDI channel of KP set to 1 (using program/bpm in MIDI Edit mode but you already know that).
And check these programs 10, 14, 19, 77 and tell me if they work.
And I would be grateful if you could tell me which example code you are using.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 30, 2010, 02:17 pm
i tried your code, I didnt even get a response on the channels you got.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 30, 2010, 02:22 pm
hang on, It did work, but with my original code which used , it is not behaving at all how we want it. BUT it does prove that it is possible and therefore it must be a mistake of ours.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 30, 2010, 02:41 pm
for the encoder, I have encoder pin A connected to 3 on the board, and i have encoder pin B connected to pin 4, then pin a and B are also connected to ground via a 10k resistor, the center pin on the encoder I have connected to +5V the code I used and modded was this one:

Code: [Select]
/* Read Quadrature Encoder
 * Connect Encoder to Pins encoder0PinA, encoder0PinB, and +5V.
 *
 * Sketch by max wolf / www.meso.net
 * v. 0.1 - very basic functions - mw 20061220
 *
 */  


int val;
int encoder0PinA = 3;
int encoder0PinB = 4;
int encoder0Pos = 0;
int encoder0PinALast = LOW;
int n = LOW;

void setup() {
  pinMode (encoder0PinA,INPUT);
  pinMode (encoder0PinB,INPUT);
  Serial.begin (9600);
}

void loop() {
  n = digitalRead(encoder0PinA);
  if ((encoder0PinALast == LOW) && (n == HIGH)) {
    if (digitalRead(encoder0PinB) == LOW) {
      encoder0Pos--;
    } else {
      encoder0Pos++;
    }
    Serial.print (encoder0Pos);
    Serial.print ("/");
  }
  encoder0PinALast = n;
}


hope this helps

Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Oct 30, 2010, 11:05 pm
Thanks. This code is pretty good, however the position still likes to jump a little bit. I added delay at the end and the result is pretty satisfying. Still not perfect though.
Have you programmed the LED already? What pattern is it using? I've decided to go with 2 LEDs, one changes the colour smoothly and the other one is blinking, depending on the finger speed. I haven't programmed the second one yet.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Oct 31, 2010, 06:50 am
I havent even touched the LED really, I just want the touch pad working before i start to focus on the rest.

any ideas as to what is going on with this pad?
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Oct 31, 2010, 08:56 am
Wouldn't it be good if there were clearly set instructions that worked for everyone?
P.S. anyone gotten in touch with Gareth? or Bassman? i've emailed both of them ages ago, but not a reply have i received from either :/
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Oct 31, 2010, 01:10 pm
None of them responds. I've tried to contact them too.
We just need to know the exact message that KP receives. So, as I said, we need to find someone with either MB-1 or Gareth's kit to record the data coming from the XY pad, for example using MIDI Monitor.
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Nov 01, 2010, 01:13 am
That's a good idea, just send a PM to all those folks on YouTube with KP Guitars, asking if they can do some work for us or if we can borrow their guitars to help us figure it all out.
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Nov 01, 2010, 09:41 am
GOOD NEWS EVERYBODY!! i got in touch with Bassman and he said he'll tell me when i can buy on of his kits off him. So when if i eventually get it i'll be glad to help you guys, but i'm a noob to all this i admit, so you'll have to talk me through everything.
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Nov 01, 2010, 12:00 pm
That would be great. Thank you very much Matt. You need to have MIDI input in your computer. If you don't, you can buy any MIDI > USB converter, they're like $4. That would give you limitless possibilities.
Or you can simply ask bassman what are the exact messages and what do we do wrong. You're his customer so he should tell you.

If you get the kit from bassman, don't limit yourself with only Kaoss Pad. Once you have a MIDI controller in your guitar, you can do everything. Play drums, modify the distortion level or even control lights on stage (using some MIDI > DMX converter). So you are only limited by your imagination. When I see people with XY Pad in their guitars who are only using couple of Kaoss Pad programs, it's just a waste of potential.
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Nov 01, 2010, 09:53 pm
Glad I can help, I'll tell you as soon as I get my hands on it :)
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Nov 04, 2010, 03:37 am
Hey all
Sorry for the late reply. I got no notification of the conversation continuing!

Here's my plan. I haven't received the controller yet, but I have a touch screen ready to go. I have a MIDI to USB cable, if someone can show me how to record MIDI that is outputted then when I get the kit I can find out what code is being sent.

Cheers,
Phi
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Nov 05, 2010, 03:40 pm
I found out what the problem was.

You have to send a "on" and "off" signal to the touch pad

so here is the "on" signal you send before you send the touch pad values:

midiCC( 0xB0,92,127)

and here is the off signal

midiCC( 0xB0,92,0)

hope this helps guys.
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Nov 06, 2010, 04:28 pm
Yes, that is something I mentioned early in the forum....... but good to hear that it's finally working!

The hold switch bypasses the off command, by the way.
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Nov 07, 2010, 07:24 am
It's a great feeling when things finally work right :)

P.s. What software do you guys use to programme the Arduinos and to read MIDI?
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Nov 07, 2010, 05:52 pm
I also found the sollution to this problem couple days ago but I forgot to post it here.
Matt: Arduino IDE. And there's no need to read MIDI, because that's what MIDI devices do (like KP or Whammy). But if I need to see what messages are being sent by my device, I use application called MIDI monitor.

EDIT: Btw. Chris, how are the works going?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Nov 07, 2010, 06:34 pm
touch pad is being read, now I just need to think about how im gonna write code that turns off the pad when im no longer touching it, but also doesnt just turn it off after every midi signal is sent, as that sounds crap.
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Nov 10, 2010, 07:57 pm
Send turn pad off if y == 0 and x == 0 (in the main loop).
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Nov 11, 2010, 09:50 am
Is it possible to control a Whammy Pedal using just the Kaoss Pad, not a X/Y controller?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Nov 11, 2010, 12:59 pm
with the KP3 it should be possible, but KP2 I don't know.
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Nov 13, 2010, 02:23 pm
HI guys! i'm new in this forum and extremely exciting to know is possible to make a copy of matt bellamy kaoss pad controller.
I'm completely off in programming and other else...but i read all posts in this forum, and it seems someone found the right way and the final solution.
So...is it possible to have a short how to, to build a kaoss pad midi controller??
i need electric schemas, kind of pieces, code to give to arduino mini, and the software to do this.
Can someone send me an operative guide for dummies???????
you are the best!!!!
Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Nov 14, 2010, 07:44 pm
Man, we've spent months working hard on this project and you want us to share everything we did? It doesn't work that way.
Buy arduino, buy everything that is needed to make it work, get familiar with arduino IDE and then, if you find some problem you can't solve, ask us and we'll tell you. But don't expect complete how-to or complete code.

EDIT: When I started this project I knew absolutely nothing about programming and absolutely nothing about electronics. So, I think this project has been the most educating thing that I've ever done. Keep this in mind and do it yourself.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Nov 14, 2010, 09:02 pm
when I started I also knew nothing, and expected a full how to...I am so glad i wasn't given one.
this post has literally EVERYTHING you need to make the touch pad with.
Title: Re: Help- using an arduino to make a midi controller
Post by: mowcius on Nov 14, 2010, 09:34 pm
Quote
EDIT: When I started this project I knew absolutely nothing about programming and absolutely nothing about electronics. So, I think this project has been the most educating thing that I've ever done. Keep this in mind and do it yourself.

Quote
when I started I also knew nothing, and expected a full how to...I am so glad i wasn't given one.
this post has literally EVERYTHING you need to make the touch pad with.

Well said guys!

It is definitely about the learning experience.
I have been quietly following this thread and I have to say it seems to be coming along quite nicely  :)

Mowcius
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Nov 14, 2010, 11:12 pm
I've already ordered Arduino One Starter kit, found a touch pad on ebay compatible and, downloaded arduino software. At this moment i have an old laptop touch pad that should be functional (4 wired). I also taken contact with who has kit ready to sell...but i would like to make it myself, like you. if is it possible...i would like to know:
- is the first image of electric contact correct? only to start in the right way...
- the code posted from chris, on first page, is it correct to start with this project?
I understand that you don't want to give a complete how to, and i don't pretended a dish undere my mouth. But i think you're the only one people who know steps.......

Title: Re: Help- using an arduino to make a midi controller
Post by: zygmoont on Nov 14, 2010, 11:19 pm
Start it with reading the touch pad position. Do just this, and send it using Serial.print and read using serial monitor in Arduino IDE. You can easilly find code for reading touch pad position. Then, if you get the position reading part right, you can start adding new elements, like hold button or LED. Don't even try to connect everything at once because you get lost. Do everything step by step, starting from the basics.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Nov 15, 2010, 07:05 am
it really doesn't matter where you connect the touch pad wires, as you define in the code the numbers you connected it to. I personally used the connecting the 4 wire touch pad to 6 pins, the link is somewhere along this topic, give it a go and let us know if your stuck.
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Nov 15, 2010, 10:23 am
Ok guys....i'm waiting for delivery of my orders:
- Arduino starter kit with arduino UNO
- blinkm led
After that i'll try to follow your instruction. Please be patient with me, because i am very very new and a little bit scared of a fail!!!! :(

what do you think about this code??

http://mnicolato.altervista.org/arduino/ardtouch.htm

it seems similar to gareth's code
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Nov 15, 2010, 12:05 pm
its the code I used ;)
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Nov 15, 2010, 12:34 pm
Thanks Chris and Thanks God...a good start point is half correct way! :D
now i'll just wait for kit delivery to start testing!
Be sure....i'll fight and ask in this topic more and more  ;D
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Nov 18, 2010, 04:22 pm
ok guys....i've almost all parts....only a question before start because i haven't found any good help: which is the material behind touchscreen? the kind of "paper" who diffuse the light?
do you know?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Nov 18, 2010, 05:36 pm
just buy some cloudy acrylic.
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Nov 24, 2010, 10:45 pm
touchscreen seems working...there's an interesting post of a japanese guy using a ds controller with a resistence connected to ground for each direction....how make it responsive with led? mystery...  :)
sure i am best singing and playing guitar...and not programming :D
Title: Re: Help- using an arduino to make a midi controller
Post by: philam64 on Nov 30, 2010, 06:38 am
"ok guys....i've almost all parts....only a question before start because i haven't found any good help: which is the material behind touchscreen? the kind of "paper" who diffuse the light?
do you know?"

The plate can be found on eBay. Search for 3mm Opal Acrylic. Do some measurements and you can have them cut it down to the size you need (the size of the touch pad).

I'm rooting for you, and I'd assume that we all are. Lol.

Chris and crew, congrats on the success. I still remember the night where I found this forum. Much different community mentality since then. It's pretty amazing.
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Nov 30, 2010, 09:26 am
Great...thank you phil...i found another website here in italy, which sells parts of 3 mm plexiglas, so i could buy, black, opal, mirror, and red for a few money!! i'll choose my preferred colour on my total black guitar....
i'm waiting a stupid touchscreen connector now...so i'm stopped. I hope to have my touch working for christmas, my best present!

i read and seen your forum on "unmanteined": Great job! but i think that was the first version or i'm wrong???
Regards from the rain of rome!!! Good week!
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Dec 04, 2010, 02:34 pm
Hi guys....i've started...i can read coords, and the compiling with midi doesn't give errors on arduino IDE, but nothing happens on my KP3. Can i PM someone my code to examinate please?
:'(
Title: Re: Help- using an arduino to make a midi controller
Post by: EpiLesPaul on Dec 05, 2010, 05:34 pm
hey

i want to build a midi controller for my guitar too.

now i'm looking for the right parts.
for the touchscreen: i didnt found a bigger touchscreen than the screen from the nds. can anyone post a link with a bigger screen?

where can i buy a rotary encoder?

the hold button is a normal pushbutton, right?

and the last thing i want to know: is the code from the beginning right and i can use it?


thanks
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Dec 06, 2010, 09:59 am
ohhhh yeah!! it's so glad to answer like an expert right now :D
for the touchscreen the simpliest way is to buy a nintendo DS XL touchscreen...is quite larger than standard one, and you can easily buy the connector on sparkfun.com
the hold button is a momentary switch, you can choose the form and colour you like much.
for the rotary encoder, i've buyed on ebay...but i'm waiting for 2 weeks and nothing has arrived yet.....
Good luck!!!!
Title: Re: Help- using an arduino to make a midi controller
Post by: EpiLesPaul on Dec 06, 2010, 10:15 am
ok, thanks for the help. i look now at ebay.

ds xl screen, is it from nintendo dsI?



can't find a bigger screen -.-
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Dec 06, 2010, 11:33 am
http://cgi.ebay.it/ws/eBayISAPI.dll?ViewItem&item=270664541307&ssPageName=STRK:MEWNX:IT#ht_2096wt_1002

4,2" .... really good to fit in every guitar, but first of all really simple to have a flat connector!
Title: Re: Help- using an arduino to make a midi controller
Post by: EpiLesPaul on Dec 06, 2010, 12:18 pm
thanks.

i couldnt find a rotary encoder   :(


but i found a hold button :)


i cant read/speak italian. can you say if they shipp the screen to germany?
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Dec 08, 2010, 08:58 pm
hi EpiLesPaul (i have the same guitar :))
unfortunately i don't think the vendor ships the object in germany, because i buyed the same screen from him, and it was shipped by national mail...
you have to search the web for another seller...another ds XL replacement part, or try to write to "densitron" that is a manufacturer of 4wire resistive display.....
for the encoder....just search in ebay!!!!! chinese have everything!
Title: Re: Help- using an arduino to make a midi controller
Post by: EpiLesPaul on Dec 09, 2010, 03:26 pm
ok^^ thanks.
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Dec 09, 2010, 11:51 pm
This code doesn't want to work......any suggestions????

void loop() {

    while (touched()) {  
    switchValue = digitalRead(digitalPin9);
   {
   if(switchValue == LOW && switchState == 0){  // first press
   switchState = 1;
     midiCC(0xB0, 92, 127);
       }    
   if(switchValue == HIGH && switchState == 1){  // first press
   switchState = 0;
     midiCC(0xB0, 92, 0);  whammy
   }  
      midiCC(0xB0, 92, 127);
        midiX = map(touchX,118,940,0,127);
      midiCC(0xB0,12,midiX);
      midiY = map(touchY,146,900,0,127);
        midiCC(0xB0,13,midiY);
        midiCC(0xB0,92,0);  

 }      
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Dec 12, 2010, 08:01 pm
ok....thanks for your GREAT consideration....i've found a solution.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Dec 14, 2010, 05:17 am
well I did not expect this thread to attract so much attention.

I'm pretty much done now. I've done all the programming, I just have to wedge it all in my guitar.

The touch pad works both on the kaoss pad and the whammy pedal.

encoder works and so does the hold button.

I've made the touch pads light responsive to movement. but along with that, Ive added an extra button which means I can switch the standby light effect. there are about 18 pre-sets in the BlinkM already and I was more then happy to use them.

I am really tempted to put a kit together and put it on sale on ebay. but as I was doing this as something just for me, I wasn't really looking on making a profit. depends how interested people are on this idea.

one of the dudes above was asking about encoders and hold buttons.

Well I got almost all my stuff off ebay, and you can get an encoder that also has a switch on it. thats the one I opted for. as for the buttons to change the lighting effect or the mode of the touch pad(whammy or kaoss pad) I haven't decided yet.

So I shall see.

Guys I'm more then willing to help others with this project, as long as you don't expect me to do it for you.

thankfully no one has expected that so far.

Title: Re: Help- using an arduino to make a midi controller
Post by: EpiLesPaul on Dec 15, 2010, 08:53 pm
can you upload a video of your controller on youtube?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Dec 15, 2010, 09:01 pm
I wish I could... but I don't have a camera. sorry dude.
Title: Re: Help- using an arduino to make a midi controller
Post by: EpiLesPaul on Dec 15, 2010, 10:11 pm
ok
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Dec 18, 2010, 06:42 pm
i've done my personal kit...
thank you to ones helped me.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Dec 20, 2010, 08:06 am
just curious, how have you guys attached the touch pad to the guitar? I.E, have you put a frame around the touch pad? and if so, how did you make it?

I'm not too happy with my frame, so I want to remake it, im just curious for ideas. cheers.
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Dec 20, 2010, 11:20 am
also, the hold function. I was just reading the owners manual for the KP3, and that has an actual hold command...which is midiCC(0xB0, 95, 127).

but on the KP2 that is MUTE, so im wondering what command you guys used for the hold function. did you use the 92 on/off command?

also my code isnt running as smoothly on the drum machine as I want it to. I have a feeling its because of the constant sending of coordinates, as when I move my finger on the kaoss pad itself, the drum effect changes but remains in rhythm. if i do it on my pad, it doesnt. i think it might just be with sending the touch ON code too many times. but im not sure.

let me know guys.

cheers.
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Dec 24, 2010, 09:53 pm
this might be a bit off topic but.. MERRY CHRISTMAS EVERYONE!  :D
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Dec 30, 2010, 01:37 am
well how was everyones Christmas?? ::)
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Jan 04, 2011, 11:06 pm
it was fun, I upgraded the code so that it should work on KP3...sadly i dont have a KP3 to test it with.

I also made it so the LED blinks when settings are being changed, for example when the HUE cycle is being changed or when you choose between the whammy and the KP2.
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Jan 05, 2011, 11:51 am
How is the midi signal for rotary encoder?  :-?
Title: Re: Help- using an arduino to make a midi controller
Post by: djccfm on Jan 06, 2011, 04:37 am
suryavoice, dude ill give you a hand with your encoder, and in exchange could i ask for a favor? you see i dont have a KP3 so I can't test the code i wrote for it. but in theory it should work. if you could PM me your encoder code, ill see what I can do, and if its ok ill PM you a message asking you to test a bit of code, (its just the hold function i need testing).

anyway buddy, hope you had a good holiday!

let me know

;D ;D ;D ;D ;D
Title: Re: Help- using an arduino to make a midi controller
Post by: SuryaVoice on Jan 06, 2011, 12:05 pm
you helped me so much chris...so i can test for you everything you want. Post me your code, and today i'll do it for you!

I'm using the rotary encoder code (the same you posted here)
I have rotary connected to pins digital 10 and 11, with ground that make a bridge. I'm not using a resistor yeyt, and i hope to don't need one. I have opened a gareth's kit, and there was only midi resistor.

Bye my friend
Title: Re: Help- using an arduino to make a midi controller
Post by: Matthew_Dollin on Jan 12, 2011, 05:21 am
have you guys checked this out?? http://twocherriesinstruments.ecrater.com/p/10007783/kaoss-pad-midi-controler-kit-with-75-in#
Title: Re: Help- using an arduino to make a midi controller
Post by: buttercanes on Jan 14, 2011, 10:33 pm
hy guys
please give me help for my code my touch pad works but i don't know to send midi data i'm in trouble i don't understand for insert correctly the midi commands lines into my code!!!
(sorry for my bad english)
Title: Re: Help- using an arduino to make a midi controller
Post by: bassman76jazz on Jan 19, 2011, 08:51 am
thanks for the plug Supper Matt! if your not up to the challenge of building a FSM then get my kit ;) I have new Videos up on my new channel at youtube just look for TwoCherriesIns... on the encoder I use the interrupts so check them out in the learning section.
  http://twocherriesinstruments.ecrater.com/
  http://www.youtube.com/watch?v=9RF6efVJb6w
Title: Re: Help- using an arduino to make a midi controller
Post by: fliggygeek on Jan 23, 2011, 03:24 pm
OK, I am building one of these devices, I designed and coded 90% of it before looking at this thread.  ill share my code here and see what you think so far.  I am having trouble with the code for the BlinkM, but thats in another thread so ill skip it.

Code: [Select]

//Touchpad
#define TouchX 0 // X axis
#define TouchY 1 // Y Axis
//Rotary Encoder
#define RotorA 3 //Interrupt pin 1
#define RotorB 6 //Digital IO 6
//Hold button
#define HoldButton 2 //Interrupt 0
//Switches
#define S1 4 //GP button 1
#define S2 5 //GP Button 2
#define debounce 10 //Debounce value
//Led
#define LED 13 // LED Pin

//Touchpad Variables
int touchX = 0;
int touchY = 0;

//Hold Flag
volatile int holdflag = LOW; //Hold Flag

//Rotary encoder
int currVal = 1; //Value of rotation

void setup()
{
     //Serial Setup for output of MIDI
     Serial.begin(31250);//midi=31250 baud
     
     pinMode(LED, OUTPUT);
     
     attachInterrupt(0, hold, HIGH);//Hold Button interrupt pin
     attachInterrupt(1, rotate, HIGH);//Rotary Encoder interrupt pin
     //Blinkm I2C setup
     Wire.begin();                // set up I2C on 4 and 5 analog
     Wire.beginTransmission(0x09);// join I2C, talk to BlinkM 0x09
     Wire.send('c');              // 'c' == fade to color
     Wire.send(0xff);             // value for red channel
     Wire.send(0xff);             // value for blue channel
     Wire.send(0xff);             // value for green channel
     Wire.endTransmission();      // leave I2C bus
}

void loop() {
     if (touched())
     {
           midiCC(0xB0,92,127); //Touchpad down command
           midiX = map(touchX,0,1016,0,127);  // maps the value range of the axis to midi 0->127
           midiCC(0xB0, 12, midix);  // sends midi control change for touch pad X axis

           midiy = map(touchy,0,1016,0,127);  // maps the value range of the axis to midi 0->127
           midiCC(0xB0, 13, midiy);  // sends midi control change for touch pad y axis
           
     }
     else
     {
           if(holdflag)
           {
                 digitalWrite(LED, HIGH);
           }
           else
           {
                 midiCC(0xB0,92,0) //Touchpad off
                 digitalWrite(LED, LOW);
           }
     }

     // return TRUE if touched, and coords in touchX and touchY
     boolean touched()
     {
           boolean touch = false;

           // wait a bit, then read from Top
           delay(10);
           touchX = analogRead(TouchchX);

           // wait a bit, then read from Right
           delay(10);
           touchY = analogRead(TouchchY);

           // Only if coords are below 1000 and above 0
           //TODO set up calibration for not touching.
           if(0 < touchX < 1000 and 0 < touchY < 1000)
           touch = true;

           return touch;
     }

     //Toggles hold on interrupt 0 goes high
     void hold()
     {
           delay(debounce) //Wait a bit
           if(digitalRead(HoldButton) == HIGH) //Check if its still toggled.
           {
                 holdflag = !holdflag; //Set flag
           }
     }
     
     //Interrupt called by rotary encoder interrupt
     void rotate()
     {      

           if(digitalRead(RotorB) == HIGH) //Interrupt is called, means RotorA has changed, direction can be found by lookign at RotorB
           currVal++; //If High, ++
           if(digitalRead(RotorB) == LOW)
           currVal--; //If low, --
           
           //sanitise output and wrap to 127 programs.
           if(currVal > 127)
           currVal = currVal - 127;
           if(currVal < 0)
           currVal = currVal + 127;
           
           midiCC(0xB0,0xC0,currVal); //0xC0 is the Program change cc so send midi command.

           //Send MIDI command
           void midiCC(char command, char value1, char value2){
                 Serial.print(command, BYTE);
                 Serial.print(value1, BYTE);
                 Serial.print(value2, BYTE);
           }



Ideas and comments please.
Title: Re: Help- using an arduino to make a midi controller
Post by: fliggygeek on Jan 23, 2011, 03:29 pm
Oh, and if you guys use Fritzing, heres my pics. Based on a Arduino Pro Mini, with hold button (on interrupt pin) rotary encoder(on interrupt) and two other non interrupt based buttons for no defined use yet.

(http://i.imgur.com/g8hIW.png)

(http://i.imgur.com/DO8N0.png)
Title: Re: Help- using an arduino to make a midi controller
Post by: bassman76jazz on Jan 23, 2011, 07:45 pm
your midi out for the rotary encoder won't work. it should be
  midi(0XC0, 0, value);

you also might need +5v on the center pin of the rotary encoder.
other than that it looks ok...

http://twocherriesinstruments.ecrater.com/
Title: Re: Help- using an arduino to make a midi controller
Post by: bassman76jazz on Jan 23, 2011, 07:48 pm
your delays are short but you might want to try a FSM...


a friend of mine is selling a complete kaoss pad guitar check it out at my website
http://www.wix.com/twocherriesins/home
Title: Re: Help- using an arduino to make a midi controller
Post by: fliggygeek on Jan 23, 2011, 11:41 pm
When you say fsm are you referring to a Finite State Machine? Also, I thought the program change command needed a controller number as well as a command number?
Title: Re: Help- using an arduino to make a midi controller
Post by: bassman76jazz on Jan 24, 2011, 12:18 am
Yes, finite state machine. And no if you look at the midi specification program change only takes one value, I do not know why it needs to be in the second spot...