[sdiy] Silly vector synth question
Tom Wiltshire
tom at electricdruid.net
Sun Feb 6 16:55:22 CET 2011
On 6 Feb 2011, at 14:32, Colin f wrote:
>
>> Nice.
>> This is using the method Magnus suggested, isn't it?
>
> Possibly... I only just saw Magnus' post.
> Here's the formula I used:
> http://www.colinfraser.com/vector-pan-formula.gif
> I filled in the purely linear values for x distance = 0 and y distance = 0
> The formula shown for D4 can be auto-filled to the rest of the table.
> Two divides and a subtract is probably easy enough to not bother with the
> LUT.
Here's the equations I used:
// Do the A-C axis
$osc_a = round((1-$py) * ((1-$px)*100));
$osc_c = round($py * ($px*100));
// Do the B-D axis
$osc_b = round($py * ((1-$px)*100));
$osc_d = round((1-$py) * ($px*100));
$px and $py are the position of the joystick, from 0 to 1.
Note that this puts the four oscillators in the corners, necessitating a 45 degree rotation of the joystick to give the 'diamond'. I think I finally understand why they did that!
Well, it keeps you out of trouble on a Sunday afternoon.
T.
More information about the Synth-diy
mailing list