Go Down

Topic: multiplexing and max/msp ? a survey (Read 16943 times) previous topic - next topic


just wanted to say i got this up and running in about 20 minutes. thanks so much! any improvements to the code would be super appreciated as well. for now i dont particularly understand how its working haha!

Unfortunately i get the usual flutter from the pots i may put something in the software to smooth that out not sure just yet? i'm already rolling with a 10K resistor on my pot. maybe each port needs a resistor regardless of whether its in use or not.


Sep 27, 2007, 02:33 am Last Edit: Sep 27, 2007, 02:34 am by boligrafoe Reason: 1
maybe i got a bit over zealous but i went ahead and built this up on perf board since the bread board version was working so well. i finally understand what you mean by:

[glow]a good idea might be to at least incorporate some sort of request byte from the host computer for each packet of 16 bytes received from the Arduino.[/glow]

this threw me for a loop for a while, i'm looking at the arduini2max patch now to see how it sends those requests and if any of it is relevant.

here is a pic of my board setup:

and one of it working in MAX


hey little-scale i tried setting up the midi example you have here on your site:
the autonomous midi one? but i had no luck i'm just curious but is there a difference between the 4051N and the 4051BP? It doesn't really matter I was just exploring the possibility of doing an autonomous midi version.


ok this is just a comment before i consider this thread dead. i gues everyone lost interest and i dont blame em' but by colluding together several examples on little-scale.com i came up with the following code:

Code: [Select]
8 to 1 mux
by Sebastian Tomczak
8 June 2007
Adelaide, Australia
Modified by Seth Ferris
29 Sept 2007

// init serial values
byte data_in = 0; // stores incoming byte
byte data_send = 0; // stores outgoing byte
int anPin = 0; // set analog pin

// setup begins here
void setup() {
Serial.begin(57600); // open serial port
DDRD = B00011110;

// main program begins here
void loop() {
if(Serial.available() > 0) { // if there is a byte received on RX...
data_in = Serial.read(); // read into variable
if(data_in == 76) { // if the received byte is 76 ("L" is for Listen to Arduino)...

     for(int anPin = 0; anPin < 16; anPin++) {

     PORTD = (anPin % 8) << 2;

     data_send = (analogRead(anPin / 8)) / 4;


and it works great with this patch i whipped up again based on little scale and arduino2max:

the only issue is that for whatever reason my pot is still being read on port 3 when it should be read on port 2? its is consistently wrong as opposed before when it would change ports based on where in the loop it started reading the data.

if anyone sees the flaw in my code i would greatly appreciate the input otherwise i only get 15 pots instead of 16! thanks again for everyone's help up to now.


im and idiot i fullt misunderstood the wiring diagram? LAME.

analog sensors 1- 8 (eg. pots, LDRs, etc etc) to pins 13, 14, 15, 12, 1, 5, 2, 4

hence why the "second slot" is reading in the third space the second slot is actually port 15 DUH. thanks again folks.


That's a nice example!

however, it seems that it is possible to send an 8 bit value. Thus, you can have a range from 0 - 255.
I's wondering if anyone knows how you can get a full 10 bit resolution (0-1023)..



Hey, i was just wondering if there has been any success in 2 years haha.

Im attempting pretty much the same, but the issue i have atm (i can read all my Mux data into max) is reading the pins in order.
For example, if i set my pot to be the first interger and therefore first in the unpacked data, after i reset my arduino it moves from that position and needs to be re-calibrated. is there a way to read each pin in a loop?

sorry if this doesn't make sence, brains turning to mush.

cheers though!

Go Up