Unlinking Stereo Channels III

January 15th, 2013
experiment, math, music, sound, tech, vsl1818
Success! I can now display eight independent mono channels to the user while internally representing that as four stereo channels. Before I was struggling with how to extract the underlying equations that VSL is using to turn gain/pan into left/right, but I decided to give up and just brute-force it. I made a giant table (csv):
  pan, gain, left, right
  ...
  34, 80, 0.783, 0.69
  34, 81, 0.793, 0.701
  34, 82, 0.804, 0.712
  34, 83, 0.815, 0.717
  34, 84, 0.821, 0.728
  34, 85, 0.832, 0.739
  34, 86, 0.842, 0.75
  34, 87, 0.853, 0.761
  34, 88, 0.859, 0.766
  34, 89, 0.87, 0.777
Then to implement to_left_right(gain, pan) and to_gain_pan(left, right) I just find the table row that best corresponds to the desired conditions and use that. So if I call to_gain_pan(left=0.83, right=0.74) it will probably identify the line 34, 85, 0.832, 0.739 as closest and so decide to set gain to 85% and pan to 34%.

It bothers me a little to use something so inefficient (Index it! Figure out the equations!), but it's fast enough. And it works. So now I can use all eight channels for their own mixes.

Comment via: google plus, facebook

Recent posts on blogs I like:

Book Review: Why They Do It

my quest to get my readers not to commit fraud

via Thing of Things March 3, 2025

Breakfast Over February Break

Over February break I made breakfast for me and Nora three days in a row. Normally, my dad makes me, Nora, and Lily breakfast, but my dad and Lily were on a trip and my mom wasn't up yet so I was basically the only one in the house who was awake and cou…

via Anna Wise's Blog Posts March 1, 2025

2024-25 New Year review

This is an annual post reviewing the last year and setting intentions for next year. I look over different life areas (work, health, parenting, effectiveness, travel, etc) and analyze my life tracking data. Overall this was a pretty good year. Highlights …

via Victoria Krakovna January 15, 2025

more     (via openring)