Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

16 to 2 Mulitplexer to Max MSP

Loading...

Sign in or sign up now!
5,038
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 7, 2007

The aim here is to read 16 pots into the Arduino using a single analog input and to send this data to Max/MSP. Two hardware multiplexers are used for this (4021s). Max then does software-based demultiplexing. The process consumes two analog inputs and three digital pins on the Arduino (plus the RX and TX pins of course).

The 4021 (in multiplex mode) has 3 control pins, 8 inputs and 1 output. The control pins set which input channel is presently routed to the output. 3 Arduino digital pins (2,3 and 4) are controlling this process. 8 pots are connected to the 8 channels on each 4021. The output of one 4021 is connected to Arduino analog input pin 0, the other to 1.

Max "requests" to see data from the Arduino. This is achieved by sending the byte "76" ('L' is for Listen'). Upon receiving a 76 from the host computer, the Arduino goes through a loop of 16 cycles in length. Each repetition reads from a different pot and prints the data back to the host computer.

Max waits for a small amount of time, and groups 16 bytes together in a list that can then be used elsewhere.

In the example video, the bytes are used to control the amplitude of 16 harmonics starting with 100Hz.

By using this "call and response" type setup, the computer knows which byte is which when it is coming out of the computer ie. it's not just a stream of never-ending numbers.

more info:
http://little-scale.blogspot.com/2007/09/multiplexy.html

http://little-scale.blogspot.com/2007/06/arduino-midi-out-example.html

http://little-scale.blogspot.com/2007/06/16-step-microtonal-digilog-sequencer...

http://little-scale.blogspot.com/2007/06/16-to1-hard-mux-soft-demux.html

http://little-scale.blogspot.com/2007/06/hard-mux-soft-demux.html


-------------------------
http://little-scale.blogspot.com

Category:

Music

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (littlescale)

  • nice job. i'm not familiar with the arduino. So basically, when you send "76", the arduino cycles through all eight selection states on pins 2-4? can you control the speed at which it steps through the states? and can you adjust the A2D resolution on the arduino? and will it work with Pd the same as it does in Max?

  • You can control the speed at which it steps through the pots by placing a delay(); command in the code, but currently it is just going as fast as it can (for the quickest response across the eight pots). The max ("default") resolution for the Arduino is 10 bits. But because this is sending MIDI control data, the Arduino shifts the analog to digital value left by three bits.

  • If Pd supports a Serial object, then it is possible. Otherwise, it is also possible to send the data over a MIDI interface (with the right code on the Arduino). ;-)

  • would it be possible to use another 3 pairs of 4021s for the analog in 3,4 and 5 on the arduino board? or are there any complications?

  • furthermore, it is then possible to connect the output of a multiplexer into the input of a multiplexer, essentially chaining them together. this allows one to have, say, 256 inputs connected to 9 x 4051s (8 of them connected to 1) and controlled by 8 digital pins.

    etc etc.

  • the only complication would be the sampling rate of the multiplexed inputs -- which of course goes down with the number of inputs and multiplexed inputs used in a system.

see all

All Comments (10)

Sign In or Sign Up now to post a comment!
  • great job! so how do you get the serial data into Max/MSP?

  • how did you interface the multiplexer ins? with max? arduino2max? is it possible to see the patch?

  • i made a mistake in my movie info - the ICs i used a 4051 (8 to 1 multiplexer).

    it should be easy to use, say, 6 multiplexer going into analog inputs 0, 1, 2, 3, 4, 5 and controlled by 3 digital output pins in order to get a total of 8 x 6 = 48 ins

  • Hi there,

    If you look in the movie information, you can find some links at the bottom. Follow these links to find out more.

    Let me know if you are needing any more info.

    Cheers

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more