Gamepad and the rest of the world - SCALE object acts weird
I saw the gamepad object reported on CDM website, then the Max update came up and saw it there too, so I went out and got a PS5 controller day before yesterday, plugged it into my Mac and everything popped up in the gamepad help screen and the numbers were flowing in as I diddled the controls. Now the serious questions. I was able this morning to link the trigger controls via Max to DC audio out to my analog synth oscillators and run the frequency up and down pulling the triggers. Great! My main questions have to do with
scaling and smoothing the controller numerical data from the joysticks, trackpad, accelerometer and gyroscope
generating either trigger or gate signals from button pushes
As to smoothing, I mean smoothing out the accelerometer and gyroscope streams to give finer control over them. Hit a button to get an analog trigger. Push and hold a button to get a gate. Looked all over Max and BEAP and didn't see anything. Also I looked all over to find out what the "signal" characteristics are in Max/Msp (BEAP) and how those relate to actual voltages out in DC coupled analog land.
I am assuming that thanks to the gamepad object and its amazing usefulness, there are probably a lot of people looking at these same questions. Will there be central set of tools (patches) to hook the gamepad object outputs to the rest of the world? So far all I have are simple ways to either latch button presses or not... Thanks!
In case your audio Interface does not block dc, measure voltage which your audio interface outputs using dc meter.
In max use sig~ and send -1 or 1 which is max range for dac~
for example
Motu ultralite outputs -4.6 to +4.6 volts DC
for audio signal from -1. to +1. on line outs, unbalanced.
If one takes balanced out DC between - phase and + phase it is
double, -9.2 to +9.2 dc.
On phones output it is -4.9 to + 4.9
then you scale sig~ values to what you need.
Gate or trigger - take it from your destination app specs.
I mean what voltage and shape it needs to become a trigger
and threshold values for gate On/Off.
........
smoothing and scaling axis, accel, gyro etc
check output range of your controller, then zmap it to wished range.
where to apply smoothing and filtering depends on resolution you need
and how much loss you can accept from full controller range to smoothed range.
for example dirty & oscillating analog 0 -1024 output coud be first set to output only if
moved in same direction for nn number of readings,
then divide output by 4 and send only if value changes.
gives solid 0 255 range
or you take 10 readings, average the output and so on and so on.
there is no universal technique, it all depends on input and needed output.
Thanks!!! I am able now to map the gamepad controls to output CV, triggers, and gates. Gamepad control to SCALE object, then to SIG~, then to Beap mono audio output out to the analog world. And setting output voltages is simple: 0. to 1. as input from gamepad, and, for example, -3. to 3. to get -3 volts to 3 volts output. I used the Beap voltmeter in Max and a scope in the analog world to see what is going on.
I now want to build an interface (and not use the gamepad help screen!) to setup the gamepad for various purposes. I want to be able to tailor each SCALE setting for the controls of the gamepad, to the required voltages for the analog world. So, I hooked a couple Live dial objects to the scale object to set the required min max settings. Once I do that, and move the dial, the scale object no longer outputs the correct values, it seems to get locked up. If I delete the dial connections, it's still locked up. I have to delete the scale object and make a new one. As long as I don't tweak the min max values after the initial setup it's all fine. Number boxes (float) do the same the thing. Works once, the locks up. Bug? Me doing something wrong?
Max 8.6.3 macOS Sonoma 14.5 MacStudio M2 Max 32 GBs
can you post a patch, so that one can see what is wrong ?
Beap stuff ... I would rather see what is inside and take only needed stuff
for example you don't need all this : (BEAPCONVERTR.maxpat)

to signal to float & scale?
Adding too many waists can lead to problems you describe ...