From the original SynthMaker forum (2004–2014), with its members’ names and dates.
Tom7777 ·
Would be nice to have pan modules. One input version and one output version. They would allow you to have a control input so you can connect it to a lfo, Slider, Switch or something. That way you could link to a LFO ect for autopan type effects
Input Version =
Control | > Output
Input L |
Input R |
Output Vesion =
Control | > Out L
Input 1 | > Out R
stefan ·
But it takes like 10seconds to make such a module?
two mono inputs named audio and pan
two mono outputs named left and right
two multipliers, one multiplying input with pan and one multiplying input with (1.0 - pan), connect these two multipliers outs to left and right.
Shifrin ·
stefancrs wrote: But it takes like 10seconds to make such a module?
Hehe, yep, one of the first things I made was a panner 😉
Shif.
Tom7777 ·
You guys seem to forget i moved from SE to SM about 5 days ago where they have this sort of thing as default so i am still in newbie mode. And making myself seem even more stupid i can't seem to get your example working right and it seems to output the wrong values could you possibly post a screen or example file. Also how do you do the 2 input pan. Thanks
stefan ·
By "two input pan" you mean a balance control?
It's done the same way, except that you route each input to one multiplier each instead of one input to two multipliers.
where:
multiplier1 multiplies in1 with pan
multiplier2 multiplies in1 (or in2 depending on if doing pan or balance) with 1.0 - pan
I'll send jorge a screenshot.
stefan ·
To make it work like a balance control, just add one input and route that to the second multiplier instead.
Tom7777 ·
Hi, Thanks alot for this 🙂 I was going wrong when you said
multiplying input with (1.0 - pan)
as i thought you ment 1.0 going into a pan module. The image cleared things up straight away and its now working great 🙂
Tom7777 ·
Uh i don't like to complain but this doesnt seem to work as it is kind of working as an amp and not a true pan i think its to do with the way i use it within the structure and i can't seem to use it with just any values which is why i requested this as a module 🙁 thanks for trying though. Sorry if im the one making a mistake but im sure i followed correctly.
stefan ·
Uhm, what do you mean it does not work as a true pan? In what way does it not work? the pan value should be in the range 0.0 -> 1.0. Ofcourse you can not use "any values".
It could be bug related though, I'm not using the official version. There were some bugs with mono sections in the official version. Try and see if it works if you run it as a poly panner instead.
Tom7777 ·
Oh well i get it working fine if i connect it to the output of the example synth for example but there does seen to be distortion when changing the pan values. SE allowed me to use this type of pan on anything though so maybe what im really after could only be coded or something. I need it to work on any value really and maybe even set values for each output (L+R) to blend between. I guess i will have to wait a while for this though. 🙂
stefan ·
I don't quite understand what you mean when you say that you want to use the pan on "anything" and "work on any value".
Try this
Change the pan value between 0.0 and 1.0
if you get distortion, try to for instance change the waveform type of some of the oscillators. Does the distortion dissappear?
Tom7777 ·
Does the distortion dissappear?
Not really but i think its just when i change the float amount on a structure window.
I mean values really for the two way input version which in SE allows you to make blends between 2 different things (they call this one X-mix) like oscs and values so you can use it to perfectly combine any two inputs. The output version (like you made) can have values set for L+R to again allow you blending between whatever you want basically which i used all the time on various things.
Tom7777 ·
But the pan you made is a great starting point i just have to make it a bit more complex to do what i want well 🙂
stefan ·
Ok, the distortion is probably due to a bug. I'll knock a crossfader up for you.
Tom7777 ·
Thanks 🙂
stefan ·
Mono version. Just use poly multipliers instead to make a poly version.
Tom7777 ·
Thanks stefancrs, thats the type of thing i was after 🙂
bureiku ·
Cool stuff...but what I wonder is this: how do you code a panner with some sort of drop at the center? For instance, most mixers have a -3dB drop in the center to compensate for the loudness when the pan pot is at unity.
How would one incorporate this?
-Blake
Shifrin ·
<EDIT> This gives a 3dB boost in the middle not a drop, DOH! But I'll leave it here anyway for anyone interested!</EDIT>
...
I'm away from my machine with SM on but here is some pseudo code you might find useful :-
If pan position is in linear range -1 .. 1 then -1 is hard left, 0 is center and 1 is hard right. Let this be 'pan'
Convert pan position to angle in range 0 .. pi/2 radians, where 0 radians is hard left, pi/4 is center and pi/2 is hard right.
Shift range: [-1..1] + 1 = [0..2] i.e. pan = pan + 1
Scale range [0..2] * pi/4 = [0..pi/2] i.e. pan = pan * pi/4
Then the left pan value is cosine(pan), right pan value is sine(pan). The power of both channels is sin^2 + cos^2 = 1, hence constant power 🙂
There's some balance/pan bits in the ikImpulsePerc schematic (over on the Early Adopters forum) that you might want to rip out.
I've been meaning to make some more complex balance and pan modules to cater for different panning laws (linear, -3db and -6db options would be a good start). I'll post something here when I do.
As it stands I implemented a non linear version in code that behaves more like a cross fader i.e. full level until the midpoint (0.5) and then a linear decay to nothing.
Cheers,
Inigo
Nu Audio Science ·
Stef helped me write a bit of balance code that lets you choose between two modes if anyone needs it ?
Should actually be in the sound section or something
Tom7777 ·
Stef helped me write a bit of balance code that lets you choose between two modes if anyone needs it ?
yes that would be very helpfull, thanks NAS 🙂
Should actually be in the sound section or something
Yes your right NAS this should be in the sound section, when i originally made the post i was thinking higher level at the time and so much thanks to stefancrs again for showing me how to do it with maths, maybe a forum mod should move this somehow.
Thanks to everyone else also 🙂
Nu Audio Science ·
No i meant the code Stef helped with is in the sound section i think 🙂 🙂
Tom7777 ·
Ahh ok, well this post should be in the sound section also anyway but it doesn't matter that much 🙂
Wrote something here? To have a post removed or your name hidden, write to [email protected].