Hello!
I have been working with Pure Data for a bit and just recently came across the apple library.
I want to use the [ambient_light_sensor] as a MIDI CC controller so I can perform live with it. My objective is to use it as a modulator and send MIDI CC messages to software/hardware synth parameters. Question is: How do I go about dynamically mapping the lowest value the sensor as 0 and the highest as 127? What method does anyone recommend using? Thanks in advance
-
[ambient_light_sensor] help
-
@moih {expr ($f1 /HighestIncomingValue)*127]
Or in english: Your incoming sensor data, divided by the max level possible, multiplied by 127. This scales your incoming range to 0-127
-
great, thanks!
Also, is there a way to know what the max value a given sensor is outputting? aside from putting a number in the outlet and visually looking what the max output is?
-
@moih Usually the help file will tell you. Although the help file for this particular object is pretty sparse. I shined my phone light into my mac's camera and would get values around 9000 before the number boxes simply outputted a "+" which typically means overload. You might have to do some math to get these sensors numbers into a reasonable range.