improve output cells
This commit is contained in:
parent
56dbb60933
commit
c7a5f05da7
|
@ -132,24 +132,30 @@ static void LEDUpdate(void * id, struct NoteFinder*nf)
|
||||||
if( led->led_note_attached[j] != -1 ) continue;
|
if( led->led_note_attached[j] != -1 ) continue;
|
||||||
if( !led->timebased ) { selindex = j; break; }
|
if( !led->timebased ) { selindex = j; break; }
|
||||||
|
|
||||||
float bias = 0;
|
|
||||||
float timeimp = 1;
|
|
||||||
if( led->snakey )
|
if( led->snakey )
|
||||||
{
|
{
|
||||||
// bias = (j - led->snakeyplace + led->total_leds+(rand()%100)*.01);
|
float bias = 0;
|
||||||
// if( bias > led->total_leds ) bias -= led->total_leds;
|
float timeimp = 1;
|
||||||
|
|
||||||
bias = (j - led->snakeyplace + led->total_leds) % led->total_leds;
|
bias = (j - led->snakeyplace + led->total_leds) % led->total_leds;
|
||||||
|
|
||||||
if( bias > led->total_leds / 2 ) bias = led->total_leds - bias + 1;
|
if( bias > led->total_leds / 2 ) bias = led->total_leds - bias + 1;
|
||||||
timeimp = 0;
|
timeimp = 0;
|
||||||
}
|
|
||||||
|
|
||||||
float score = led->time_of_change[j] * timeimp + bias;
|
float score = led->time_of_change[j] * timeimp + bias;
|
||||||
if( score < seltime )
|
if( score < seltime )
|
||||||
|
{
|
||||||
|
seltime = score;
|
||||||
|
selindex = j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
seltime = score;
|
if( led->time_of_change[j] < seltime )
|
||||||
selindex = j;
|
{
|
||||||
|
seltime = led->time_of_change[j];
|
||||||
|
selindex = j;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( selindex >= 0 )
|
if( selindex >= 0 )
|
||||||
|
|
Loading…
Reference in a new issue