Skip to content

Commit

Permalink
Fixes for a couple of bugs
Browse files Browse the repository at this point in the history
AudioInputTDM[2] input bug fixes issue PaulStoffregen#429
Freeverb bug fixes mono output of AudioEffectFreeverbStereo reported in https://forum.pjrc.com/threads/70334-Possible-bug-in-effect_freeverb-cpp-in-the-current-release-of-Teensyduino-(1-56)

Don't give me the credit, I just followed the instructions and did the PR!
  • Loading branch information
h4yn0nnym0u5e committed Jun 18, 2022
1 parent e566fae commit d0b2704
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion effect_freeverb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void AudioEffectFreeverbStereo::update()
outputR = sat16(bufout - outputR, 1);
if (++allpass4indexR >= sizeof(allpass4bufR)/sizeof(int16_t)) allpass4indexR = 0;

outblockR->data[i] = sat16(outputL * 30, 0);
outblockR->data[i] = sat16(outputR * 30, 0);
}
transmit(outblockL, 0);
transmit(outblockR, 1);
Expand Down
4 changes: 2 additions & 2 deletions input_tdm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ static void memcpy_tdm_rx(uint32_t *dest1, uint32_t *dest2, const uint32_t *src)
in1 = *src;
in2 = *(src+8);
src += 16;
*dest1++ = (in1 >> 16) | (in2 & 0xFFFF0000);
*dest2++ = (in1 << 16) | (in2 & 0x0000FFFF);
*dest1++ = ((in1 >> 16) & 0x0000FFFF) | ((in2 << 0) & 0xFFFF0000);
*dest2++ = ((in1 >> 0) & 0x0000FFFF) | ((in2 << 16) & 0xFFFF0000);
}
}

Expand Down
4 changes: 2 additions & 2 deletions input_tdm2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ static void memcpy_tdm_rx(uint32_t *dest1, uint32_t *dest2, const uint32_t *src)
in1 = *src;
in2 = *(src+8);
src += 16;
*dest1++ = (in1 >> 16) | (in2 & 0xFFFF0000);
*dest2++ = (in1 << 16) | (in2 & 0x0000FFFF);
*dest1++ = ((in1 >> 16) & 0x0000FFFF) | ((in2 << 0) & 0xFFFF0000);
*dest2++ = ((in1 >> 0) & 0x0000FFFF) | ((in2 << 16) & 0xFFFF0000);
}
}

Expand Down

0 comments on commit d0b2704

Please sign in to comment.