Forums > MaxMSP

math idiot seeks helpwith osc conversion

January 8, 2007 | 3:36 am

I am trying to generate a midi note from a laser and a photocell.
I have the laser hooked up and with it directed at the photocell. I am getting the value of around 186 in my patch (from the Make controller ADC, ( I have that part of the patch reading the sensor and giving me OpenSoundControl values (1-1024)
When I pluck the beam and interupt the light, the resistance jumps up to 800 or 900 depending on the room light. How do I make a patch that will generate lets say midi note 64, at full velocity (I’ll worry about velocity later, I want to use force resistor sensor which I have the circuit working nicely in the 0 to 5v, range) when I interupt the beam, the value from the sensor exceeds 200,say, (in osc values), a note will be generated, and then midiflush perhaps to avoid retriggering the note until the beam is set…I’m sure there’s someone out there that could figure this out in a snap
I’m a newbie any help would be appreciated…..an patch where when the number jumps from 200 to 800 a note triggers….


January 8, 2007 | 4:21 am

Take a look at the scale or zmap objects.


January 8, 2007 | 5:33 pm

Quote: mykeymuse@mac.com wrote on Sun, 07 January 2007 19:36
—————————————————-
> I am trying to generate a midi note from a laser and a photocell.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 136 44 157 196617 click on these to simulate sensor;
#P window linecount 5;
#P comment 130 156 173 196617 This is the simplest version. You might find that your switch needs to be "debounced". That’s simple enough with delay and gate , post if you need help.;
#P window linecount 1;
#P newex 86 164 40 196617 change;
#P newex 86 304 43 196617 noteout;
#P message 86 239 20 196617 64;
#P newex 86 267 100 196617 makenote 127 1000;
#P newex 86 190 32 196617 sel 1;
#P number 112 103 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 86 124 36 196617 > 700;
#P message 107 42 26 196617 800;
#B color 5;
#P message 66 42 26 196617 200;
#B color 5;
#P number 86 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 124 125 173 196617 < -- you could adjust this threshold;
#P connect 6 0 8 0;
#P connect 10 0 6 0;
#P connect 4 0 10 0;
#P connect 7 1 9 1;
#P connect 7 0 9 0;
#P connect 8 0 7 0;
#P connect 5 0 4 1;
#P connect 1 0 4 0;
#P connect 2 0 1 0;
#P connect 3 0 1 0;
#P window clipboard copycount 13;

mzed


January 8, 2007 | 7:13 pm

molecular gastrononist
I need one of those, too
(;
I don’t understand how to build a patch from those numbers but I’ll try!


January 8, 2007 | 9:03 pm

Michael,
Select the text, copy, and paste into a new patcher in max.


Owen

Michael kessler wrote:
> molecular gastrononist
> I need one of those, too
> (;
> I don’t understand how to build a patch from those numbers but I’ll try!


January 8, 2007 | 9:44 pm

yes now it makes sense! thanks


Viewing 6 posts - 1 through 6 (of 6 total)