took this interpolation from this graph
the approximation is already great, the sound starts sounding roomy around 0.5 meter distance.
But I should know exactly the db reduction like a regular eq plugin.
image bounds(0, 0, 1300, 688) channel(“background”), file(“Acoustic-Treatment-for-Home-Studio_Bass-Trap.jpg”)
form caption(“Sampled Drums GUI”) size(1300, 688), colour(“black”), pluginID(“SMo1”)
groupbox bounds(0, 0, 435, 700), , alpha(0.6) channel(“groupbox3”)
groupbox bounds(0, 114, 435, 110), , alpha(0.4) channel(“groupbox4”)
groupbox bounds(0, 322, 435, 276), , alpha(0.4) channel(“groupbox5”)
groupbox bounds(0, 322, 218, 276), , alpha(0.15) channel(“groupbox6”)
rslider bounds(2, 116, 105, 101), channel(“att”), range(0, 1, 0.01, 1, 0.01), text(“Attack”) valueTextBox(1) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) trackerColour(188, 136, 69, 255)
rslider bounds(108, 116, 105, 101), channel(“dec”), range(0, 1, 0.5, 1, 0.01), text(“Decay”) valueTextBox(1) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) trackerColour(188, 136, 69, 255)
rslider bounds(214, 116, 105, 101), channel(“sus”), range(0, 1, 0.5, 1, 0.01), text(“Sustain”) valueTextBox(1) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) trackerColour(188, 136, 69, 255)
rslider bounds(320, 116, 105, 101), channel(“rel”), range(0, 1, 0.5, 1, 0.01), text(“Release”) valueTextBox(1) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) trackerColour(188, 136, 69, 255)
vslider bounds(220, 317, 87, 271), channel(“room”), range(1, 100, 0, 1, 0.01) valueTextBox(1) text(“room (%)”) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) trackerColour(188, 136, 69, 255)
vslider bounds(10, 316, 89, 272) channel(“distance”) range(0.3, 1e+06, 500000, 1, 1) valueTextBox(1) text(“distance (cm)”) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) trackerColour(188, 136, 69, 255)
rslider bounds(80, 401, 89, 59), channel(“proximitycenter”), range(100, 200, 200, 1, 0.1), valueTextBox(1) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) popupText(“proximity center”)
rslider bounds(80, 485, 89, 59), channel(“airabsorption”), range(0, 100, 1, 1, 0.01), valueTextBox(1) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) popupText(“air absorption”)
rslider bounds(134, 444, 89, 59), channel(“proximitywidth”), range(0, 1000, 1000, 1, 0.1), valueTextBox(1) textColour(255, 255, 255, 255) fontColour(255, 255, 255, 255) popupText(“proximitywidth”)
sr = 96000
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
iAtt chnget “att”
iDec chnget “dec”
iSus chnget “sus”
iRel chnget “rel”
kdist chnget “distance” // kvalue between 2.5-5cm and max
kpc chnget “proximitycenter”
kres chnget “airabsorption”
kwidth chnget “proximitywidth”
kdB = (1.585699 - -17.16343)/(1 + (kdist/5.217269)^0.8339635)
kdB = kdB/17.16343
ain soundin “4mono.wav”
asig eqfil ain, kpc, kwidth, kdB // k-factor is adapter between distance to gain factor (negative) // anti proximity filter ----------- https://mynewmicrophone.com/proximity-effect/
kfco = 1854.15 + (20007.03 - 1854.15)/(1 + (kdist/3336.707)^1.275204)
asig rezzy asig, kfco, kres // mic distance low-pass filter ---- https://www.google.com/url?sa=i&url=https%3A%2F%2Fcodeandsound.wordpress.com%2F2014%2F08%2F21%2Fabsorption-of-sound-by-air-and-its-implementation-as-a-filter-part-1-theory%2F&psig=AOvVaw35gGCliI0F07QB34-iuP4c&ust=1650462530771000&source=images&cd=vfe&ved=0CA0QjhxqFwoTCIjttZ2ioPcCFQAAAAAdAAAAABAD
kEnv madsr iAtt, iDec, iSus, iRel
outs kEnv*asig
endin
;causes Csound to run for about 7000 years...
f0 z
;Delay is in ms
i 1 0 [60*60*24*7]
e
Is this how to paste the code?