Skip to content

Commit

Permalink
Merge pull request #51 from jyrkialakuijala/main
Browse files Browse the repository at this point in the history
better right-center-left computation
  • Loading branch information
jyrkialakuijala authored Mar 18, 2024
2 parents acaa70d + 8e47ef0 commit 3c54fb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/upmix.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run(str):
print("playing", file)
run('cp "' + file + '" /tmp/input.wav')

run("sox /tmp/input.wav -b 24 /tmp/down-dry.wav gain -10 rate 48k trim 0 60")
run("sox /tmp/input.wav -b 24 /tmp/down-dry.wav gain -10 rate 48k") # trim 0 60")

run("./build/revolve /tmp/down-dry.wav /tmp/16speakers.wav")

Expand Down
7 changes: 4 additions & 3 deletions speaker_experiments/revolve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,10 @@ struct Rotators {
float &right,
float &center,
float &left) {
float aver = 0.5 * (rightr + leftr);
float avei = 0.5 * (righti + lefti);
center = rot[2][rot_ix] * aver + rot[3][rot_ix] * avei;
float aver = rightr + leftr;
float avei = righti + lefti;
// not sure about the 0.5 on next line -- perhaps 1.0 is better?
center = 0.5 * (rot[2][rot_ix] * aver + rot[3][rot_ix] * avei);

rightr -= left_to_right_ratio * aver;
righti -= left_to_right_ratio * avei;
Expand Down

0 comments on commit 3c54fb8

Please sign in to comment.