posted by tonedeft (tonedeft)
on 21.07.2007 21:25
So I just tacked two IR sensors like this one
http://www.sparkfun.com/commerce/product_info.php?products_id=242
mine are the GP2D120 version, Sharp P/N GP2Y0A02YK or sparkfun
#R144-GP2Y0A02YK
I'm not sure if those '0' are zeros or ohs.  I got these a while back
and they're not sold there anymore.  They do share the same manual with
the ones they currently sell and are simple devices.

I connected them to pins 1 and 2 on JA.

They work fine, but not quite right, they show up in the _40h_midi 
application just fine and I get a range of 0.08 to 0.58 unscaled in the 
_40h_midi app running
monome serialXP.  One strange thing is that both sensors change all 4
boxes in _40h_midi's [adc] gui.  if I had a few pots I could put those
in place instead and give you another data point.

Tiltmap doesn't work, yet.  I changed the prefix in monomeserialxp to
/box.  I just saw the thread on tiltmap, I'll check it out.

Are there any other apps that I can try these with?

I attached a .jpg but nothing's appearing?
posted by tehn (tehn)
on 22.07.2007 09:50
file attach isn't working?

try the code at the bottom of here:
http://forum.monome.org/topic/1008#new

range is dependent on the voltage swing. check it with a meter. the 
accels we use output 0.35-0.65 so it's not the full resolution.

if you only have two ADCs hooked up, only enable those two. if the other 
two are on, they'll get some weird bleed/noise from the others.


no other apps yet. any ideas?
posted by tonedeft (tonedeft)
on 22.07.2007 14:44
I can't post with FireFox, I can with IE, just tried it in the 'pretty 
LED' thread.

disabling the unconnected A/D ports worked, autocalibrate works too, 
maybe the text should be changed from calibrate to auto calibrate, last 
night I checked that box and thought I had to do something afterwards.


ideas for other apps...  maybe something like VU but for the ADC inputs, 
I take it that apps like _flip with VU meters in them used the VU.mxb in 
them, a similar .mxb for ADCs could help with app development.  That is, 
if I understand how this is all working.
posted by tonedeft (tonedeft)
on 22.07.2007 15:59
>if the other 
>two are on, they'll get some weird bleed/noise from the others.
come to think of it, a weak (10k, 100k?) pullup or pulldown resistor 
should keep the unused pins from floating, eliminating the need to turn 
them off, ever.  the adc input is a low impedance input, low impedance 
in parallel with a high impedance is still a low impedance.  I'd want to 
play with some values to know for sure.

edit - make it a pulldown so there's less data for the micro to process.
posted by tonedeft (tonedeft)
on 22.07.2007 23:12
>no other apps yet. any ideas?
I'm lmfao!!! over controlling autofilter in Ableton with IR sensors. 
omfg this is cool.
posted by tehn (tehn)
on 22.07.2007 23:27
video!!
posted by kevin (kevin)
on 23.07.2007 00:04
how many pins does one IR sensor take? does it leave room for an 
accelerometer?
posted by tonedeft (tonedeft)
on 23.07.2007 00:15
each IR takes 1 pin on JA, 1 pin to 5V and 1 pin to Gnd, dead simple. 
that leaves room for an accelerometer.

I'll put together something in Live for a video and post it.
posted by tonedeft (tonedeft)
on 24.07.2007 01:20
tehn-
I played with the sensors last night, mostly one IR in Live then both 
IRs with monome serial, callibration and whatnot.  it seems that only 
JA1 is being passed on by serial XP.

with the _midi module all seems right, I can calibrate the sensors again 
and again, see too much activity when they're ALL on, turn each on/off, 
etc.  anything downstream (midi i/o object in max, Ableton Live, MIDI 
Ox) only sees activity on the JA1 IR sensor.  if I only have the sensor 
on JA2 connected, none of the apps react, except for serial XP.  could 
it be a problem like you had where putting a ferrite bead in place 
chills the sensor's output?  One thing about the active IR sensor is 
that even when I keep the sensor desensitized it still shows constant 
activity even if it's a constant stream of the same channel/cc#/value, 
it takes a lot of bandwidth.

the problem seems to be in serial XP, it sees activity and can control 
what activity it sees but it's not passing info on.

is this the same thing you saw with the accelerometer, only one axis 
worked?  lots of activity on one axis blocking out the other axis until 
the ferrite was added?

hope that helps.
posted by tehn (tehn)
on 24.07.2007 12:37
there's an smoothing function in the firmware in addition to blocking 
repetitive output.

are you talking about monomeserial? (or serial xp?)

i've tested monomeserial for xp with a two-axis accelerometer and it 
worked great with the chuck tiltmap app.
posted by tonedeft (tonedeft)
on 24.07.2007 16:01
yes, it's with monome serial on XP.  do you think the faults I'm seeing 
are due to the lack of an inductor?  trying it again today...
launch monome serial
enable the Aux Inputs
open midi OX to monitor midi activity
launch Max 4.6
open _40h_midi
hit adc - both IRs are showing activity independent of each other
both are on channel 1, IR1 is CC#1, IR2 is CC#2
set output in _40h_midi to MIDI Yoke NT:1 channel 1
MIDI Yoke shows constant activity and is reading IR1 just fine, cc#2 
never shows up though
disabling IR1 in monome serial aux stops all activity, button presses 
monitor in Midi Yoke but not IR2.

