Loading...
  Show Posts
Pages: [1]
1  Using Arduino / Audio / Re: Mix or merge MIDI IN signals with internal MIDI messages / midi library on: May 08, 2013, 03:45:21 am
Great! Can't wait to check this out  smiley-cool
2  Using Arduino / Audio / Mix or merge MIDI IN signals with internal MIDI messages / midi library on: May 07, 2013, 07:58:01 am
I'm using the midi library 3.2 for a midi controller and it is working very well. It is for changing CC values of a synth, but i want to play it on a keyboard, too. So I'm curious about mixing the Keyboard signals with the arduino MIDI messages somehow...
Well, I could go and buy an hardware merger, or maybe there is a way to listen to the incoming MIDI messages and send them inside my loop along with the internal MIDI messages?

This simplified part is working, I couldn't find any proper "AllTheIncomingMidiMessage" function in the library:

Code:
void loop() {
  // Work with the input
  sensorValue = analogRead(sensorPin) / 8;
 
  // Send MIDI cc74 example on channel 1
  if(sensorValue != sensorValue_old) {                   // only if value has changed
    MIDI.send(ControlChange,74,sensorValue,1);
    sensorValue_old = sensorValue;                        // compare and change if not the same
  }
 
  //Read and send all incoming MIDI messages
  //MIDI.send(AllTheIncomingMidiMessageSomehow,1);

It would be great to get a hint!
3  Using Arduino / LEDs and Multiplexing / Re: 40 channel 4051 multiplexer analog ins affect neighbours values – help... on: March 07, 2013, 05:52:19 pm
thank you guys! everything works like a charm! no errors, no bleedings. the values are accurate, even with 100k pots and 4051 multiplexers.

it took some time, i had to resolder the pot matrix, somewhere there was a tiny bugs messing up the whole thing... now i can go further to the next step: playing around with midi values by turning a knob in the matrix.
4  Using Arduino / LEDs and Multiplexing / Re: 40 channel 4051 multiplexer analog ins affect neighbours values – help... on: February 26, 2013, 03:45:03 am
thank you both guys. step by step i'm getting into it. i'll post the results later!
5  Using Arduino / LEDs and Multiplexing / Re: 40 channel 4051 multiplexer analog ins affect neighbours values – help... on: February 25, 2013, 06:40:12 pm
Checked it. It really doesn't matter if its an 100k or 10k pot, I've tested them both.
The solution was so simple: I tested the 40 analog ins each only with one pot. Connecting all pots to the 40 inputs has removed the affection on the other neighbour inputs by approx 99%... Oh my.
6  Using Arduino / LEDs and Multiplexing / Re: 40 channel 4051 multiplexer analog ins affect neighbours values – help... on: February 25, 2013, 09:15:16 am
Quote
What you can try is reading each channel twice and only using the second result. This allows extra sample acquisition time.
this i will check out back at home!

Quote
However why on earth you are using a library like <analogmuxdemux.h> I don't know, it is simple enough to write code for this, and it might stop this fix from working.
thought it would be faster then writing a own buggy one smiley so ok, i'm going to write it from scratch if this fix^^ isn't wiring.
7  Using Arduino / LEDs and Multiplexing / [SOLVED] 40 channel 4051 multiplexer analog ins affect neighbours values on: February 25, 2013, 06:40:48 am
hello,

i'm using 5 slave 4051 and 1 master 4051 to build a 40 channel multiplexer. 40 potentiometers (100k) are connected to the analog ins on each 4051.

the arduino is reading all the inputs, but is messing aroung with neighbour-inputs. e.g.: when i turn potentiometer #32 from 0 to 1023, then the value of potentiometer #31 is changing to (~)760... and the other way round. on different potentiometers the similar situation, sometimes more sometimes less affection...

each potentiometer is getting its ground and +5v from the arduino, the middle pins are connected to the slave 4051 analog inputs, each output of an slave 4051 is connected to the master 4051 analog input, just like in the basic description: http://playground.arduino.cc/learning/4051

Any idea how to clear the values?

I'm using this mux example to read out the values:

Code:
#include <analogmuxdemux.h>

#define READPIN 2 //analog in
#define NO_PINS 40 //40 inputs

// master selects
#define M_S0 10 //master digital pin
#define M_S1 11 //master digital pin
#define M_S2 12 //master digital pin

// slave selects
#define S_S0 2 //slave digital pin
#define S_S1 3 //slave digital pin
#define S_S2 4 //slave digital pin

AnalogMux amx(M_S0,M_S1,M_S2, S_S0,S_S1,S_S2, READPIN);

void setup() {
    // check in serial monitor what is happening
    Serial.begin(9600);
    Serial.println("Starting 4051 analog reader...");
    delay(1000);
}

void loop() {

  // go through each pin on the muxer in turn and just print out it's pin number
  // and it's reading then wait a bit and do it again
    
    for (int pinno=0; pinno< NO_PINS; pinno++) {
      amx.SelectPin(pinno);
        uint16_t reading = amx.AnalogRead();
        Serial.print("Pin: ");
        Serial.print(pinno);
        Serial.print(" Value: ");
        Serial.print(reading);
        Serial.println();            
    }
    Serial.println("---");
    delay(1000);

}
Pages: [1]