clamp output samples before integerizing... but wow that's a neat effect
parent
96c22eac1d
commit
4b8688bdec
2
notes
2
notes
|
@ -92,6 +92,8 @@ TODO {
|
|||
- note transpose
|
||||
volume meter
|
||||
|
||||
"wrap clipper" (gain up, then wrap around +-1.0, then gain down)
|
||||
|
||||
Polyplexer (splits a single command input into several monophonic outputs and keeps track of individual notes between them)
|
||||
|
||||
probably three sorts of sampler (quick drum sequencer, quick single-sample "wavetable", then the full-on tracker sampler later on)
|
||||
|
|
|
@ -261,8 +261,8 @@ qint64 AudioEngine::readData(char *data, qint64 maxlen) {
|
|||
// convert non-interleaved floating point into interleaved int16
|
||||
int16_t* l = reinterpret_cast<int16_t*>(data);
|
||||
int16_t* r = reinterpret_cast<int16_t*>(data+smp);
|
||||
*l = static_cast<int16_t>(buffer[0][bufPos] * 32767);
|
||||
*r = static_cast<int16_t>(buffer[1][bufPos] * 32767);
|
||||
*l = static_cast<int16_t>(std::clamp(buffer[0][bufPos], -1.0f, 1.0f) * 32767);
|
||||
*r = static_cast<int16_t>(std::clamp(buffer[1][bufPos], -1.0f, 1.0f) * 32767);
|
||||
|
||||
bufPos++;
|
||||
data += stride;
|
||||
|
|
Loading…
Reference in New Issue