ugh...
posted by Guest (guest)
on 12.08.2007 11:15
so let me get this straight....u can put something like the d-beam
controller on the rolland grooveboxes...?
posted by tonedeft (tonedeft)
on 12.08.2007 18:28
yep
posted by cole (cole)
on 10.09.2007 23:09
so is there a way to have both an accelerometer and an IR sensor at the 
same time? how about a switch on both so I can add 2 knobs?
posted by tonedeft (tonedeft)
on 11.09.2007 00:02
encoder - 2 JA pins
IR sensor - 1 JA pin
accelerometer - 2 JA pins
pot - 1 JA pin

there are 4 JA pins to work with, pick your poison.

a switch would work fine, I'm learning towards 1 encoder with an 
accelerometer on a switch with 2 IR sensors.

you would want a "DPDT" switch as shown here
http://en.wikipedia.org/wiki/Switch#Contact_arrangements
to switch between two devices that use 2 pins each.

P=pole, refers to the number of 'signal' inputs
T=throw, refers to the number of outputs
D=dual
S=single
etc.
posted by mipmip (mipmip)
on 11.09.2007 09:39
Hey Tone, did you ever clear up the problem you were having with your 
2nd infrared sensor (connected to JA2) not passing on midi messages? I 
think I'm seeing a similar problem - I can calibrate both sensors 
independently in _40h_midi (connected to JA1 and JA2), but only the one 
connected to JA1 seems to pass midi cc messages on and into AL. Just to 
clarify, I'm on XP and using monomeserial + MaxMSP 4.6 + AL 6. Oh, and 
this didn't stop me however from spending many hours yesterday using the 
one working sensor to control various things in AL. Using it to control 
filter cutoff freq - soooo much fun
Cheers
posted by tonedeft (tonedeft)
on 12.09.2007 15:37
I never got it to work, thanks for the reality check.

how many of the JA ports have people been able to pass info onto Live or 
another app?  I think there's a bug in _40h_midi.
posted by tehn (tehn)
on 12.09.2007 17:06
i believe i fixed the bug in the most recent version.
posted by mipmip (mipmip)
on 13.09.2007 08:07
the version I'm using is in 40h_base0400, is that the latest version?
posted by tehn (tehn)
on 13.09.2007 13:30
posted by mipmip (mipmip)
on 14.09.2007 08:47
Not sure if you did or not, but tried it last night with the updated 
base patch and it worked! Woohoo! 40h has changed everything for me : ) 
Thankyou tehn. Awesome work all round : )
posted by ultra (ultra)
on 14.09.2007 11:58
Hey Mip - did you try this w/ the touch sensors yet?  Should work pretty 
much the same I think.  I've been too busy w/ other stuff to try this 
myself just yet.
posted by mipmip (mipmip)
on 14.09.2007 12:18
Hi Ultra, I did try but didn't spend too much time on it - got carried 
away with the IR ones last night. I have one hotpot attached, but wasn't 
getting sensible readings in the _40h_midi adc callibration window  (it 
was flickering around 60ish midi cc value output when i had my finger on 
the strip, but that didn't seem to change according to where i placed my 
finger). I bought a multimeter this morning in order to test the voltage 
output from the strip, like you suggested, so I will have a go at that 
tonight, and post up my findings over the weekend.
posted by julien (julien)
on 14.09.2007 13:04
I bought two sharp GP2D12, lets hope I will get them working.
posted by frogstar (frogstar)
on 26.09.2007 14:14
I just added a Sharp GP2D120 to my Monome Kit - it's currently mounted 
in a clear plastic box, so I have the sensor pointing down to detected 
distance from the surface I'm holding it over - hoping this will work 
well in combo with the accelerometer for some interesting gestural 
options.

Initial tests show the IR sensor is working robustly, but is quite 
"stepped" in its response - hooking it straight up to oscilator 
frequency produces distinct notes instead of a smooth rise and fall in 
pitch.  I've tried some smoothing/filtering in software, but it doesn't 
make a big difference (some but not a lot).

Does anyone know if this is a limitation of the sample rate of the ADC's 
or the IR sensor itself??  I thought there'd be plenty of bandwidth for 
pumping out readings quite fast...
posted by tehn (tehn)
on 26.09.2007 16:09
it should read pretty quickly. one the other hand, human perception of 
pitch is very sensitive. you should add smoothers between the ADC 
readings and frequency output. this is easy to do in max/msp with a 
[line] object.
posted by longjohns (longjohns)
on 27.09.2007 01:33
woah, new max base patches?  had no idea...  :)

ps tehn: got the chips today, thanks!! and a secret surprise! :)