I am taking in sound as a float called scaledVol. I wish to change the spacing of the letters being drawn out by scaledVol.
This is the code snippet:
for (int i = 0; i < camWidth; i+=7){
for (int j = 0; j < camHeight; j+=9){
// get the pixel and its lightness (lightness is the average of its RGB values)
float lightness = pixelsRef.getColor(i,j).getLightness();
// calculate the index of the character from our asciiCharacters array
int character = powf( ofMap(lightness, 0, 255, 0, 1), 2.5) * asciiCharacters.size();
// draw the character at the correct location
ofSetColor(0, 255, 0);
font.drawString(ofToString(asciiCharacters[character]), f, f);
}
}
where i sets the width between character spacing and j sets the height between character spacing.
Instead of incrementing by 7 or 9, I would like to increment by a float called scaledVol.