This writes a BMP that is read without complaint by Paint Shop Pro.
// https://forum.pjrc.com/index.php?threads/create-an-image-as-an-array-of-pixels-and-save-as-bmp-file.74006/post-334757
/*
a test script to generate an image, dump it to...
I think this is part of the problem:
dibHeader.width = 128;//width;
dibHeader.height = 48;//height;
The header you've written says that the image is 128x48 but what you actually write is what is defined here:
#define IMAGE_HEIGHT 3 //48...
The Arduino docs for the map function say it is implemented like this:
long map(long x, long in_min, long in_max, long out_min, long out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
You could define your...
float lfoAmplitudeMapped = map(lfoAmount, 0, 1023, 0, 1);
The map function only uses integers and returns an integer so the only possible values that this can return are zero or one.
Similarly, in this one
float lfoSpeedMapped = map(lfoSpeed...
The Arduino code was written for a 12-bit ADC which provided unsigned numbers in the range from zero to 4095. Subtracting 2048 from these brings the numbers into the range -2048 to +2047.
The Teensy audio blocks have signed 16-bit numbers which...