Some housekeeping fixes and fix a bug with "FR" that prevented it's functioning.

This commit is contained in:
Charles Lohr 2016-08-13 14:09:16 -04:00
parent c6d1e93f5d
commit aad48e3799
4 changed files with 20 additions and 4 deletions

View file

@ -41,7 +41,7 @@ amplify = 2.0
# What is the base note? I.e. the lowest note.
# Note that it won't have very much impact until an octave up though!
base_hz = 55.0000
base_hz = 55
# This is only used when dealing with the slow decompose (now defunct)
# decompose_iterations = 1000

View file

@ -27,7 +27,7 @@ port = 7777
address = 192.168.4.1
slope=.10
amplify=.24
amplify=.35
lightx = 20
@ -42,8 +42,10 @@ sourcename =
fliprg = 1
skittlequantity = 24
base_hz = 71.5000
led_limit=.5
led_limit=1.0

View file

@ -201,6 +201,7 @@ failfx:
{
buffend += ets_sprintf(buffend, "FR%08d\t%04d\t", nr, datlen ); //Caution: This string must be a multiple of 4 bytes.
spi_flash_read( nr, (uint32*)buffend, datlen );
buffend += datlen;
break;
}
}

View file

@ -170,7 +170,7 @@ void LoadRaw()
FILE * f = fopen( rawfilename, "rb" );
if( !f )
{
fprintf( stderr, "Error: Can't open the specified rawfile.\n" );
fprintf( stderr, "Error: Can't open the specified rawfile. %s\n", rawfilename );
exit( -20 );
}
@ -200,6 +200,9 @@ void LoadRaw()
int sbp = 0;
float IntSoundBuffer[sbs];
FILE * fr = fopen( "folded_data.txt", "w" );
for( i = 0; i < SoundPictureStacks; i++ )
{
int nplace = ((int)(SoundPictureTime * (i+1)))&0xffffffe;
@ -233,8 +236,16 @@ void LoadRaw()
{
SoundPicture[i*SoundPictureBins+j] = nf->outbins[j];
}
for( j = 0; j < nf->freqbins; j++ )
{
fprintf( fr, "%f ", nf->folded_bins[j] );
}
fprintf( fr, "\n" );
}
fclose( fr );
FILE * pic = fopen( "pic.pgm", "wb" );
fprintf( pic, "P6\n%d %d\n255\n", SoundPictureStacks, SoundPictureBins );
int x, y;
@ -258,6 +269,8 @@ void LoadRaw()
}
fclose( pic );
}
int main(int argc, char ** argv)