Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the format Name#Password
Comment
[i]Italic Text[/i]
[b]Bold Text[/b]
[spoiler]Spoiler Text[/spoiler]
>Highlight/Quote Text
[pre]Preformatted & Monospace Text[/pre]
[super]Superset Text[/super]
[sub]Subset Text[/sub]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich


Arduino: More Analog In?

Reply
- Sun, 15 Mar 2015 16:56:40 EST xfGCXuR4 No.6658
File: 1426453000836.jpg -(786482B / 768.05KB, 1297x708) Thumbnail displayed, click image for full size. Arduino: More Analog In?
Yo, I'm making a MIDI sequencer using an arduino mega. As standard it's got 16 analog inputs. However, the sequencer I'm making has 16 steps, and I want each to have it's own frequency knob as well as velocity knob, and there may be a couple more needed elsewhere on the controller, so I'm looking at 32+ analog ins.
I've seen I could get a multiplexer to increase inputs, but from what I understand I'd have to first select the knob I wanted to control and only then the value would be read. Whereas what I want is for the changes to be instantaneous, so I could change several knobs at the same time without having to select them. Anyone got any advice on this? I'm stumped.
>>
Albert Mommlelet - Sun, 15 Mar 2015 19:40:27 EST JFQ3oC7N No.6659 Reply
>>6658
Let's say the arduino did have more analog inputs. Say 32 or 64. You could connect all your inputs simultaneously, but think about your code: you've still got to read an input, do an action, go to the next input, and so on, so it's never truly instantaneous. You're going through a loop, and hitting every input along the way. Maybe the loop executes 100 times per second, so there's a .01 sec delay, at most, from your knobs. If it happens that you have to multiplex your inputs, this may add, say 1ms on top of whatever else is going on. It won't be instant, but for all intents and purposes, you'll likely not notice the time delay.

If you find that you need something truly simultaneous, the arduino probably will not do. Why? Because it works sequentially. It can look at an input, do something, and then do the next thing. A musical instrument, of course, can multitask: all the strings on a harp can vibrate independent of one another. If you find that you absolutely need this type of processing, the arduino may limit you. First, it is fast, but not breathtakingly so, and second, because it cannot process inputs in parallel.

There are two types of chips, called DSPs and FPGAs, which are more suited to high speed processing of many inputs. They are very different to program than the arduino, but they do find use in high-end audio applications.

That being said, I think the arduino, plus a multiplexer, will be more capable than you're inclined to believe, for sequencing MIDI. Multiplexers can work extremely quickly, and interface readily with the arduino.
>>
George Fopperworth - Sun, 15 Mar 2015 19:44:03 EST 7JSxEYqU No.6660 Reply
This should actually be pretty easy.
Simply group the potentiometers into groups of 16s and switch their supply voltage/ground voltage pins between +5V/0V and floating respectively.
All it should take is one npn and one pnp transistor per pair and a gpio pin.
>>
George Fopperworth - Sun, 15 Mar 2015 19:48:51 EST 7JSxEYqU No.6661 Reply
just figured just npns should be fine wired correctly.

If it's not clear you measure pot groups in turns.
>>
George Fopperworth - Sun, 15 Mar 2015 19:55:39 EST 7JSxEYqU No.6662 Reply
oh and you won't get the full 10 bit range because of the voltage drop with the same power supply, it won't hardly matter though, since all you need is 7 bit.
>>
Pez - Mon, 16 Mar 2015 04:42:32 EST xfGCXuR4 No.6663 Reply
1426495352891.jpg -(74402B / 72.66KB, 500x350) Thumbnail displayed, click image for full size.
Cheers guys. Feel a bit dumb now for not realising this

Report Post
Reason
Note
Please be descriptive with report notes,
this helps staff resolve issues quicker.