Shop OBEX P1 Docs P2 Docs Learn Events
resistor question regarding midi out from stamp — Parallax Forums

resistor question regarding midi out from stamp

ArchiverArchiver Posts: 46,084
edited 2003-11-12 16:44 in General Discussion
Out of curiosity, no matter what the code is, would using a 240ohm
resistor where a 220 ohm resistor should be in regards to pin 4 on the
female midi interface, and a 200 ohm resistor where a 220ohm resistor
should be in regards to pin 5 on the female midi connection actually
cause the whole thing to not work at all? I was merely working with
what was available, I still figured I'd get something out of it... was
I grossly mistaken? thanks.

ry


--- In basicstamps@yahoogroups.com, "r_couldrey" <r_couldrey@y...>
wrote:
> okie dokie, currently have a bunch of wires all over my desk, and
have
> lost several thousand strands of hair in frustration over this midi
> setup. Scratched the idea of 15 potentiometers due to cost (about
> 5$CAN per POT and plastic knob, !!!!) Trying to get a flex sensor on
a
> stamp to be recognized as a midi controller within Reason, and
cannot
> for the life of me get it working. I've tried altering the
parameters
> within the code, but it isn't sending out any midi through pin 0
from
> the flex sensor on pin 1. I'm certain I have the hardware set up
> correctly, but I'm pretty uncertain about how I've butchered this
> code. Reason itself isn't detecting any midi information that I can
> see. If I've really blatantly messed anything up, it'd be great to
> know, as I can't figure this out at all.
>
> a great many thanks in advance for any help. With any l,uck, I won't
> short circuit my Quattro in the meantime...
>
> ryan



