Author Topic: Need help implementing a cool feature  (Read 2534 times)

David

Need help implementing a cool feature
« on: February 09, 2009, 06:39:43 PM »
I've been dinking around for quite some time about building a MIDI bass pedal unit.  I am suffering badly from "creeping featurism", and I've basically blown it off because for a very long time, our church had all the bass playing capacity it could use, and then some.  Sadly, all things must pass, and this did too.  The bass player "assigned" to my team, alas, has a looonnnnnng way to go.

Be that as it may, one of the things I really wanted to have in a bass pedal unit was a way to set it and have repeating notes for as long as I held a pedal down.  This would come in handy for me as I seem to lack the dexterity of foot necessary to play anything faster than quarter notes.  Not exactly a driving bass part, by any means.

I've spent a fair amount of time thinking about this (when my thoughts are not occluded by the 1.5 trillion other things I think about).  If a PIC can react fast enough to poll a series of footswitches, send MIDI data and react to quarter notes played at a minimum of 120 beats per minute running at 4MHz, I'm betting a 16F877 wouldn't have too much trouble doing this at 20MHz.

I'm sure I'm dramatically oversimplifying this, but it seems that the core of what I have to do is:
determine the BPM desired (from a keypad)
determine what kind of note pattern to repeat (whole/half/quarter/eighth/sixteenth/whatever) using a pushbutton to select state change
multiply these two numbers to derive the delay time required to pass to an interrupt
play the note
start the interrupt
poll all user interfaces
when the interrupt returns, shut off any notes that are playing
repeat

Am I on the right track, or have I missed something crucial?

David

Re: Need help implementing a cool feature
« Reply #1 on: February 14, 2009, 07:44:07 AM »
Well, the Piclist came through and helped me solve at least part of it.  At least now I have algorithms for keypad handling that don't require an entire PIC and for multiplication.