< Back to IRCAM Forum

Distance calculation

Hello Spat community,

I want to make a super light spat application to be used in Ableton Live. Therefore I would not need the spat5.spat~ object. I would rather use spat5.pan. However, I do want to have distance attenuation. Is there an integrated way to do distance attenuation in Spat?

1 Like

Hi,

It should be fairly easy to build your own.
Here is an example with “standard” attenuation law (6dB drop).

Best,
T.


----------begin_max5_patcher----------
1207.3oc6Xs0aaaCE9Y6eEDb8g1AGGRcyR6o0fAzWVAJvdXOzVXPIS6xTYQC
IpD2Uz+66vKxQNQwVNQNCCnwAxTjGxy466bgj96iGgSka4UXzug9HZznuOdz
HSW5NF4deDdMaaVNqxHFdYtrndMdhcnkxx0LkdfHWOhEFwjoWeQPTiXaXkr0
bEubNufkly0hPbiAqlnHmqLKO8tNk0pld81sLpruHJVMujmorF8LxTxDTXqm
dzoDzmcyvtHpusgaEGimfvorhUXzm0R7iwi0OlzSvulWUwVwafkhu0XF3Kqj
0kY7KoWx3KPD3yqn3NHj.bWf1qSPSOFniMOojjdf5mDZyjqWyKTO.s0Uf4fn
HiGEwpPk7k7RdQ1NhYSIuBlISIjEyyEE7LYcgpMVayJT7gBERqScQLcGbPdb
dxOHxvMQVlJz9luloFP5foT7hZCVQhBzhqNNK32AKPNWrfGw2f63Da7R7YgE
VHpTLHD.IWhrYCneoqb.+jyMN8r3zm7rv4ITmye14uNGMjZfSxKTktB9s.zd
fWlucSI5hnoneEkKWQIuFwRqdM5UKon2.etz0q2a5xy6g6OUPONU3xpS7OW0
+NgP.ZzKWHf++sg.0EaXYeEQlp+mNsCGMM3Dbz9GaaNOhaetd.XviAtnIOnw
Ph+JvRCmJqxlVB5mi1au+tXCJd.OoC08Une+b+3cCWwtguXNXQvJNG1ypTjB
leki.bLvAieaO3Z1lM6F1LpgcGTNNSVbCuTeFieWTHT2JTeA8I7k1DQDv1eB
2EeSFT9NvUkI4kjuOSD5MB9s2mMcQu.sjBCgncxoyFxDZJ0kIG2SJ8LRqlkE
qOa18tDjw508uOWaYKmw0roF5N.rfWoDElS70VnYVg5ze1WMo2h43Zxa.zTP
ezj9tLOeMEzCMMHjmVQdGQQML7ySSzd.I5PPd5BcGWSzAPSy5ihHOPQ1jKXi
BnJdkSZiNfRVWKK0uFOw7pnv9pohBtjeinQ9DSOrRnThBx3qKM1Edaj8LF30
xE7xhZgY1i0nCTYk5a42Ogt.JGXl5aqWHj+Ebqr5p4uGt3lszFfpkr5b09LQ
5pkh77LYt07ZWfooHE1NZyNj6j8ivwi7RBnzXfVl5S8m4EYZAMBCgpfM7oaN
zlIEDFjP7zhFD4MKHzzJ1yOzW2hbuo4cmtHzDqFHIwj.aKnKJnq1SCNOnsbn
mobbS8xR4FYYiOElZxN4qUxUkrEBt8tq6WEchKPBt9uxP6FNwwoqABUzLm1A
d6bF+gk0g8DtRlu.8Aot7u3PtjkRPQh+wEdRo2c8tAxTdevedp5u8Nd164uW
Pvi6XHSiC2Mc8J2XMPR0aKErbjlVvCOBeBLM4+mH8B5wv3RVSwN5dV3i3k6S
Mgc4Kcmh6OKJXlgT7iC7oFhJ3dooOwr6d6PdR0Dbo9GvMN3dP11Y8IX8mdkg
of70oo8ulPxOSKdgSK9ZUt.NvyeqOMzg7Ssvq4GMZuGCjsXup4U407CWikkk
AJXOOfOU6p07dztS6j379CsA9tRNu3jsPh1jB80+oaQihgCiMnFm4B2uC1z6
jsMMQQLwugIdzPCORaG+d5Fn8n5leFAsEVswsmn4WaX7OF+u.E38cAB
-----------end_max5_patcher-----------
3 Likes

Excellent example! Thank you.

@tcarpent thank you for the example.
simple question: spat5.viewer already spits out in aed, so why do we need the spat5.converter?
At least this what happens to me all the time, even when I sent different coordinates to spat5.viewer:


----------begin_max5_patcher----------
1361.3oc6YszaaaDD9rzuhEr9fcgLEmku6oFiBjK0.AnG5gj.iUjqTVGJRA9
vVtA4+d2GjTTxRxTTqRQAhkA4x8Am46alclQq913QFyxVSKLP+F5inQi913Q
ijcI5XT8yiLVRVGkPJjSyXIsnfrfZLQMVIccor+oEYU4Qzovz0uftBPWgal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8bLTKMKllmVwjqdr.dbQVT9RxtIW
R4oljK8cUwrr+pjTVU7v8zzJURNNplSpRJ2lJlsXNKIIJKQodcS10jD0PMZS
0Zsy8i7R0wgN.DvoESav1G6Iawa351I5T8ZflE435DZgES0wC663JaEfscsE
sr1YY3MxxBBURvJLvxQ0h2EvkU2kw+5MpTyXYQDM4tyyVkk2XS4KMrc9UkYK
xIwLwIP7pL5Sp8jx4iJocImTyoK4DJqYMc87ZMF+gh04UxbWVRL5CYhxSXGy
jLOiKH1+T6eBvlreZRUt24OOU4OYyPMuN9th2kyHIHAt1TcU6Vtc7SNrsyxL
vU+Hb.Ls0+OQ5sfFslFaM5bRSXxMkZzmHFs6l1e..aeOGeIeXG3XCRNxYmMw
CbueusECJhwkHvv8j098wY8m7td38GmMq+6WB681keZdzi44qpe0x+VTMzwr
ScPj5Wpr6EMEjUcrG2kTQOdLVRTDW.aww1fvXJXVu1pcBqsu5VAeeNkldxZn
kPkbsE+IZAdA7hwzpxIO7m2yyYdx5lfnrjdntgXvUxiPWOzSWAUkpKORKgFV
rpN0l7juF+8w+KT1LJyK
-----------end_max5_patcher-----------
1 Like

Hi,
Good question.
The reason is that spat5.viewer does NOT always “spit out in aed”. The output coordinate format depends on the /format setting of the object.
So, yes, I agree that in this example patch, the spat5.converter is totally useless. But I put it on purpose because maybe you will re-use this approach in another context where the incoming OSC data might not already be in aed.

Best,
T.

1 Like