Arduino music sequencer feasibility.
October 11, 2011 10:36 AM   Subscribe

I'm making my first electronics project: a super-simple musical sequencer controlled by an Arduino and SNES Super Advantage. Can you help me out with some logistics/feasibility questions?

The controller can do auto-turbo on every button except select, and has sliders to control the speed of the turbo, so I figured it would make a great, if simple, sequencer.

I know my way around this stuff enough to have hooked up the Super Advantage to my breadboard/Arduino, read up on how the controller reads and writes data, found some applicable code and modified it to do what I want. Specifically, I adapted this code to use an SNES controller rather than an NES controller (basically, 16 clock pulses and 16 bytes of data rather than 8 pulses/bits) and had it read the values into an array instead of an int so I could isolate the individual buttons. It works! I can now tell exactly which buttons are being pressed per cycle.

Now, I'm a little stumped. I'm nowhere near good enough to start messing with sound chips, so I figure I'm going to be hooking up a bare-bones speaker (and, uh, possibly more power?) to the thing and using a simple tone-generation library to have it make a specific noise for each button for a set period of beats at a certain tempo. That's where it gets a little confusing:

I can't find any datasheets on the advantage. Advertisements say that the turbo maxes out at 30 presses/second, so is that what I should be aiming at detecting?

This gives timings in microseconds, but I'm not sure how to integrate that into the code. There are delays in the code, but should I try to figure out how fast the loop takes before setting up the delay to make up for the remaining microseconds?

I figure using the joystick to control tempo, pitch and other things is the way to go. Should I start with a simple LCD display immediately or can I get somewhere before integrating one?

Should I look for an Arduino tone generation library that can already handle simultaneous notes played at the same time? I'm completely green at digital music and I've been reading through some materials, but even Wikipedia goes too deep, too fast for me. I can't tell what a reasonable amount of work-already-done-for-me I should expect with my relative (lack of) expertise.

To head some stuff off at the pass, I already posted on the Arduino forums to not much help. I'm not sure where else to go, so that would be an awesome help in itself.
posted by griphus to Technology (2 answers total) 3 users marked this as a favorite
 
Disclaimer: I'm making educated guesses at the following since I haven't connected a d-pad to the arduino. I have connected stuff like accelerometers and multiple outboard powered servos, controlled via python on the command line :)

Advertisements say that the turbo maxes out at 30 presses/second, so is that what I should be aiming at detecting?

I'm thinking that due to nyquist frequency, you may want to sample it at least twice that per second, because imagine if you sample it 30 times a second, and it samples exactly at the button down, you are not going to have any button up signals. Suggestion: change the delay so that it gives at least 60 calls to controllerRead(), and monitor the output via the serial monitor.

There are delays in the code, but should I try to figure out how fast the loop takes before setting up the delay to make up for the remaining microseconds?

Possibly. There are uS delays inside controllerRead(), but I wonder if they'd add up to even a mS, when including all the other calls. I'd suggest just altering the main loop's delay for a start.

Should I start with a simple LCD display immediately or can I get somewhere before integrating one?

If you already have experience with the LCD, sure why not? Personally I'm working on a rather big project, and am tackling/learning the individual pieces of the hardware and how they react to the microP before I assemble them all. I once worked on a state based serial comms system, and used 3 leds to reflect which state the arduino was in. Perhaps using the brightness of an LED (non linear though, iirc), or even like an LED Bar Graph or LED Matrix instead would be simpler? Sparkfun may be a good place to lookup alternative display options.

Should I look for an Arduino tone generation library that can already handle simultaneous notes played at the same time?

I'm actually working on a midi controller. Well not yet, as I'm still learning other components, but I've gone through the arduino midi library. My plan is to get a one port midi input that I can hook up to a software synth, and then the arduino will send notes to the pc via the midi port. If your design is standalone to run off speakers, yes, you'd probably need to find a library or figure out a way to get multiple notes to play together. I want realistic voices, and think midi is a good solution. The midi language seems like a pain in the tail though.

Hope this helps!
posted by TrinsicWS at 12:12 PM on October 11, 2011


The midi language seems like a pain

Actually, it's pretty simple, especially if all you need to do is choose some instruments and play some notes. You can plug a midi synthesizer into your arduino pretty cheaply, like with sparkfun's instrument shield.
posted by moonmilk at 3:08 PM on October 11, 2011 [1 favorite]


« Older Category: "food" & "drink"   |   What should I see on my roadtrip? Newer »
This thread is closed to new comments.