Pleased to have cracked this one.
I’m working on my midi to CV converter. Having had it pointed out that Lich was a lot of HP to waste for this I added some an
ADSR … my own code from scratch, didn’t see anything in the libraries but this one sounds great.
…and a couple of other tweaks
Having got this going I got Lich to pass audio from Right input to right output and made it into a VCA using an ADSR (has to be updated at sample level, or there’s 2kHz breakthrough)
This left the Left audio input with nothing to do, so I had the idea to create a MAX function with the ADSR.
(so VCA could be used from CV in Right input as an alternate…or …)
Anyway, the MAX function wouldn’t work, …until I inverted the left audio input.
Thought I’d better report this…may save someone some headaches.
FloatArray left = buffer.getSamples(LEFT_CHANNEL);
FloatArray right = buffer.getSamples(RIGHT_CHANNEL);
for( int j=0; j<blockSize ; j++ ){
left[j] = -left[j];// this is left audio input as a float array NEEDS INVERSION
envVCA[j] = adsrVCA.GetLevel();//envVCA is a floatarray
if(left[j]>envVCA[j]){ envVCA[j] = left[j];}// took ages to find why this wouldn't work
}
right.multiply(envVCA);