Basic stamp and MIDI
Maxb
Posts: 16
Hi every body!
for my final school project,
I would like to increase sound volume depending on the distance...
I don't know exactly how to do it, but I have a little idea...I mean 2 ideas
The first one:
1) proximity sensor + basic stamp --midi output + synthetizer + speakers
or
2) proximity sensor + basic stamp -- midi output --cable--USB + PC Pure data (ambient sound coming in)
+ speakers
Is there anybody who has a better idea, or a suggestion..
thanks
Maxb
for my final school project,
I would like to increase sound volume depending on the distance...
I don't know exactly how to do it, but I have a little idea...I mean 2 ideas
The first one:
1) proximity sensor + basic stamp --midi output + synthetizer + speakers
or
2) proximity sensor + basic stamp -- midi output --cable--USB + PC Pure data (ambient sound coming in)
+ speakers
Is there anybody who has a better idea, or a suggestion..
thanks
Maxb
Comments
-- http://www.parallax.com/dl/docs/cols/nv/vol4/col/nv94.pdf
-- http://www.parallax.com/dl/docs/cols/nv/vol4/col/nv95.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Nice tutorials,
I will use it for sure...
Thanks a lot
Another thing...
My last problem was with the ADC,
(a special 4 channels ADC pin, 8 bytes)
Now, I am receiving measures,
but
instead of giving me a normal (expected)
value with the proximity sensor (0.42V-2.42V),
and the force sensor,
I have some values that are not matching
with what I calculated
The results are in HEX...
e.g. (proximity)
They are supposed to be between 15 (0.42 Volts) and 7A (2.42V)
But, I received $01, $02, $0B or $08,
Which it is strange...
The lowest value is suppose to be $15,
(pretty much the same weird thing with the force sensor)
CODE:
DEBUG HEX2 ?Proxi
DEBUG HEX2 ?Force
Do you have any idea where my problem might be?
Connections, code, format...
Thanks again
Maxb
Are you measuring the inputs to make sure they're what you expect? If yes, then check with the vendor (tech docs) for interfacing rules.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Thank you Jon,
for your help, I appreciate.
To your question..yes, I am using a special ADC,
·made by students of Morgan State University.
Here is a link for details: http://www.phanderson.com/stamp/a_d.html
I didn't measure my inputs, but I will...because,·I connected my proximity on 5 V ( Vcc),
and in the specs, it says that voltage goes from 0 to 2.5V. I will verify it...
Regards,
Maxb
http://www.rentron.com/four-channel-ad.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
First,
I read the document
http://www.rentron.com/four-channel-ad.htm,
on a special ADC Morgan Chip, made with a(PIC 12C671 I/P 04 RD8)
and I decided to put a 1K resistance from serout pin 2(ADC)
to the microcontroller BS2. works better,
Then,
I measured each analog input pin, to see if voltage is correct.
It was correct (I measured a variation), so I don't understand...
What I am doing wrong?
With the Voltmeter, I can see that at 4 inches, the voltage is around 2.42V
and at 31.5", the voltage is approx. 0.42V, but..
On my screen, with the debug command:
SERIN 8, 84, 1000, LED,[noparse][[/noparse]HEX PROXI, HEX SteerL]
DEBUG HEX2 ?PROXI ' display the result in hexa
DEBUG HEX2 ?SteerL
Results
Proximity sensor at 4 inches (2.42V)
and Force sensor(SteerL) (4.9V without any force)
2005-03-14 11:59:53 -0500
PROXI = $0F
SteerL = $0F
PROXI = $07
SteerL = $09
PROXI = $08
SteerL = $08
Results
Proximity sensor at 8 inches (1.45V)
and Force sensor (5V without any force)
2005-03-14 12:00:32 -0500
PROXI = $04
SteerL = $04
PROXI = $04
SteerL = $0F
PROXI = $04
SteerL = $0C
PROXI = $0F
SteerL = $06
I calculated that at 4", it sould be $7A,
and at 8", it sould be $43
I am confused..
and don't know what to do
A little help would be appreciated...
thanks
maxb
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
for all the info...
but,
I made some tests with ADC 0831, and it worked well. (reliable)
so, I guess , I'll buy a ADC 0834.
maxb
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Thank you Jon,
I appreciate,
I ordered this morning 2 chips ADC 0834...
Can't wait to try something..
Best regards,
Maxb
I don't want to pay for a synthetizer...
So
Will it work if I buy an electronic keyboard at Toys'R'Us ?..
even if there is no Midi inputs,
Is there anybody who ever tryed this?
If not,
can I try something else?
Thanks
Maxb
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
I haven't bought MIDI-ready model yet,
little problems to resolve before I buy it ..
I connected the ADC0834 with a BS2-SX using the National ADC datasheet...
Pins are connected as follow :
The thing is, I don't know what means SARS so, pin 11 (ADC0834) is not connected.
Pin 1=5V+
Pin 2= to pin 15 ( BS2-sx)
Pin 3 Ch0
Pin 4= Ch1
Pin 5= Ch2
Pin 6= Ch3
Pin 7= Ground
Pin 8= Ground
Pin 9= 5V+
Pin 10= Connected to Pin 13 (ADC0834)
Pin 11= SARS ??
Pin 12= to pin 13 BS2-sx
Pin 13= Connected with pin 10, plus one resistance (1K) to pin 14 BS2-sx
Pin 14= 5V+
I took your code that you gave me, and before using pots,
I tryed to receive a signal from my proxi sensor.
I checked with the voltmeter, and there is a voltage variation...
Except that with the debug command, I am receiving
CS0: 00
CS1: 00
CS2: 00
CS3: 0
and, no results at all in HEX2..
I presume that it must be pin 11 SARS??
I will try to find what it means
What sould I do.?.
Thanks again,
Regards
Maxb
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
I resolved my debug problem by changing the microcontroler.
Instead of using the BS2, with the code you gave me,
I took the BS2-sx.
You might ask me why??
Here's the answer:
Bread board + wires + Board of Education
or
BS2-sx on the Bread board
which is more useful....but not for the code..my mistake
sorry for this.
Regards,
Maxb
It's too bad, it should have worked. It's a really neat hack, in any event.
Still a few days before my final presentation...
and my goal is to present a little program using force, and proximity sensors as inputs
and LEDs sound volume as outputs.
I received a helpful code from Jon Williams for the ADC0834,
and two PDF documents on MIDI. (Column #94-95).
I almost understand the code, but...
I have some questions, here's the most important ones
I adapted the code to my project,
but I don't know how to put some LEDs ON because I get
4 results in Dec3 from ADC0834 with the Debug command.
See the code at the Jon Williams' previous message
File Attachment :
ADC0834.BS2.TXT · 2KB (text/plain)
I want to use a "If... Then" loop after debugging results,
I read that the value of an analogue input can be easily copied into a
variable by use of the READ command.
Let's say READ 100, ..?.. ' retrives the value at location 100, and stores it into the variable called..?.
What variable should I put? if I have one variable BYTE that gives 4 results Ch0, Ch1, Ch2. Ch3.
The other question is concerning the code for MIDI outputs.
I want to increase the sound volume when many variations of the distance are recorded
For exemple, when the head moves back and forth every 2 seconds, the proxi sensor detects it,
The results are between 141 and 76, and I want to increase volume depending on the time and the distance
A little big help would be appreciate!
I will send a part of my code of MIDI in 2 hours
thanks
Maxb