Skip to content

Commit

Permalink
Swap sample nibbles
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed May 2, 2024
1 parent 494266e commit 7290ac7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/sound/ch3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ impl CH3 {
let mut wave: [f32; 32] = [0f32; 32];

for i in 0..self.wave_ram.len() {
wave[i * 2] = (((self.wave_ram[i] & 0b0000_1111) as f32 / U4_MAX) * 2.0) - 1.0;
wave[(i * 2) + 1] = ((((self.wave_ram[i] & 0b1111_0000) >> 4) as f32 / U4_MAX) * 2.0) - 1.0;
wave[i * 2] = ((((self.wave_ram[i] & 0b1111_0000) >> 4) as f32 / U4_MAX) * 2.0) - 1.0;
wave[(i * 2) + 1] = (((self.wave_ram[i] & 0b0000_1111) as f32 / U4_MAX) * 2.0) - 1.0;
}

wave
Expand Down

0 comments on commit 7290ac7

Please sign in to comment.