The rest of the code. The wavetables take up a lot of space, so I deleted some of them. I will update when working.
void arraysetup_rampUp(void){
wavetableC[0]=0; // Put 32 step 8 bit rampUp table into array.
wavetableC[1]=8;
wavetableC[2]=16;
wavetableC[3]=24;
wavetableC[4]=32;
wavetableC[5]=40;
wavetableC[6]=48;
wavetableC[7]=56;
wavetableC[8]=64;
wavetableC[9]=72;
wavetableC[10]=80;
wavetableC[11]=88;
wavetableC[12]=96;
wavetableC[13]=104;
wavetableC[14]=112;
wavetableC[15]=120;
wavetableC[16]=128;
wavetableC[17]=136;
wavetableC[18]=144;
wavetableC[19]=152;
wavetableC[20]=160;
wavetableC[21]=168;
wavetableC[22]=176;
wavetableC[23]=184;
wavetableC[24]=192;
wavetableC[25]=200;
wavetableC[26]=208;
wavetableC[27]=216;
wavetableC[28]=224;
wavetableC[29]=232;
wavetableC[30]=240;
wavetableC[31]=248;
}
// rest of the wavetables deleted to not have to post again
void loop(){
// "Weighted_Average" function, for morphing between two wavetables
weightValue = (analogRead(5) / 1024); // convert to percentage of 100
weightRemainder = (2 - weightValue); //find the weightValue's remainder out of 1
//find the weighted average, put it in wavetableOUT
for (int i=0; i <= 31; i++)
wavetableOUT[i]=(((weightValue * wavetableA[i] ) + (weightRemainder * wavetableC[i]))) ; //wavetableA is sinus,wavetableC is rampUp
Serial.println (wavetableA [i], DEC); //just to debug. target is:
// Serial.print (wavetableOUT [i], DEC);
Serial.print (" ");
//delay (500); // rediculously long delay
// end of "Weighted_Average" function
}
Narbotic: I had already some wavetables in the making, if yours are vastly different I'm interested. Did you have a noise wavetable? I did not do this yet.
I have a feeling this weighted average stuff will work eventually... maybe it even does. Serial.print seems to skip entries from the arrays, so monitoring isn't all that reliable.
I did not make the R2R board yet. Not enough of suited resistors in the box. Would 1K and 2 series 1K's work or is this too low resistance?
Did I see you with an oscilloscope? Might be easier to see what's happening.