Shop OBEX P1 Docs P2 Docs Learn Events
BS2P24 as a Trigger to MIDI Machine Questions — Parallax Forums

BS2P24 as a Trigger to MIDI Machine Questions

RickHRickH Posts: 40
edited 2008-05-14 16:51 in BASIC Stamp
I was hoping I could get a little Hindsite help from anyone that could posibaly see some problems with what I'm about to atempt. This is my first real "sofisticated" aplication with this stamp.

First off what I want to do -
1 . Triger a MIDI note on(Drums so its a togle on/off with·set duration) with Radio Shack Piezo Transducer 273-073 for each Pad, 12 pads
···· A.) Rectified Signal to an adjustable RC to tune the responce envelope. I need a 1 -127 Resolution signal to represent Velocity.
···· B.) AtoD convertion from the preceading circuit. What would be my best option? I have 12 trigers and 16 I/O, 3 of whitch are used. Leaves me with 13 I/O.
··········· a.- Speed/latincy - I need a responce from 12 devices from the Stamp into midi in less than 10mSec.
··········· b.- I need a cheep ADC chip, Alesis I/O is currently at $150 and·I am·layed off from work so income is at a minimum
·····C.) PBasic Programing
··········· a.- I do not need to transmit 0 velocity, do I just exlude 0, Pole on a trigger? I need the most responsive solution.

I use Sonar 6 for my sequencer and am quite familer with the sout and the stamp. I have used it as a midi switch to select banks and patches but this is not needed anymore as I have several ways to do this at my finger and toe tips now. So I was thinking that a MIDI Drum kit would rock. I have made and used the trigers befor with an MD5 drum machine so I fuigered it should work with the stamp also.

Sugestions and comments please, save me from makeing some dumb mistakes before they happen

Comments

  • RickHRickH Posts: 40
    edited 2008-05-14 14:20
    OK after 1 night of reviewing as many ADC chips as my brain can handle, I have come to the conclution that Datasheet writers need to go back to school.

    I litraly have seen "The most important feature of these converters is" in the same PDF in just about every function discription of the device. It makes me wonder what The most important feature of these converters is.

    Anyway I think I hae decided on a ADC. Its the National Semiconductor's ADC0838. If I use 2 then I have used a total of 6 I/O pins on my BS2P24, that will leave me with 10 for trigering and a panic button. I will have to double up on 2 I/O triggers, but I think I can get away with that if I think about it long enough. Any one have any experiance with this chip, or see why I shoudn't use it? I'm ordering 2 of them later today.

    Please I need sugetions and comments.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-14 15:53
    There is a lot of material on the use of the ADC0838 and the ADC0831 with the Stamps. Check out the Stamps in Class Tutorials, particularly the Basic Analog and Digital tutorial, all downloadable from Parallax's website (Resources tab, then Downloads, then Stamps in Class Downloads).

    You are not going to get the kind of speed you want from a Stamp. You need something like an SX or Propeller. The Propeller can do its own ADC without an external ADC chip, just a couple of resistors and capacitors. See the Propeller application note on the use of the counters (AN001) for details and sample code.
  • RickHRickH Posts: 40
    edited 2008-05-14 16:03
    What speeds will I get? Its what I have at the moment untill I can purchase the Alesis.
    One of the reasons I selected the ADC0838 is due to the documentation and price, I had about enough trying to sift through who has what in stock and reading PDF's for hrs on end to find its not what I can use.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-14 16:24
    Just a rough guess, but you may be able to read one channel of the ADC in 1 to 2 milliseconds. 12 channels would take at least 12 to 24 milliseconds. Reading several triggers (logic level signals) depends on exactly what kind of signals you're providing and how much processing they need in the Stamp. The Stamp can't send or receive MIDI while it's doing anything else (and vice versa) and MIDI isn't the fastest protocol.
  • RickHRickH Posts: 40
    edited 2008-05-14 16:35
    Yep, just got done reading the Prop manual. Wow, thats slick. 8 processors in one chip, Floating point and such. Seemed nice, But the only talk of A to D was on page 204 and that was just a quick refrence. How is it implemented? It also Looks like I could only do 2 pins. Or can you change the pins on the fly and pole across them?
  • RickHRickH Posts: 40
    edited 2008-05-14 16:38
    Ahh , I think it should be fast enough then. My plan was to monitor My input pins that I have left over for Triggers, Depending on whitch pin would go High it would then Read a specific channel buffer·the data (Flip Flop from keeping it from trigering again untill it was 0) and then do any other trigers, every 5 mSec it would then do the MIDI in one dump.

    Changed my mind now that I think about it. It wont be fast enough. How frustrating, I have spent 8 hrs reading up on a/d converters and now my hopes are crushed. Mabey I'll just turn it into a Midi CC event Box with some sliders and knobs. What a bummer.

    Post Edited (RickH) : 5/14/2008 4:48:46 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-14 16:45
    Regarding the Propeller, download the Application Note on the use of the Counters (AN001) from the Propeller Downloads page. It has sample code for ADC and, in the comments, a table of resolution vs. speed. You can do 12 bits of resolution at over 20K samples/sec. It takes 2 I/O pins per channel and one cog can do two channels while it's doing some other things. There's a guitar audio processor discussed at some length on the Propeller forum that does ADC and DAC while doing a variety of special effects processing, all in software on the Propeller.
  • RickHRickH Posts: 40
    edited 2008-05-14 16:51
    Ya, cant realy aforde one at the moment though. Funny when I have down Time I have no resorces to work on stuff and visa versa. Honestly being a guitar player I would look more at programing VST's rather than using a Processor, With the exception of a 32 bit DSP prossesor or something like that, but heh who has the money for DevKits like that. I have done quite abit of Home Brew FX and Tube/SS amps over the years and the more I play with thies VST's the more I fuiger its worth learning to program DSP DXI/VST stuff now adays. Although I did see an archived post about someone who was creating a curent monitor CCS control with a parallax device. Now that would be cool.
Sign In or Register to comment.