> 'constants, shouldn't change these
> midibaudmode CON 32780 '31.25kb, 8n1, non-inverted, open collector
> 'for 14-bit controllers - controller 32 is lsb of controller 0, etc.
> controllerLSBoffset CON 32
> 'MIDI status bytes:
> controller CON %10110000 + 0
> noteon CON %10010000 + 0
> pitchbend CON %11100000 + 0
>
> 'declare variables
> value VAR Word 'holds the 16-bit value read from the pot
> pin VAR Nib 'which pin/pot we are reading at the moment
> statusbyte VAR Byte 'MIDI status; controller, noteon, or
pitchbend
> data1 VAR Byte 'first data byte, eg. controller or note
> number
> data2 VAR Byte 'second MIDI data byte, eg. value or
velocity
>
> 'user configuration - adjust these to suit you
> 'DANGER - check your circuitry and configure pins accordingly!!
> 'set unused pins to outputs
> DIRS = %1111111111111111 'all outs
> OUTS = %0000000000000000 'all low
> midichannel CON 1 'MIDI transmit channel
> midioutpin CON 0 'pin connected to MIDI out connector
> 'check the MIDI spec for a list of controller numbers you can use
> controlleroffset CON 0 'add to pot's pin # to get MIDI controller #
> hipot CON 1 'highest pin with a pot to measure
> lowpot CON 1 'lowest pin with a pot to measure
>
>
> doit:
> DEBUG HOME
> FOR pin = lowpot TO hipot
> 'read the value of the pot
> HIGH 1
> PAUSE 0
> RCTIME 1, 1, value
> DEBUG value, DEC pin, " reads ", DEC value, CR
> value = value >> 1 'drop the least significant bit
>
> 'send most significant 7 bits as continuous controller msg
> statusbyte = controller 'sending controller message
> data1 = pin + controlleroffset 'controller #
> data2 = value.HIGHBYTE
> SEROUT data1, data2,[noparse][[/noparse]statusbyte, data1, data2]
>
> 'uncomment this section to send 14-bit controller data
> 'send least significant 7 bits
> data1 = data1 + controllerLSBoffset
> data2 = value.LOWBYTE
> data2 = data2 >> 1 'convert to 7 bits
> 'use running status byte (can leave it out if unchanged)
> SEROUT data1, data2, [noparse][[/noparse]data1, data2]
> NEXT
> GOTO doit

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-11-09 21:41
    well okie dokie then...


    --- In basicstamps@yahoogroups.com, "r_couldrey" <r_couldrey@y...>
    wrote:
    > Out of curiosity, no matter what the code is, would using a 240ohm
    > resistor where a 220 ohm resistor should be in regards to pin 4 on
    the
    > female midi interface, and a 200 ohm resistor where a 220ohm
    resistor
    > should be in regards to pin 5 on the female midi connection
    actually
    > cause the whole thing to not work at all? I was merely working with
    > what was available, I still figured I'd get something out of it...
    was
    > I grossly mistaken? thanks.
    >
    > ry
    >
    >
    > --- In basicstamps@yahoogroups.com, "r_couldrey" <r_couldrey@y...>
    > wrote:
    > > okie dokie, currently have a bunch of wires all over my desk, and
    > have
    > > lost several thousand strands of hair in frustration over this
    midi
    > > setup. Scratched the idea of 15 potentiometers due to cost (about
    > > 5$CAN per POT and plastic knob, !!!!) Trying to get a flex sensor
    on
    > a
    > > stamp to be recognized as a midi controller within Reason, and
    > cannot
    > > for the life of me get it working. I've tried altering the
    > parameters
    > > within the code, but it isn't sending out any midi through pin 0
    > from
    > > the flex sensor on pin 1. I'm certain I have the hardware set up
    > > correctly, but I'm pretty uncertain about how I've butchered this
    > > code. Reason itself isn't detecting any midi information that I
    can
    > > see. If I've really blatantly messed anything up, it'd be great to
    > > know, as I can't figure this out at all.
    > >
    > > a great many thanks in advance for any help. With any l,uck, I
    won't
    > > short circuit my Quattro in the meantime...
    > >
    > > ryan
    >
    >
    >
    > > 'constants, shouldn't change these
    > > midibaudmode CON 32780 '31.25kb, 8n1, non-inverted, open
    collector
    > > 'for 14-bit controllers - controller 32 is lsb of controller 0,
    etc.
    > > controllerLSBoffset CON 32
    > > 'MIDI status bytes:
    > > controller CON %10110000 + 0
    > > noteon CON %10010000 + 0
    > > pitchbend CON %11100000 + 0
    > >
    > > 'declare variables
    > > value VAR Word 'holds the 16-bit value read from the pot
    > > pin VAR Nib 'which pin/pot we are reading at the
    moment
    > > statusbyte VAR Byte 'MIDI status; controller, noteon, or
    > pitchbend
    > > data1 VAR Byte 'first data byte, eg. controller or note
    > > number
    > > data2 VAR Byte 'second MIDI data byte, eg. value or
    > velocity
    > >
    > > 'user configuration - adjust these to suit you
    > > 'DANGER - check your circuitry and configure pins accordingly!!
    > > 'set unused pins to outputs
    > > DIRS = %1111111111111111 'all outs
    > > OUTS = %0000000000000000 'all low
    > > midichannel CON 1 'MIDI transmit channel
    > > midioutpin CON 0 'pin connected to MIDI out connector
    > > 'check the MIDI spec for a list of controller numbers you can use
    > > controlleroffset CON 0 'add to pot's pin # to get MIDI
    controller #
    > > hipot CON 1 'highest pin with a pot to measure
    > > lowpot CON 1 'lowest pin with a pot to measure
    > >
    > >
    > > doit:
    > > DEBUG HOME
    > > FOR pin = lowpot TO hipot
    > > 'read the value of the pot
    > > HIGH 1
    > > PAUSE 0
    > > RCTIME 1, 1, value
    > > DEBUG value, DEC pin, " reads ", DEC value, CR
    > > value = value >> 1 'drop the least significant bit
    > >
    > > 'send most significant 7 bits as continuous controller msg
    > > statusbyte = controller 'sending controller message
    > > data1 = pin + controlleroffset 'controller #
    > > data2 = value.HIGHBYTE
    > > SEROUT data1, data2,[noparse][[/noparse]statusbyte, data1, data2]
    > >
    > > 'uncomment this section to send 14-bit controller data
    > > 'send least significant 7 bits
    > > data1 = data1 + controllerLSBoffset
    > > data2 = value.LOWBYTE
    > > data2 = data2 >> 1 'convert to 7 bits
    > > 'use running status byte (can leave it out if unchanged)
    > > SEROUT data1, data2, [noparse][[/noparse]data1, data2]
    > > NEXT
    > > GOTO doit
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-12 16:44
    That really _shouldn't_ be a problem ... unless everything is on the
    ragged end of specifications. It's simply a current limiter for an
    opto-isolator.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: r_couldrey [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=D1J0DPVNlC06iF3FsUw33DdR53OeTMMD1JEn2RhCcY-3nKxqrngVo5IV6tM3AFuWs06LzYtC5sTuhg]r_couldrey@y...[/url
    Sent: Thursday, November 06, 2003 2:11 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] resistor question regarding midi out from stamp


    Out of curiosity, no matter what the code is, would using a 240ohm
    resistor where a 220 ohm resistor should be in regards to pin 4 on the
    female midi interface, and a 200 ohm resistor where a 220ohm resistor
    should be in regards to pin 5 on the female midi connection actually
    cause the whole thing to not work at all? I was merely working with
    what was available, I still figured I'd get something out of it... was
    I grossly mistaken? thanks.

    ry


    --- In basicstamps@yahoogroups.com, "r_couldrey" <r_couldrey@y...>
    wrote:
    > okie dokie, currently have a bunch of wires all over my desk, and
    have
    > lost several thousand strands of hair in frustration over this midi
    > setup. Scratched the idea of 15 potentiometers due to cost (about
    > 5$CAN per POT and plastic knob, !!!!) Trying to get a flex sensor on
    a
    > stamp to be recognized as a midi controller within Reason, and
    cannot
    > for the life of me get it working. I've tried altering the
    parameters
    > within the code, but it isn't sending out any midi through pin 0
    from
    > the flex sensor on pin 1. I'm certain I have the hardware set up
    > correctly, but I'm pretty uncertain about how I've butchered this
    > code. Reason itself isn't detecting any midi information that I can
    > see. If I've really blatantly messed anything up, it'd be great to
    > know, as I can't figure this out at all.
    >
    > a great many thanks in advance for any help. With any l,uck, I won't
    > short circuit my Quattro in the meantime...
    >
    > ryan



    > 'constants, shouldn't change these
    > midibaudmode CON 32780 '31.25kb, 8n1, non-inverted, open collector
    > 'for 14-bit controllers - controller 32 is lsb of controller 0, etc.
    > controllerLSBoffset CON 32 'MIDI status bytes:
    > controller CON %10110000 + 0
    > noteon CON %10010000 + 0
    > pitchbend CON %11100000 + 0
    >
    > 'declare variables
    > value VAR Word 'holds the 16-bit value read from the pot
    > pin VAR Nib 'which pin/pot we are reading at the moment
    > statusbyte VAR Byte 'MIDI status; controller, noteon, or
    pitchbend
    > data1 VAR Byte 'first data byte, eg. controller or note
    > number
    > data2 VAR Byte 'second MIDI data byte, eg. value or
    velocity
    >
    > 'user configuration - adjust these to suit you
    > 'DANGER - check your circuitry and configure pins accordingly!! 'set
    > unused pins to outputs DIRS = %1111111111111111 'all outs
    > OUTS = %0000000000000000 'all low
    > midichannel CON 1 'MIDI transmit channel
    > midioutpin CON 0 'pin connected to MIDI out connector
    > 'check the MIDI spec for a list of controller numbers you can use
    > controlleroffset CON 0 'add to pot's pin # to get MIDI controller #
    > hipot CON 1 'highest pin with a pot to measure
    > lowpot CON 1 'lowest pin with a pot to measure
    >
    >
    > doit:
    > DEBUG HOME
    > FOR pin = lowpot TO hipot
    > 'read the value of the pot
    > HIGH 1
    > PAUSE 0
    > RCTIME 1, 1, value
    > DEBUG value, DEC pin, " reads ", DEC value, CR
    > value = value >> 1 'drop the least significant bit
    >
    > 'send most significant 7 bits as continuous controller msg
    > statusbyte = controller 'sending controller message
    > data1 = pin + controlleroffset 'controller #
    > data2 = value.HIGHBYTE
    > SEROUT data1, data2,[noparse][[/noparse]statusbyte, data1, data2]
    >
    > 'uncomment this section to send 14-bit controller data
    > 'send least significant 7 bits
    > data1 = data1 + controllerLSBoffset
    > data2 = value.LOWBYTE
    > data2 = data2 >> 1 'convert to 7 bits
    > 'use running status byte (can leave it out if unchanged)
    > SEROUT data1, data2, [noparse][[/noparse]data1, data2]
    > NEXT
    > GOTO doit


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
Sign In or Register to comment.