Commit 23c3d58b authored by wargreen's avatar wargreen
Browse files

Fix sound angle, hishelf with distance.

FIXME : delay (speed of sound) create a lowpass filter
parent 84d98dbe
No preview for this file type
declare name "Ambisonic Encoder";
declare name "Ambisonic Encoder 2D";
declare version "1.0";
declare author "Wargreen";
declare license "GPL v3";
......@@ -8,31 +8,32 @@ import("stdfaust.lib");
ORD = 1;
radius = hslider("Radius", 1.0, 0.1, 50, 0.01) : si.smooth(ba.tau2pole(0.02));
azimut = (hslider("Azimut", 0, -180, 180, 0.01)) * (ma.PI/180) : si.smooth(ba.tau2pole(0.02));
//elevation = hslider("Elevation", 180, 0, 359.99, 0.01) : si.smooth(ba.tau2pole(0.02));
radius = hslider("Radius", 1.0, 0.1, 20, 0.01) : si.smooth(ba.tau2pole(0.02));
azimut = (hslider("Azimut", 0, -180, 180, 0.01) -90) * (ma.PI/180) : si.smooth(ba.tau2pole(0.02));
stereo = checkbox("Stereo input");
width = hslider("Stereo Width", 90, -180, 180, 0.01) : si.smooth(ba.tau2pole(0.02)) * (ma.PI/180);
width = hslider("Stereo Width", 90, -180, 180, 0.01) * (ma.PI/180) : si.smooth(ba.tau2pole(0.02));
erLvl = hslider("Early Reflection Lvl", 0, -20, 0, 0.01) : si.smooth(ba.tau2pole(0.02));
hiLvl = hslider("HiLvl", 0, -10, 10, 0.1);
//preprocess = _;
//preprocess = fi.lowpass(1, 91930/radius) ;
preprocess = fi.highshelf( 1, ma.neg(0.43*radius), 15000);
//FIXME : delay make a Low-pass filter at certain frequencies...
delay = _ : de.fdelayltv(3,ma.SR, ma.SR * 1/340*radius) : _ ;
//delay = _ : de.fdelay(ma.SR, 1024, ma.SR * 1/340*radius) : _ ;
//preprocess = delay : fi.high_shelf(3, (-0.43*radius) + 0.43, 15000);
//preprocess = _ : fi.highshelf(1, (-0.43*radius) + 0.43, 15000);
preprocess = delay;
//delay = _;
delay = de.fdelayltv(1,ma.SR, ma.SR * 1/340*radius) ;
volume(r) = 1. / (r * r * (r > 0.1) + (r < 0.1));
stereAzim(ch) = ma.neg( ba.if(stereo, ba.if(ch < 1, azimut-width/2, azimut+width/2), azimut));
encodedry(ch) = _ * volume(radius)<: ho.encoder(ORD, _, stereAzim(ch) );
encoderev(ch) = _ * ba.db2linear(erLvl) <: ho.encoder(ORD, _, stereAzim(ch));
encodedry(ch) = _ * volume(radius) <: ho.encoder(ORD, _, stereAzim(ch) ) : _ * ba.db2linear(-3),_,_;
encoderev(ch) = _ * ba.db2linear(erLvl) <: ho.encoder(ORD, _, stereAzim(ch)) : _ * ba.db2linear(-3), _, _;
addout = _,_;
dryprocess = par(i, 2, delay : encodedry(i)) :> _, par(i, ORD, addout);
dryprocess = par(i, 2, encodedry(i)) :> _, par(i, ORD, addout);
revlateprocess = _,_ :>_;
revearlyprocess = par(i, 2, delay : encoderev(i)) :> _, par(i, ORD, addout);
revearlyprocess = par(i, 2, encoderev(i)) :> _, par(i, ORD, addout);
process =_, _: par(i, 2,preprocess) <: dryprocess, revlateprocess, revearlyprocess;
\ No newline at end of file
process =_, _ : par(i, 2,preprocess) <: dryprocess, revlateprocess, revearlyprocess;
\ No newline at end of file
No preview for this file type
......@@ -9,7 +9,7 @@
@prefix units: <http://lv2plug.in/ns/extensions/units#> .
<https://faustlv2.bitbucket.io/AmbiEnc>
a lv2:Plugin ;
doap:name "Ambisonic Encoder" ;
doap:name "Ambisonic Encoder 2D" ;
lv2:binary <AmbiEnc.so> ;
lv2:optionalFeature epp:supportsStrictBounds ;
lv2:optionalFeature lv2:hardRtCapable ;
......@@ -45,10 +45,10 @@
lv2:symbol "Radius_2" ;
lv2:name "Radius" ;
lv2:portProperty epp:hasStrictBounds ;
epp:rangeSteps 4990 ;
epp:rangeSteps 1990 ;
lv2:default 1 ;
lv2:minimum 0.1 ;
lv2:maximum 50 ;
lv2:maximum 20 ;
] , [
a lv2:InputPort ;
a lv2:ControlPort ;
......
No preview for this file type
......@@ -8,31 +8,31 @@ import("stdfaust.lib");
ORD = 1;
radius = hslider("Radius", 1.0, 0.1, 50, 0.01) : si.smooth(ba.tau2pole(0.02));
azimut = (hslider("Azimut", 0, -180, 180, 0.01)) * (ma.PI/180) : si.smooth(ba.tau2pole(0.02));
elevation = (hslider("Elevation", 0, -180, 180, 0.01)) * (ma.PI/180) : si.smooth(ba.tau2pole(0.02));
radius = hslider("Radius", 1.0, 0.1, 20, 0.01) : si.smooth(ba.tau2pole(0.02));
azimut = (hslider("Azimut", 0, -180, 180, 0.01) -90) * (ma.PI/180) : si.smooth(ba.tau2pole(0.02));
elevation = (hslider("Elevation", 0, -180, 180, 0.01) -90) * (ma.PI/180) : si.smooth(ba.tau2pole(0.02));
stereo = checkbox("Stereo input");
width = hslider("Stereo Width", 90, -180, 180, 0.01) : si.smooth(ba.tau2pole(0.02)) * (ma.PI/180);
erLvl = hslider("Early Reflection Lvl", 0, -20, 0, 0.01) : si.smooth(ba.tau2pole(0.02));
//preprocess = _;
//preprocess = fi.lowpass(1, 91930/radius) ;
preprocess = fi.highshelf( 1, ma.neg(0.43*radius), 15000);
//FIXME : delay make a Low-pass filter a certain frequencies...
delay = _ : de.fdelayltv(1,ma.SR, ma.SR * 1/340*radius) : _ ;
//preprocess = delay : fi.high_shelf(3, (-0.43*radius) + 0.43, 15000);
preprocess = _ : fi.highshelf(1, (-0.43*radius) + 0.43, 15000);
//preprocess = delay;
//delay = _;
delay = de.fdelayltv(1,ma.SR, ma.SR * 1/340*radius) ;
volume(r) = 1. / (r * r * (r > 0.1) + (r < 0.1));
stereAzim(ch) = ma.neg( ba.if(stereo, ba.if(ch < 1, azimut-width/2, azimut+width/2), azimut));
encodedry(ch) = _ * volume(radius)<: ho.encoder3D(ORD, _, stereAzim(ch), elevation);
encoderev(ch) = _ * ba.db2linear(erLvl) <: ho.encoder3D(ORD, _, stereAzim(ch), elevation);
encodedry(ch) = _ * volume(radius)<: ho.encoder3D(ORD, _, stereAzim(ch), elevation) : _ * ba.db2linear(-3),_,_,_;
encoderev(ch) = _ * ba.db2linear(erLvl) <: ho.encoder3D(ORD, _, stereAzim(ch), elevation) : _ * ba.db2linear(-3),_,_,_;
addout = _,_,_;
dryprocess = par(i, 2, delay : encodedry(i)) :> _, par(i, ORD, addout);
dryprocess = par(i, 2, encodedry(i)) :> _, par(i, ORD, addout);
revlateprocess = _,_ :>_;
revearlyprocess = par(i, 2, delay : encoderev(i)) :> _, par(i, ORD, addout);
revearlyprocess = par(i, 2, encoderev(i)) :> _, par(i, ORD, addout);
process =_, _: par(i, 2,preprocess) <: dryprocess, revlateprocess, revearlyprocess;
\ No newline at end of file
process =_, _ : par(i, 2,preprocess) <: dryprocess, revlateprocess, revearlyprocess;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment