Thanks for answer<br><br>Martin: I am researching about shift registers, but if the idea is to use puredata to control audio playbacks, thats means that i need to control shift registers with pd? because the arduino will be flashed with pd firmdata and will be imposible to upload code to control shift registers, is that posible or i am thinking wrong? <br>
 Thanks again<br><br>Best!<br><br><br><div class="gmail_quote">2011/5/30 Martin Peach <span dir="ltr">&lt;<a href="mailto:martin.peach@sympatico.ca">martin.peach@sympatico.ca</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On 2011-05-29 23:20, FernandoG wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi<br>
i need to design a sistem to control 40 diferents audio files and<br>
playback in a stereo sistem. I was thinking to use puredata and arduino,<br>
load the 40 audios in a pd patch and use 40 switches and resistors into<br>
some arduino inputs to trigger and playback any of the 40 audios in pd.<br>
Every switch will be conected to a diferent resistor to  generate<br>
diferents voltages then arduino inputs can diferenciate witch audio to<br>
playback. Also i need to power on a led any time a specific audio is<br>
been playback. The 40 audios will not be playback simultanusly, but<br>
probably al least 15 or 20 could be.<br>
<br>
Anybody knows about a similar proyect? can i use analog input to control<br>
various samples or its not good idea? multiplexors? do i need to use an<br>
arduino mega or its not necesary?can i power 15-20 led simultaneously?<br>
the best way to do this system stable for long long time?<br>
<br>
</blockquote>
<br></div></div>
The analog input method is similar to the resistor ladder that analog synthesizer keyboards used. Arduino analog inputs can differentiate 1024 levels but the values of resistors are usually 5%, but 40 levels should be easy.<br>

The best way to do LEDs is with shift registers. That way you can use just 3 pins on  the Arduino to control as many LEDs as you like.<br>
For LEDs use parallel-output shift registers, like the 74HC164. Also the input could be done with parallel-load shift registers (for example the 74HC165), but the resistor method is cheaper.<br>
It should be quite stable over time.<br><font color="#888888">
<br>
Martin<br>
</font></blockquote></div><br>