I forward this message, so that everybody knows:
Re: Teensy Code…
Quote:
Originally Posted by steveo1313
__
Did you ever get your DIY midi controller working with Teensy??
Hi!
__
I gave up developing it months ago, but it worked with a trick:
I used serial communication between Teensy and my Mac, and i translated it into MIDI wth Serial to Midi Converter v.2.
So it was fine, but i didn’t continue studying it in order to add OUTPUT feature, but it’s possible using multiplexers, that i already have bought.. now i’ve got a little of time, i think i’ll develop it a little.
Stay tuned!
This the code i used:
/*
- MIDI controller project - using with Serial2MIDI converter
- Arduino sends data over USB
- Bologna
- July, 2010
- M. Gavelli
- Potentiometer linked at analog0 pin
- Serial2MIDI converter running correctly
- Traktor Pro with mapped control (using “learn” function)
- It rocks!!
*/
#include <Midi.h>
int pot0 = 0;
int analog0 = 0;
int analog0old = 0;
int pot1 = 1;
int analog1 = 0;
int analog1old = 0;
void setup(){
Serial.begin(31250);
}
void loop(){
analog0 = analogRead(pot0)/8;
analog1 = analogRead(pot1)/8;// reads analog input
// sends data only when a potentiometer changes its value
if ((analog0 < analog0old -1)||(analog0 > analog0old + 1)){
MIDI_TX(0xB1,13,analog0);
analog0old = analog0;
}
if ((analog1 < analog1old -1)||(analog1 > analog1old + 1)){
MIDI_TX(0xB1,14,analog1);
analog1old = analog1;
}
}
/* void MIDI_TX(unsigned char MESSAGE, unsigned char CONTROL, unsigned char VALUE) */
void MIDI_TX(byte MESSAGE, byte CONTROL, byte VALUE)
{
//pass values out through standard Midi Command
Serial.print(MESSAGE);
Serial.print(CONTROL);
Serial.print(VALUE);
//Serial.print(MESSAGE, BYTE);
//Serial.print(CONTROL, BYTE);
//Serial.print(VALUE, BYTE);
}
This the link to Serial2Midi Converter