C219: fix surround chan osc

issue #1762
This commit is contained in:
tildearrow 2024-02-14 16:18:05 -05:00
parent 523a290374
commit f021bd0012
2 changed files with 11 additions and 7 deletions

View file

@ -76,10 +76,10 @@ void DivPlatformC140::acquire_219(short** buf, size_t len) {
writes.pop();
}
c219_tick(&c219, 1);
c219_tick(&c219,1);
// scale as 16bit
c219.lout >>= 10;
c219.rout >>= 10;
c219.lout>>=10;
c219.rout>>=10;
if (c219.lout<-32768) c219.lout=-32768;
if (c219.lout>32767) c219.lout=32767;
@ -91,7 +91,11 @@ void DivPlatformC140::acquire_219(short** buf, size_t len) {
buf[1][h]=c219.rout;
for (int i=0; i<totalChans; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(c219.voice[i].lout+c219.voice[i].rout)>>10;
if (c219.voice[i].inv_lout) {
oscBuf[i]->data[oscBuf[i]->needle++]=(c219.voice[i].lout-c219.voice[i].rout)>>10;
} else {
oscBuf[i]->data[oscBuf[i]->needle++]=(c219.voice[i].lout+c219.voice[i].rout)>>10;
}
}
}
}

View file

@ -108,7 +108,7 @@ const char* sh_oscRender_srcF=
" float x1 = uv.x-uAdvance;\n"
" float x2 = uv.x;\n"
" float x3 = uv.x+uAdvance;\n"
" float val1 = texture2D(oscVal,vec2(x2,1.0)).x;\n"
" float val1 = texture2D(oscVal,vec2(x1,1.0)).x;\n"
" float val2 = texture2D(oscVal,vec2(x2,1.0)).x;\n"
" float val3 = texture2D(oscVal,vec2(x3,1.0)).x;\n"
" float valmax = max(max(val1,val2),val3);\n"
@ -121,7 +121,7 @@ const char* sh_oscRender_srcF=
" alpha=fur_fragCoord.y-valmin*uResolution.y*0.5+uLineWidth*0.5;\n"
" }\n"
" if (slope>1.0) {\n"
" gl_FragColor = vec4(0.0,1.0,0.0,uColor.w*clamp(alpha,0.0,1.0));\n"
" gl_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha,0.0,1.0));\n"
" } else {\n"
" gl_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha,0.0,1.0));\n"
" }\n"
@ -169,7 +169,7 @@ const char* sh_oscRender_srcF=
" float x1 = uv.x-uAdvance;\n"
" float x2 = uv.x;\n"
" float x3 = uv.x+uAdvance;\n"
" float val1 = texture(oscVal,x2).x;\n"
" float val1 = texture(oscVal,x1).x;\n"
" float val2 = texture(oscVal,x2).x;\n"
" float val3 = texture(oscVal,x3).x;\n"
" float valmax = max(max(val1,val2),val3);\n"