@prefix : . @prefix swh: . @prefix foaf: . @prefix doap: . @prefix swhext: . @prefix pg: . @prefix epp: . swh:matrixSpatialiser-main_in a pg:Group ; a pg:StereoGroup ; :symbol "main_in" . swh:matrixSpatialiser-main_out a pg:Group ; a pg:StereoGroup ; :symbol "main_out" . swh:matrixSpatialiser a :Plugin ; a :UtilityPlugin ; doap:name "Matrix Spatialiser" ; doap:maintainer [ foaf:name "Steve Harris"; foaf:homepage ; foaf:mbox ; ] ; doap:license ; :documentation ; :pluginProperty :hardRtCapable ; :port [ a :InputPort, :AudioPort ; :name "Input L" ; :index 0 ; :symbol "i_left" ; pg:inGroup swh:matrixSpatialiser-main_in ; pg:role pg:leftChannel ; ] ; :port [ a :InputPort, :AudioPort ; :name "Input R" ; :index 1 ; :symbol "i_right" ; pg:inGroup swh:matrixSpatialiser-main_in ; pg:role pg:rightChannel ; ] ; :port [ a :InputPort, :ControlPort ; :name "Width" ; :index 2 ; :symbol "width" ; :minimum -512 ; :maximum 512 ; :default 0.0 ; :portProperty :integer ; ] ; :port [ a :OutputPort, :AudioPort ; :name "Output L" ; :index 3 ; :symbol "o_left" ; pg:inGroup swh:matrixSpatialiser-main_out ; pg:role pg:leftChannel ; ] ; :port [ a :OutputPort, :AudioPort ; :name "Output R" ; :index 4 ; :symbol "o_right" ; pg:inGroup swh:matrixSpatialiser-main_out ; pg:role pg:rightChannel ; ] ; swhext:code """ /* thanks to Steve Harris for walking me through my first plugin ! */ #include "ladspa-util.h" /* we use sin/cos panning and start at pi/4. this is the correction factor to bring the signal back to unity gain in neutral position. it should be 1/x : sin(x) = cos(x) (~1.41421...). but since we are using an approximation of sin/cos, we take its equal gain point, which leads to 1.3333... */ #define EQUALGAINPOINT_OFFSET 128.0f #define EQUALGAINPOINT_TO_UNITY 4.0f / 3.0f #define BITSPERCYCLE 10 /* resolution of the width parameter for */ #define BITSPERQUARTER (BITSPERCYCLE-2) /* one cycle (0-2pi) */ /* borrowed code: http://www.dspguru.com/comp.dsp/tricks/alg/sincos.htm i'm using a constant of 0.75, which makes the calculations simpler and does not yield discontinuities. author: Olli Niemitalo (oniemita@mail.student.oulu.fi) */ static inline void sin_cos_approx(int phasein, float *vsin, float *vcos) { // Modulo phase into quarter, convert to float 0..1 float modphase = (phasein & ((1<current_m_gain = current_m_gain; plugin_data->current_s_gain = current_s_gain; """ ; ] ; swhext:createdBy .