Adafruit Trellis to Ableton using hairless Midi and loop midi

Hi guys,

I am wokring on using adafruit trellis to connect to ableton and map onto the desire function of ableton.
so far I am able to map potentiometer onto the ableton. The code works even without all those Midi library and midi begin stuff.

#include <MIDI.h>
#include <midi_Defs.h>
#include <midi_Message.h>
#include <midi_Namespace.h>
#include <midi_Settings.h>

MIDI_CREATE_DEFAULT_INSTANCE();
int push=13;
int led=12;
int analogValue[1]={0}; // potentiometer
int lastanalogValue[1]={0};
int midiCCS[1]={1};
int thresh[1]={1};
int input=1;
void setup() {
  // put your setup code here, to run once:
   MIDI.begin();
pinMode(push,INPUT);
pinMode(led,OUTPUT);
Serial.begin(14400);
}

void loop() {
  // put your main code here, to run repeatedly:
for (int p=0; p<input;p++)
{
  analogValue[p]=(analogRead(p))/8; //divide the potentiometer value by 8
  if(analogValue>thresh)
  {
    if(analogValue!=lastanalogValue)
    {
      midiCC(0xB0, midiCCS[p],analogValue[p]); //send potentiometer values
      lastanalogValue[p]=analogValue[p];
    }
  }
}
}
void midiCC(byte CC_data, byte c_num, byte c_val)
{
  Serial.write (CC_data);
  Serial.write (c_num);
  Serial.write( c_val);
}

But i am having trouble to send adafruit trellis PCB drivers over there.
The hairless midi says “FTDI drives dont seem to be installed. not attemting any FTDI latency tricks”
I was not able to map the adafruit trellis button onto ableton. the code i have so far for trellis (sort of modified from the potentiometer code) I even used the all those midi stuffs, but the serial monitor starts to print weird chinese or japenese letters. Trellis works fine and when i press the button, it lights up

#include <Wire.h>
#include "Adafruit_Trellis.h"


#define MOMENTARY 0
#define LATCHING 1
// set the mode here
#define MODE LATCHING 
Adafruit_Trellis matrix0 = Adafruit_Trellis();
Adafruit_TrellisSet trellis =  Adafruit_TrellisSet(&matrix0);
#define NUMTRELLIS 1

#define numKeys (NUMTRELLIS * 16)

void setup() {
    Serial.begin(9600);

  Serial.println("Trellis Demo");
    trellis.begin(0x71); 
  // put your setup code here, to run once:
  for (uint8_t i=0; i<numKeys; i++) {
    trellis.setLED(i);
    trellis.writeDisplay();    
    delay(50);
  }
  // then turn them off
  for (uint8_t i=0; i<numKeys; i++) {
    trellis.clrLED(i);
    trellis.writeDisplay();    
    delay(50);
  }
}


void loop() {
    delay(30); // 30ms delay is required, dont remove me!
      if (MODE == LATCHING) {
    // If a button was just pressed or released...
    if (trellis.readSwitches()) {
      // go through every button
      for (uint8_t i=0; i<numKeys; i++) {
        // if it was pressed...
  if (trellis.justPressed(i)) {
    Serial.print("v"); Serial.println(i);
    int  analogValue=(analogRead(i))/8;
    Serial.println(analogValue);
    midiCC(0xB0,i,analogValue);
    // Alternate the LED
    if (trellis.isLED(i))
      trellis.clrLED(i);
    else
      trellis.setLED(i);
        } 
      }
      // tell the trellis to set the LEDs we requested
      trellis.writeDisplay();
    }
  }
}
void midiCC(byte CC_data, byte c_num, byte c_val)
{
  Serial.write (CC_data);
  Serial.write (c_num);
  Serial.write( c_val);
}

Thanks in advance for help!

not sure about your driver issue but if your seeing weird symbols in serial monitor it may because you have your BAUD rate set differently in the monitor to how it is in your code. In the code you have posted it is set to 9600 so make sure when you open the serial monitor it is set to that too.

This isn't the Adafruit support forum, so I'm not exactly sure, but I think that the Trellis is just a button matrix and driver. I don't think Trellis has an FTDI on board. Are you hooking your trellis up to an Arduino board of some sort? An Uno, Leonardo or a Pro Micro? Maybe that is where the problem is? Tell us more about your setup.

Thanks,

Jimmy

Thank you for your reply, I have hooked up adafruit trellis to arduino mega and then from the usb to the computer. I was hoping to make it work with the potentiometer together. and yes, trellis is a PCB driver and they require a different library. When i use trellis library with midi, it starts to print weird letters and show that error message of FTDI driver. link to setup below.

http://postimg.org/image/s8bnwnn7v

Would installing the FTDI driver helps? Would there be anything to do with the trellis begin with midi begin? Like fighting over the same serial port?

Thanks again

It’s best to just post the image here. I can’t see what’s going on in your picture, or how it’s connected to Abelton right now. Can you draw a sketch of what your hookups are and post a picture of that sketch here? Maybe then someone will be able to help.

Jimmy

Edit: Obviously I don’t know how to get the photo attached inline either, but it is attached here.

I'm not too familiar with the Mega, but I looked at the schematics here at Arduino.cc and there is no FTDI chip on the Mega. I think Hairless wants an FTDI serial interface? If you want to make a midi button and knob controller with that trellis, you might use a leonardo or a Teensy. You could then have it act like a MIDI HID device. Then you wouldn't have to mess with a lot of translation via Hairless and all that.

For Teensy: https://www.pjrc.com/teensy/td_midi.html

For Leonardo: https://github.com/fricklr/TeeOnArdu

Adafruit has some info here: https://learn.adafruit.com/untztrument-trellis-midi-instrument/code

Mike Cook (Grumpy_Mike here) has loads of MIDI projects you could browse through and learn a lot from: http://www.thebox.myzen.co.uk/Hardware/Projects.html

mixographer: If you want to make a midi button and knob controller with that trellis, you might use a leonardo or a Teensy. You could then have it act like a MIDI HID device. Then you wouldn't have to mess with a lot of translation via Hairless and all that.

For Teensy: https://www.pjrc.com/teensy/td_midi.html

I should download teensy and install onto mega and use the Midi device and stop using hairless midi and loop midi? After I install it, i can send midi straight to ableton without Hairless Midi and loop MIDI??? Cuz I saw that post about UNTZtrument and bought a leonardo and follow the stpes and then leonardo's port is not found on the computer (all wasted!).

Thank you for your help!

No. Did you read any of the links? Teensy is a piece of hardware. You don’t install it on your Mega.

Your Leonardo is not ‘all wasted.’ If you ‘follow the stpes’ it will work. You have a better chance of making your midi controller by trying to stick to the Adafruit tutorial. Switching to a Mega is not going to get you anywhere.

Jimmy

yeah i did follow the guide, but the problem is that I cant find a port on my arduino leonardo. They use the older version of arduino IDE like 1.o.6, i downloaded that. I tried everything to get the port of leonardo, but it does not show, only grey color nothing to click. Like we cannot upload code. Isnt Teensynduino the software that is compatible to arduino?

Thank you for your constant help!

The Leonardo is a bit more tempermental than other Arduinii. You need to hold it in reset until just before the computer tries to upload the code. Use the search box to search Leonardo and read the threads.

http://forum.arduino.cc/index.php?topic=172525.0

There's one example.

it definetely works dude! i´ve done a 8x8 untrzument, but the instruction by adafruit isn´t actual enough for 1.6.8 and old school so far :D

with the new IDE you can include all the libraries you need from preferences ...

like using: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

yes you have to push the reset button after hitting upload because a teensy does it like this ...

check this for more: https://www.arduino.cc/en/Guide/Libraries

make sure your USB type is MIDI and you are using the "hello world" code, "trellis demo" won´t work!

have fun ;)

btw. who can help me including 8 simple CC pots through a 4051 multiplexer?

I have used 1.6.5 and downloaded everything and installed all over again even the TeeonArdu board. But when i uploaded the code, it does not work because there is no port shown under the TeeonArdu port?? have tried the reset button many times

If somehow works, can i just press button and will it play the notes on Ableton music program?
Any idea?
Thanks